1

When I deploy a new dag on airflow, let's say I deploy it today (28 April). And I have the Cron expression as this: 0 3 * * *, then I expect the first run is on 29 April at 3 am. however, I get a run as soon as deploy with this run id: 2021-04-27, 03:00:00`.

Dag code:

DAG(
    dag_id="namexx",
    schedule_interval='0 3 * * *',
    max_active_runs=1,
    is_paused_upon_creation=False,
    dagrun_timeout=timedelta(hours=1),
    catchup=False,
    default_args={
        "start_date": datetime(2021, 1, 1),
        "retries": 0,
        "retry_delay": timedelta(minutes=1)
    }

)

Any idea why is that?

1 Answers1

0

This is expected. Airflow schedule DAGs at the end of the interval. if start_date is 2021-01-01 and interval is hourly a run will be triggered as soon as the DAG deployed.

See also previous answer 1, answer 2 on this subject

Elad Kalif
  • 14,110
  • 2
  • 17
  • 49