1. Your First Daily DAG
Difficulty: Easy · Topic: Schedules & catchup
The shop's orders pipeline has three steps, each a shell command. Write the DAG orders_daily:
- It runs every day at 06:00 UTC, starting on
2026-01-01. - Three
BashOperatortasks, one after the other:extractrunsextract_orders --date {{ ds }}, thentransformrunstransform_orders --date {{ ds }}, thenloadrunsload_orders --date {{ ds }}. - The DAG is deployed after its start date. It must not create runs for the days it missed: only the most recent schedule and the ones after it.
Each test deploys your file at some time and reads the scheduler a while later: which runs exist, when each task ran, and the command it ran.
Your DAG file is run in a simulation of the Airflow 3 scheduler against 4 scenarios, including hidden ones.
Sample scenario: Deployed mid-morning
Deployed 2026-01-05 09:00 UTC, read at 2026-01-06 07:00 UTC.
Expected runs
- Run at 2026-01-05 06:00 UTC: success. extract success, transform success, load success
- Run at 2026-01-06 06:00 UTC: success. extract success, transform success, load success
Hints
Hint 1
A cron string sets the time of day: the fields areminute hour day-of-month month day-of-week. "@daily" means midnight.Hint 2
In Airflow 3,catchup is False by default, which is exactly "only the most recent schedule".Hint 3
a >> b >> c chains three tasks. a >> [b, c] would run b and c in parallel.Learn the concepts
- Schedules and logical dates · 5 min read. Cron strings, presets and timetables, and what a run's logical date means in Airflow 3.
- Catchup, backfill and end_date · 5 min read. Which runs a late deploy creates, filling history on purpose, and limiting runs in flight.
More Airflow problems
- Backfill January, One Day at a Time · Medium