Orchestration: the DAG runs the show
Four stages, a quality gate, incremental loads — all still started by a human typing commands in the right order. Orchestration is the layer that runs the stages for you: in order, on a schedule, with retries, and with a phone call's worth of visibility when something breaks. In Airflow, that plan is a DAG — tasks as nodes, dependencies as arrows.
The code
from datetime import datetime
from airflow.decorators import dag, task
@dag(schedule="@daily", start_date=datetime(2026, 11, 12),
catchup=False)
def station_pipeline():
@task
def ingest(): ...
@task
def land_raw(): ...
@task
def build_silver(): ...
@task
def check_quality(): ...
@task
def publish_gold(): ...
ingest() >> land_raw() >> build_silver() >> check_quality() >> publish_gold()
station_pipeline()
In practice
The DAG declares order and schedule; Airflow handles the rest. Retries (a flaky API gets three attempts before anyone is paged), a log per task, and a graph view where one red task shows exactly which stage failed and which stages never ran.
catchup=False is a safety setting. If the scheduler is off for a week, catchup would stampede a week of backlogged runs the moment it restarts. Off means: run the latest interval, skip the pile-up. Running the past *on purpose* is a different tool — tomorrow's lesson.
Keep the separation clean. The orchestrator decides *when* and *in what order*; your stage code decides *what*. Airflow tasks should call the pipeline functions from Lessons 30–36, not contain them — the same stages must stay runnable by hand the day Airflow itself is down.
Python bridge: A DAG is your cron schedule plus your run log plus 'if this fails, stop' discipline, made explicit and visible — same instincts, real tooling.
Further reading
DAGs — Apache Airflow documentation (the official DAGs concept page: declaring a DAG, the >> dependency syntax, and schedules)
Try it
Practice question: The quality task fails on Tuesday's data. In Wednesday's scheduled run, what runs and what doesn't — and why is that exactly the behavior you want?
Show answer
Result: Tuesday's run stops at check_quality: publish_gold never executes for Tuesday, so gold keeps serving Monday's good data — no bad data reaches a consumer. Wednesday's run is a separate DAG run with its own chain: it ingests and processes Wednesday's window independently, and if that data passes the gate, gold publishes normally. Tuesday's failed run stays visibly failed until someone fixes the data and backfills it (tomorrow's lesson). A DAG fails in place, per run — the damage stays inside the run that caused it.