airflowdirected-acyclic-graphsgoogle-cloud-composer

Run DAG after TriggerDagRunOperator fails


I have a DAG which runs continously by using TriggerDagRunOperator.TriggerDagRunOperator triggers the same DAG upon completion. The schedule_interval is specified as 'once' and now when the TriggerDagRunOperator fails, the DAG is never triggered again and has to be run manually. Any way to run the DAG even if the TriggerDagRunOperator fails? The DAG should be running at all times.


Solution

  • Instead of using a TriggerDagRunOperator task setup to mimic a continuously running DAG, you can checkout using the Continuous Timetable that was introduced with Airflow 2.6.

    You can set your DAG's schedule = @continuous and the Scheduler will begin another DAG run after the previous run completes regardless of success or failure.