Skip to content
Transformations Updated November 27, 2026

Code Patterns

Generate transformation code from a form with a Code Pattern: where to find patterns, creating a transformation, mapping, parameters, and generated code.

Code Pattern is a special type of component that

Before you start

You need

  • A transformation type that a code pattern supports. The public SCD code pattern works with Snowflake SQL and Synapse transformations. A pattern shows up in Use predefined code pattern only for the transformation types it lists.
  • A project role that can create configurations. The ReadOnly role cannot. In projects with Governed Change Management, Developers and Reviewers work in a development branch and can’t edit the production branch. See user roles.

What each tab needs

  • Prompt tab Kai, the Kai Agent button in the top bar, on supported stacks. A new Free Plan project has it from the start; elsewhere an organization admin turns it on once: Get started with Kai.
  • UI tab a browser.
  • CLI / API tab kbagent, connected to your project. The checks only read.

All components published with Code Pattern can be found in the Keboola Developer Portal (opens in a new tab). To find out which transformation types a component can be used for, read its description.

Screenshot -- Transformations page

This section describes how to create a new transformation with a code pattern.

First, click Transformations on the project menu.

Then click New Transformation to create a new transformation.

Screenshot -- Transformations page

In the modal, click the selected type of the transformation.

Screenshot -- Add new transformation modal

Fill in the name and, optionally, a description.

Then select a code pattern from the Use predefined code pattern select box.

If a code pattern is missing in the list, please check whether it supports the selected transformation type and it is published.

Click the Create Transformation button.

Screenshot -- Select box for code pattern

A new transformation has been created and you can see its configuration.

You can now fill in the Parameters Form and click the Generate Code button.

Follow the instructions at the top of the configuration page.

Screenshot -- Code pattern user interface

The user interface of the configuration consists of the following:

  1. Instructions on how to set up the code pattern correctly
  2. Table Input Mapping
  3. Table Output Mapping
  4. Parameters Form of the code pattern
  5. Generate Code button
  6. Read-only generated code

Table Input and Output Mapping can be created either

  • manually as in ordinary transformations, or
  • automatically, generated together with the code if the component supports it.

Follow the instructions at the top of the configuration page.

Below you can see an example mapping. It was generated by the Snapshot - SCD code pattern.

Screenshot -- Input / Output mapping

The parameters determine the content of the generated code. The form is generated dynamically based on the component specification in the Keboola Developer Portal (opens in a new tab). Remember to save your changes.

Screenshot -- Parameters

Generated code is read only, it cannot be adjusted manually. It is (re)generated by clicking the Regenerate Code button. This calls the Generate Action (opens in a new tab) on the code pattern component with the actual parameters. The result is then saved and displayed.

Screenshot -- Generated Code

After the code has been generated, you can run the job the standard way.

Check:

Prompt
Does the transformation my-transformation have generated code, and did its latest job succeed?

Kai only reads here, so it asks for no approval, and its answer links to what it found in your project.

Ask Kai

Hi, I'm Kai — Keboola's AI assistant for the docs. Ask me anything and I'll answer from the documentation and cite the pages I use.

Kai is an AI and can make mistakes. Check the sources it links.