How to rerun past DAG runs after making changes

Airflow doesn’t reset task instance statuses after they have been completed if there is a code change. You could however give the task a new name and then set the DAG Runs to running state.

Option 1 – User Interface

Airflow can clear the state of tasks within the UI – just use “Browse -> Task Instances”. There you can:

  • Create filter to select the specific task instances, i.e. by filtering for a task/DAG name and a time frame, then “Apply” the filter
  • You can then see a table with all the task runs that apply to this filter, you can select all and and choose “With selected -> clear” Airflow Task Instance UI

Option 2 – Command Line

Use airflow clear:

Clear a set of task instance, as if they never ran For example:

airflow clear -s <start_date> -e <end_date> -t task_to_reset <DAG_NAME>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top