Skip to content

/glossary/airflow/dag

What is a DAG in Apache Airflow?

The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
tool
Apache Airflow
versions
Apache Airflow 2.x, Apache Airflow 3.x
os
any

A DAG (directed acyclic graph) is the unit of work in Apache Airflow: a set of tasks connected by dependencies that only point forward, so the graph has no cycles. The DAG also carries a schedule; for each scheduled interval Airflow creates a DAG run and executes the tasks in dependency order.

Example

dags/daily_report.py
from datetime import datetime
from airflow.sdk import dag, task   # Airflow 3; in Airflow 2: from airflow.decorators import dag, task

@dag(schedule="@daily", start_date=datetime(2026, 1, 1), catchup=False)
def daily_report():
    @task
    def extract():
        return [3, 1, 2]

    @task
    def transform(rows):
        return sorted(rows)

    @task
    def load(rows):
        print(rows)

    load(transform(extract()))     # extract >> transform >> load

daily_report()

Terms around a DAG

TermMeaning
Taskone node of the DAG: an operator, a sensor or a @task function
Dependencyan edge: a >> b means b runs after a succeeds (by default)
DAG runone execution of the DAG for a logical date or a manual trigger
Task instanceone execution of one task inside a DAG run
schedulecron expression, preset (@daily) or a timetable / asset trigger
catchupwhether to create runs for past intervals since start_date

"Acyclic" is a hard rule: Airflow refuses to load a DAG file whose dependencies form a cycle, and reports the problem as an import error in the UI.

Sources