Source
yaml
id: dbt-motherduck
namespace: company.team
tasks:
- id: git
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone_repository
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main
- id: dbt_build
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
containerImage: ghcr.io/kestra-io/dbt-duckdb:latest
profiles: |
my_dbt_project:
outputs:
dev:
type: duckdb
disable_transactions: true
path: md:my_dbt_project?motherduck_token={{secret('MOTHERDUCK_TOKEN')}}
fixed_retries: 1
threads: 16
timeout_seconds: 300
target: dev
commands:
- dbt deps
- dbt build
About this blueprint
Data
This workflow runs a full dbt ELT pipeline on MotherDuck by executing dbt directly from a Git repository inside a Docker container.
The flow performs the following actions:
- Clones a dbt project from GitHub
- Connects dbt to MotherDuck using DuckDB’s native MotherDuck integration
- Installs dbt dependencies with
dbt deps - Builds models, tests, and snapshots using
dbt build - Executes the entire pipeline inside a reproducible Docker environment
This pattern is ideal for:
- Cloud-native DuckDB analytics with MotherDuck
- Shared analytical databases without managing infrastructure
- dbt development and CI pipelines using MotherDuck as the execution engine
- Teams migrating from local DuckDB to a collaborative DuckDB backend
- Lightweight ELT pipelines without BigQuery, Snowflake, or Redshift
Authentication to MotherDuck is handled securely via a Kestra secret containing the MotherDuck service token. This allows the same dbt project to run locally, in CI, or in production without changing configuration.
More Related Blueprints