9. One Export at a Time
Difficulty: Medium · Topic: Ordering & concurrency
The DAG partner_export runs @daily from 2026-02-01 to 2026-02-04 with catchup=True. It has two BashOperator tasks, prepare (prepare --date {{ ds }}) then export (export --date {{ ds }}).
When the DAG is deployed late, all four days run together. That is fine for prepare, but the partner's API accepts only one export at a time:
- Across all runs of this DAG, at most one
exportmay run at once. preparetasks must still run at the same time, so a backfill does not take longer than it needs to.- A failed export must not stop the other days from exporting.
Your DAG file is run in a simulation of the Airflow 3 scheduler against 3 scenarios, including hidden ones.
Sample scenario: A late deploy
Deployed 2026-02-10 00:30 UTC, read at 2026-02-10 02:00 UTC.
Expected runs
- Run at 2026-02-01 00:00 UTC: success. prepare success, export success
- Run at 2026-02-02 00:00 UTC: success. prepare success, export success
- Run at 2026-02-03 00:00 UTC: success. prepare success, export success
- Run at 2026-02-04 00:00 UTC: success. prepare success, export success
Hints
Hint 1
max_active_runs limits whole runs, which would hold back prepare as well.Hint 2
A task can have its own limit across all of the DAG's runs:max_active_tis_per_dag.Hint 3
depends_on_past also makes exports run one by one, but a failure would stop the later days.Learn the concepts
- Catchup, backfill and end_date · 5 min read. Which runs a late deploy creates, filling history on purpose, and limiting runs in flight.
- Pools, concurrency and priority · 5 min read. Every limit on how many tasks run at once, pools for shared systems, and who goes first.
More Airflow problems
- Each Day Waits for Yesterday · Hard