A frequency-based schedule triggers an Airflow DAG at relative time intervals rather than matching a recurring calendar pattern. It handles cadences such as every two days, which cron expressions cannot represent reliably across month boundaries. section 3.3.4
Every two days
Define the schedule with a Pendulum duration: schedule=DeltaTriggerTimetable(pendulum.duration(days=2)). Starting on January 1, 2025, runs occur on January 3, 5, and so on. The same approach supports intervals such as 10 minutes or two hours. section 3.3.4
Configure the schedule with these operational choices:
- Set start_date to establish when scheduling begins; supply a time zone there when UTC is not appropriate. section 3.3.4
- Use end_date to stop scheduling and catchup to control whether past time points receive executions. section 3.8
- Choose frequency-based scheduling for relative intervals; use cron expressions or Airflow shorthand when a calendar pattern is sufficient. section 3.3.4 section 3.8
Listing 3.7 Defining a frequency-based schedule
import pendulum
...
with DAG(
dag_id="04_trigger_frequency",
start_date=pendulum.datetime(year=2025, month=1, day=1),
schedule=DeltaTriggerTimetable(pendulum.duration(days=2)), #1
...
):
...
Inspect the compact DAG definition that applies a two-day Pendulum duration through DeltaTriggerTimetable. section 3.3.4
