Combining Airflow / Dagster with dbt Core & dbt Cloud
Trigger dbt Core or Cloud runs from Airflow/Dagster with clear ownership of tests and deploys.
In plain words
Orchestrator freshness/readiness event. Next, pinned command, selector, target, and artifact path. Finally, docs/catalog metadata and downstream dependency release.
Think of it like…
dbt is the SQL build tool and its manifest is the blueprint; the orchestrator is site management deciding when construction may begin and how a failed inspection blocks delivery.
Where you’ve seen it
Airflow waits for a source, runs dbt build --select tag:daily+ --fail-fast --target prod, stores artifacts, and triggers warehouse validation; Dagster can expose individual dbt models as assets or one grouped job by adapter/provider.
Words you’ll hear
- dbt Core
- The open-source CLI and project runtime that executes dbt compilation/transformation inside a managed command environment.
- dbt Cloud
- A hosted dbt service exposing scheduled jobs, IDE, API, artifacts, and execution infrastructure.
- Orchestration
- The outer workflow system responsible for time, cross-tool dependencies, retry admission, and process state.
- Operational boundary
- Using
dbt runafter every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion. Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collectmanifest.jsonandrun_results.json, and map node failures/tests/exposures into task or asset state.
Visual diagram
Theory & deep dive
dbt Core: the working mechanism
Airflow or Dagster should own task timing, retries, dependencies, and dbt process execution, while dbt owns compiled SQL graph/tests; integration must propagate selectors, artifacts, and failure state across that boundary.
Orchestrator freshness/readiness event. Pinned command, selector, target, and artifact path, then task/assets, run results, failures, and retries; this exposes the state governed by Orchestration.
Airflow waits for a source, runs dbt build --select tag:daily+ --fail-fast --target prod, stores artifacts, and triggers warehouse validation; Dagster can expose individual dbt models as assets or one grouped job by adapter/provider.
Combining Airflow / Dagster with dbt Core & dbt Cloud: failure mode and production response
Using dbt run after every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion.
Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collect manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state. Track Artifact path as "manifest and run results retained per run", and make Selector scope visible to the dataset owner.
manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state.How it works, step by step
Step 1 of 41. Gate source
Orchestrator freshness/readiness event. Airflow or Dagster should own task timing, retries, dependencies, and dbt process execution, while dbt owns compiled SQL graph/tests; integration must propagate selectors, artifacts, and failure state across that boundary.
- Artifact path
- manifest and run results retained per run
- dbt Cloud
- A hosted dbt service exposing scheduled jobs, IDE, API, artifacts, and execution infrastructure.
When to use it & trade-offs
What it is
Airflow or Dagster should own task timing, retries, dependencies, and dbt process execution, while dbt owns compiled SQL graph/tests; integration must propagate selectors, artifacts, and failure state across that boundary. Airflow waits for a source, runs dbt build --select tag:daily+ --fail-fast --target prod, stores artifacts, and triggers warehouse validation; Dagster can expose individual dbt models as assets or one grouped job by adapter/provider.
Why it matters: Using dbt run after every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion. Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collect manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state.
When to reach for it
- Trigger dbt Core or Cloud runs from Airflow/Dagster with clear ownership of tests and deploys.
- Choose dbt Core because it provides this capability: The open-source CLI and project runtime that executes dbt compilation/transformation inside a managed command environment.
- Keep evidence for Artifact path at "manifest and run results retained per run" so the last production stage-Publish - docs/catalog metadata and downstream dependency release-remains testable.
When to avoid or be careful
- Using
dbt runafter every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion. - Do not conflate dbt Cloud with dbt Core. The second concept contributes different behavior: A hosted dbt service exposing scheduled jobs, IDE, API, artifacts, and execution infrastructure.
- Release only after this guardrail is in place: Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collect
manifest.jsonandrun_results.json, and map node failures/tests/exposures into task or asset state.
dbt Core / dbt Cloud / Orchestration - roles, limits, and operating cost
Strengths: The open-source CLI and project runtime that executes dbt compilation/transformation inside a managed command environment. Airflow or Dagster should own task timing, retries, dependencies, and dbt process execution, while dbt owns compiled SQL graph/tests.
Watch out: Using dbt run after every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion.
Strengths: A hosted dbt service exposing scheduled jobs, IDE, API, artifacts, and execution infrastructure. In this workflow it supports: Interpret nodes - task/assets, run results, failures, and retries.
Watch out: The operating cost is real: exact models/tests in the intended graph.
Strengths: The outer workflow system responsible for time, cross-tool dependencies, retry admission, and process state. Its output can be checked with Failure mapping.
Watch out: Operating guardrail: Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collect manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state.
Interview signals & numbers to know
When this topic comes up
- “Where is the failure boundary for dbt Core, and how would Artifact path reveal it?”
- “Why is dbt Cloud distinct from this behavior: the outer workflow system responsible for time, cross-tool dependencies, retry admission, and process state?”
- Production clue: Using dbt run after every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion.
- Design probe: Make one orchestrated dbt invocation per logical dependency, pass environment/selection/full-refresh inputs explicitly, collect manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state.
Benchmarks & rules of thumb
- Artifact path
- manifest and run results retained per run
- Selector scope
- exact models/tests in the intended graph
- Failure mapping
- dbt node/test status reaches orchestrator SLA and rerun
Common mistakes & follow-ups
Common interview mistakes
- Using
dbt runafter every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion. - Reporting success from a job exit code without checking Artifact path and Selector scope.
- Treating this example as complete without replay, rollback, or access boundaries: Airflow waits for a source, runs
dbt build --select tag:daily+ --fail-fast --target prod, stores artifacts, and triggers warehouse validation; Dagster can expose individual dbt models as assets or one grouped job by adapter/provider.
Likely interviewer follow-ups
- How would you prove this contract instead of only checking that the command ran: The open-source CLI and project runtime that executes dbt compilation/transformation inside a managed command environment.
- What does the recovery plan do when this occurs? Using
dbt runafter every Airflow task rebuilds an uncontrolled graph, and treating the dbt Cloud job as green while downstream artifact failures are ignored creates false completion. - When is dbt Core insufficient for Selector scope, and what does adding dbt Cloud cost in Artifact path?
manifest.json and run_results.json, and map node failures/tests/exposures into task or asset state.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Combining Airflow / Dagster with dbt Core & dbt Cloud with data engineer interview Q&A and hands-on practice.