dbt vs Airflow: Where Each Fits
Last Updated: July 2026 | 10 min read
📚 Lesson in the Orchestration & Transformation track of our free Learn Data Engineering course. Builds on Apache Airflow fundamentals.
Quick Answer: dbt vs Airflow is a false rivalry — they do different jobs. dbt is a transformation tool: it builds, tests, and documents data models using SQL that runs inside your warehouse (the "T" in ELT). Airflow is an orchestrator: it schedules and runs tasks in the right order across any tools, with dependencies, retries, and monitoring. dbt transforms data; Airflow decides when and what runs. Most mature teams use both — Airflow orchestrates the pipeline, and one of its tasks runs dbt.
"dbt vs Airflow" is one of the most common — and most misunderstood — questions in the modern data stack. People frame it as a choice, but they operate at different layers. This lesson clears up the confusion: what each tool actually does, when you need one or both, and the pattern for combining them.
The core distinction: transformation vs orchestration
dbt transforms data inside the warehouse; Airflow orchestrates tasks across the whole pipeline. That's the entire distinction, and everything else follows from it.

- dbt answers: "How do I turn raw warehouse tables into clean, tested, documented models?" — with SQL.
- Airflow answers: "How do I run ingestion, then transformation, then ML — in order, on schedule, with retries?" — with a DAG.
They sit at different points in the modern data stack: Airflow is the orchestration layer; dbt is the transformation layer. Comparing them is a bit like comparing a project manager to a specialist — one coordinates, the other does a specific job well.
What dbt does
dbt (data build tool) transforms data in your warehouse using version-controlled, tested, documented SQL. You write SELECT statements as "models," and dbt handles the rest:
- Models — each is a SQL query; dbt materializes it as a table or view.
ref()dependencies — dbt figures out the order to build models from how they reference each other.- Tests — declare assertions (not null, unique, relationships) that run against your data.
- Docs & lineage — auto-generated documentation and a dependency graph of your models.
dbt implements the ELT pattern: raw data is already loaded, and dbt does the in-warehouse transformation. It even handles patterns like SCD Type 2 via snapshots. What dbt does not do is ingest data, run Spark, or schedule arbitrary cross-tool workflows.
What Airflow does
Airflow orchestrates any tasks with dependencies, on a schedule, with retries and monitoring. As covered in Airflow fundamentals, you define a DAG of tasks, and Airflow runs them in order:
- Coordinates steps across tools — ingestion, Spark, SQL, dbt, ML, notifications.
- Manages dependencies ("run transform only after extract succeeds").
- Provides retries, backfills, alerting, and a monitoring UI.
Airflow is tool-agnostic: it doesn't care what a task does, only when it should run and what it depends on. It's the conductor, not a player.
dbt vs Airflow, side by side
| Dimension | dbt | Apache Airflow |
|---|---|---|
| Category | Transformation | Orchestration |
| Job | Build/test SQL models in the warehouse | Schedule & run tasks in order |
| Scope | In-warehouse ELT only | Any task, any tool |
| Language | SQL (+ Jinja) | Python (DAGs) |
| Dependencies | Between its own models (ref) |
Between any tasks |
| Gives you | Tests, docs, lineage | Scheduling, retries, monitoring |
| Layer | The "T" in ELT | The whole pipeline |
The takeaway from the table: their columns barely overlap. Where they touch — both "manage dependencies" — dbt manages model dependencies while Airflow manages task dependencies. Different scope entirely.
Using them together: the common pattern
The mature setup is Airflow orchestrating a pipeline in which one task runs dbt. A typical daily DAG:
ingest >> dbt_run >> dbt_test >> refresh_dashboards
Here Airflow schedules the whole thing and handles retries and alerting, while the dbt_run/dbt_test tasks invoke dbt to do the actual transformation and testing. You can wire this with a simple BashOperator calling the dbt CLI, or with integrations like Cosmos that render each dbt model as its own Airflow task for finer control.
Rule of thumb: if the question is "how do I transform this warehouse data?" → dbt. If the question is "how do I run these steps in order, on schedule, across tools?" → Airflow. When you have both needs — which is most real pipelines — use both.
How to choose (or combine)
- Only doing SQL transformations in a warehouse? → dbt alone (with dbt Cloud's scheduler or cron) may be all you need.
- Coordinating many steps across different tools? → Airflow for orchestration.
- Both — ingestion + transformation + more, on a schedule? → Airflow + dbt together, the standard modern-stack pattern.
- Just starting and it's all warehouse SQL? → Start with dbt; add Airflow when the surrounding pipeline outgrows transformation.
Try it yourself — pick the right tool
For each need, choose dbt, Airflow, or both:
- Turn raw
stg_ordersinto a clean, testedfct_ordersmodel in Snowflake. - Run a Fivetran sync, then a Spark job, then dbt, then send a Slack alert — in that order, nightly.
- Ensure model
revenueis built only after modelordersit references.
Show answers
1. **dbt** — in-warehouse SQL transformation with tests is exactly dbt's job. 2. **Both (Airflow orchestrating)** — coordinating a sync, a Spark job, dbt, and an alert across tools on a schedule is orchestration; Airflow runs the sequence and calls dbt as one step. 3. **dbt** — dbt resolves model build order automatically from `ref()`, so it handles this dependency itself.Common mistakes with dbt and Airflow
- Framing it as either/or. They're complementary layers; the real question is usually "do I need orchestration on top of transformation?"
- Using Airflow to write transformations in Python when SQL-in-warehouse (dbt) would be cleaner, tested, and documented.
- Forcing dbt to be an orchestrator for non-SQL, cross-tool workflows it was never designed to run.
- Running dbt with no tests. dbt's tests are a core benefit; skipping them wastes half the tool's value.
- Over-orchestrating early. A small SQL-only project doesn't need Airflow yet; dbt plus a scheduler is plenty until complexity grows.
Frequently Asked Questions
What is the difference between dbt and Airflow?
They solve different problems. dbt is a transformation tool — it builds, tests, and documents data models using SQL that runs inside your warehouse (the "T" in ELT). Airflow is an orchestrator — it schedules and runs tasks in order, handling dependencies, retries, and monitoring across any tools. dbt transforms data; Airflow decides when and what runs. They're complementary.
Do I need both dbt and Airflow?
Not always. If your pipeline is only SQL transformations in a warehouse, dbt alone (with dbt Cloud's scheduler or cron) may suffice. If you coordinate many steps across tools — ingestion, Spark, SQL, ML — you need an orchestrator like Airflow. Many teams use both: Airflow schedules and coordinates, and one task runs dbt.
Can Airflow run dbt?
Yes — it's a common pattern. An Airflow DAG can trigger dbt as a task, either by running the dbt CLI (dbt run, dbt test) via a BashOperator, or with integrations like Cosmos that turn each dbt model into an Airflow task. This wraps Airflow's scheduling, dependency management, and monitoring around dbt's transformation and tests.
Is dbt an orchestration tool?
Not fully. dbt manages dependencies between its own SQL models and runs them in order, so it orchestrates transformations. But it doesn't orchestrate arbitrary tasks across other systems, handle complex scheduling, or provide general workflow monitoring like Airflow. dbt orchestrates within transformation; Airflow orchestrates the whole pipeline.
When should I use dbt instead of Airflow?
Use dbt when your work is transforming warehouse data with SQL — building clean, tested, documented models. Use Airflow when you need to coordinate multiple steps across tools with dependencies, schedules, and failure recovery. If your only need is warehouse SQL transformation, start with dbt; add Airflow when the surrounding pipeline grows.
Conclusion
dbt and Airflow aren't competitors — dbt is the transformation layer, Airflow is the orchestration layer. dbt turns raw warehouse tables into clean, tested, documented models with SQL; Airflow schedules and coordinates tasks across your whole pipeline. Small SQL-only projects can start with dbt alone; anything with cross-tool steps needs Airflow — and the mature setup runs dbt inside an Airflow DAG.
That completes the Orchestration & Transformation track of the free Learn Data Engineering course. Next you'll take everything to the cloud and build an end-to-end pipeline. Standing up transformation and orchestration for your data team? Get matched with a vetted data engineer on SolutionGigs — it's free to post a project.
Mohammed Yaseen
Founder, SolutionGigs
Mohammed runs dbt transformations orchestrated by Airflow in production and teaches the Orchestration track of the free Learn Data Engineering course. LinkedIn →