How to delete a DAG run in Apache Airflow?

Viewed 14065

I know there is a way to delete a DAG. But is it possible to delete a DAG run with a specific run_id? Something like:

airflow delete_dag_run <dag_id> <run_id>

2 Answers

To delete a DAG Run from the Airflow UI:

  1. Browse > "DAG Runs".
  2. Select the DAG Runs you want to delete with the checkboxes on the left.
  3. "With selected" > Delete.

You can also delete the "DAG Runs" from airflow database:

DELETE FROM dag_run
WHERE dag_id='my_dag_id' AND 
state='STATE_I_WANT_TO_DELETE'
Related