Blueprints

Git workflow for dbt with Snowflake

Source

yaml
id: dbt-snowflake
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
        type: io.kestra.plugin.dbt.cli.DbtCLI
        taskRunner:
          type: io.kestra.plugin.scripts.runner.docker.Docker
        containerImage: ghcr.io/kestra-io/dbt-snowflake:latest
        profiles: |
          my_dbt_project:
            outputs:
              dev:
                type: snowflake
                account: "{{ secret('SNOWFLAKE_ACCOUNT') }}"
                user: "{{ secret('SNOWFLAKE_USER') }}"
                password: "{{ secret('SNOWFLAKE_PASSWORD') }}"
                role: "{{ secret('SNOWFLAKE_ROLE') }}"
                database: "{{ secret('SNOWFLAKE_DATABASE') }}"
                warehouse: COMPUTE_WH
                schema: public
                threads: 4
                query_tag: dbt
                client_session_keep_alive: False
                connect_timeout: 10
            target: dev
        commands:
          - dbt deps
          - dbt build

About this blueprint

Snowflake Git dbt

This flow: - clones a dbt Git repository from GitHub - pulls a public container image with the required dependencies - runs dbt CLI commands within a container This flow assumes that your Snowflake credentials are stored as secrets. To run a flow from this blueprint, you can simply copy-paste the contents of your ~/.dbt/profiles.yml into the profiles section and you're good to go!

Working Directory

Clone

Dbt CLI

Docker

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra