Search code examples
airflowairflow-scheduler

Airflow DAG Runs Daily Excluding Weekends?


Is it possible to create an Airflow DAG that runs every day except for Saturday and Sunday? It doesn't seem like this is possible since you only have a start_date and a schedule_interval.

I'm setting up a workflow that will process a batch of files every morning. The files won't be present on weekends though only Monday through Friday. I could simply use a timeout setting of 24 hours which essentially makes Saturday and Sunday timeout because the file would never appear on those days but this would mark the DAG as failed for those two days and that would be very pleasant.


Solution

  • 'schedule_interval': '0 0 * * 1-5' runs at 00:00 on every day-of-week from Monday through Friday.