Skip to content

dbt vs Airflow: What's the Difference?

dbt handles data transformation — it defines what your data becomes. Airflow handles orchestration — it defines when and how your pipelines run. They solve different problems and are almost always used together in production.

dbt

Transformation layer

  • Writes SQL models as .sql files
  • Tests data quality with built-in assertions
  • Runs inside your data warehouse (Snowflake, BigQuery, etc.)
  • Triggered by Airflow or CI/CD
Airflow

Orchestration layer

  • Schedules pipeline runs on a cron-like schedule
  • Manages dependencies between jobs in a DAG
  • Triggers dbt via BashOperator or DbtTaskGroup
  • Handles retries, alerting, and cross-system orchestration

The Simple Mental Model

Think of it this way: Airflow is the scheduler and dbt is the worker. Airflow decides “run this pipeline every morning at 6am”, and dbt does the actual SQL transformation work inside Snowflake or BigQuery.

When to Use Each

Use dbt when:

  • Writing SQL transformations
  • Testing data quality with assertions
  • Documenting models and lineage
  • Building a semantic layer

Use Airflow when:

  • Scheduling recurring jobs
  • Managing multi-step pipelines with dependencies
  • Orchestrating across systems (dbt + Spark + Python scripts)

Use both when:

  • Running production data pipelines (the industry standard is Airflow triggers dbt)

How They Work Together

# Airflow DAG triggering dbt
from airflow.operators.bash import BashOperator

dbt_run = BashOperator(
    task_id='dbt_run',
    bash_command='dbt run --profiles-dir /opt/airflow/dbt',
)

dbt_test = BashOperator(
    task_id='dbt_test',
    bash_command='dbt test --profiles-dir /opt/airflow/dbt',
)

dbt_run >> dbt_test

Common Mistakes

  • Trying to replace Airflow with dbt — dbt does not schedule jobs
  • Trying to replace dbt with Airflow — Airflow does not write SQL transformations
  • Using dbt Cloud's built-in scheduler in isolation when you already have Airflow

Related

Press Cmd+K to open