I have a DAG that needs to be scheduled to run in working days (Mon to Fri) between 9AM to 4PM in every 10 minutes. How do i do this in Airflow.
Asked
Active
Viewed 661 times
1 Answers
1
Set your DAG with cron expression: */10 9-16 * * 1-5
Which means at every 10th minute past every hour from 9 through 16 on every day-of-week from Monday through Friday. See crontab guru.
dag = DAG(
dag_id='my_dag',
schedule_interval='*/10 9-16 * * 1-5',
start_date=datetime(2021, 1, 1),
)

Elad Kalif
- 14,110
- 2
- 17
- 49
-
1@Amitjoc did it solve your issue? – Elad Kalif Dec 23 '21 at 12:50
-
Yeah it is working for me thanks Elad – Amitjoc Jan 27 '22 at 11:23