Skip to content
Transformations

dbt transformation

Configure a dbt transformation in Keboola — connect a remote warehouse or use Keboola Storage, link the dbt project repository, define execution steps, set freshness and output mapping, and run or debug it.

The dbt transformation configuration page — dbt Project Repository, Storage Sources, and Execution Steps (dbt build, run, docs generate checked), with the run panel showing Backend version 1.8.6, Timeout 16h, Backend size Small, and Threads 4

The required connection parameters for your remote data warehouse vary depending on the selected backend type. Use the Run Debug option in the right panel to validate the connection using the entered parameters.

The Database Connection form with Host, Warehouse, Database, Schema, User, Authentication Type (Key-pair), and a Private Key field

First, you must define a repository by specifying the URL (ending with GIT) and entering the access credentials if required.

The dbt Project Repository section with the Project URL, a Private toggle, a Load Branches button, and the Branch field set to deployment

After saving a configuration, click Load Branches to select the desired branch. Don’t forget to click Save.

The Branch dropdown expanded after a successful Reload Branches, listing origin/HEAD, origin/dbt_cloud, origin/deployment, and other branches

The Execution Steps list with dbt run and dbt docs generate checked and dbt debug, source freshness, test, and seed unchecked, each step draggable with edit and delete controls

Select the desired execution steps, then edit or rearrange them as needed.

By editing individual steps, you can append flags or specify resources to the command. Available options vary depending on the command. Please refer to the documentation for details.

For example, you can use the following command:

dbt run --select "path:marts/finance,tag:nightly,config.materialized:table" --full-refresh

The Update Step dialog editing a step to dbt run --select "path:marts/finance,tag:nightly,config.materialized:table" --full-refresh

If you run the dbt source freshness step in your project, you can set time limits for displaying warnings and errors. Both time limits can be enabled and configured independently.

The Freshness settings with Warn After set to 1 Day and Error After set to 2 Days

Artifacts generated by dbt (all steps except dbt deps and dbt debug) are automatically stored in Keboola Storage. Depending on the configuration, they are saved either as a compressed ZIP file or as individual files.

Output Mapping (Keboola Storage Component Only)

Section titled “Output Mapping (Keboola Storage Component Only)”

This is a specific configuration needed for the Keboola dbt component. Define which tables will be imported within storage. This configuration uses a standard output mapping UI element with configuration options, such as incremental or full load, filters, etc.

The Output Mapping dialog for the beers table — Table name beers, Destination OUT / dbt-beer-demo / beers, Incremental checked, and Primary Key BEER_ID

Before running the dbt transformation, you can configure additional parameters (such as the dbt Core version, backend size, and number of threads), run debug command, or view generated project documentation.

The run panel with a Run Transformation button and Backend version 1.8.6, Timeout 16h, Run debug, Backend size Small, Threads 4, dbt project documentation, and Automatic data types enabled

To verify that your credentials and project setup are correct, you can run a debug job. This is the same as running dbt debug from the command prompt.

The Run debug button will create a separate job with standard logging, exposing the results of the dbt debug command.

When you press dbt Project Documentation, the job will generate the necessary files within artifacts to power documentation. The dbt documentation is then accessible via the button from the main configuration screen. Clicking the button synchronously generates the documentation in a popup.

When you manually run a dbt transformation, a new job is triggered with standard logging and stores information such as:

  • Person (token) triggered job

  • Start, end, and duration of the job

  • Job parameters

  • Component execution log

  • dbt deps and repository information

  • Full dbt log for all steps defined

  • Storage output (Keboola dbt)

  • Record of producing and storing artifacts

You can also access all configuration jobs from the configuration screen and the Jobs menu section.

The Discover tab is designed to provide more information about the run. Keboola plans to expand this tab to offer additional insights. Currently, it provides the timeline designed to visually display the duration of each model build.

The Discovery tab's Model timing timeline showing the build duration of each model (beers, order_lines, orders, sales) across a time axis

Keboola automatically generates a profiles.yml file for your dbt transformation. Here, you can see what the generated file looks like:

default:
outputs:
kbc_prod:
type: '{{ env_var("DBT_KBC_PROD_TYPE") }}'
user: '{{ env_var("DBT_KBC_PROD_USER") }}'
private_key: '{{ env_var("DBT_KBC_PROD_PRIVATE_KEY") }}'
# or use a deprecated password
# password: '{{ env_var("DBT_KBC_PROD_PASSWORD") }}'
schema: '{{ env_var("DBT_KBC_PROD_SCHEMA") }}'
warehouse: '{{ env_var("DBT_KBC_PROD_WAREHOUSE") }}'
database: '{{ env_var("DBT_KBC_PROD_DATABASE") }}'
account: '{{ env_var("DBT_KBC_PROD_ACCOUNT") }}'
threads: '{{ env_var("DBT_KBC_PROD_THREADS")| as_number }}'
target: kbc_prod

If needed, you can use a profiles.yml file committed in your dbt project repository for Remote DWH components and set the target according to your requirements. In this case, you must use the environment variables mentioned above in the generated profiles.yml and specify the target in each executed step. Your committed profiles.yml file will be merged with the automatically generated version.

Ask Kai

Ask anything about Keboola — I'll search the docs and cite the pages I use.