A daily DAG unpaused on Airflow 2 queued about 365 runs at once — find the cause and fix it
The DAG below was deployed on Airflow 2.10 and unpaused. The scheduler immediately queued about 365 DAG runs and the warehouse choked. The team needs runs from today on, plus the last 30 days loaded on purpose, and the DAG is about to move to Airflow 3 — it must behave the same on both versions.
from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator
with DAG(
dag_id="orders_daily",
start_date=datetime(2025, 11, 1),
schedule="@daily",
) as dag:
PythonOperator(task_id="load", python_callable=load_orders)Find and fix the bug, and say how the 30 days of history get loaded.
Catchup creates a DAG run for every missed interval since start_date, and it defaults to True in Airflow 2 (False in Airflow 3). Set catchup=False on the DAG so both versions agree, and load the 30 days with an explicit backfill, which has its own max_active_runs.
- Trusting the catchup default, which flipped from True in Airflow 2 to False in Airflow 3
- Using a dynamic
start_datesuch asdatetime.now()to dodge catchup - Treating catchup and backfill as one thing instead of automatic versus explicit runs over past intervals
- How does a backfill in Airflow 3 treat intervals that already have a successful run?
- Why must the load be idempotent before you run catchup or a backfill over it?
The cause is catchup. For a start_date in the past and a DAG with no explicit catchup, Airflow 2 creates a DAG run for every missed interval (about 365), because catchup_by_default is True there. Airflow 3 flipped the default to False, so the same file would silently stop filling gaps after the move. Set the flag on the DAG explicitly:
from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator
with DAG(
dag_id="orders_daily",
start_date=datetime(2025, 11, 1),
schedule="@daily",
catchup=False, # same on Airflow 2 and 3
max_active_runs=1,
) as dag:
PythonOperator(task_id="load", python_callable=load_orders)With catchup=False the scheduler creates only the latest interval. The 30 days of history are a backfill — an explicit run over a past range: airflow dags backfill -s <from> -e <to> orders_daily on Airflow 2, airflow backfill create --dag-id orders_daily --from-date <from> --to-date <to> on Airflow 3 (or the UI / REST API). An Airflow 3 backfill has its own max_active_runs, independent of the DAG's, and a reprocess mode for intervals that already ran. Do not move start_date to datetime.now(): it changes on every parse and makes the schedule unpredictable.