Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart DAG in Airflow?

One of my DAGs with many steps stopped part way through because of a DB shutdown. I'd like to get the DAG to start where it left off but all I can do is start the individual tasks of the DAG one by one. Is there a way to tell Airflow to start the DAG where it left off based on the success of the tasks already completed?

Here's a sample where one of the first tasks finished and the rest are queued or have no status: enter image description here

When I click on an individual task (runme_1) I can restart it: enter image description here

However, if I try to start a task which hasn't had it dependencies met (such as run_after_loop), I see the following error message: enter image description here

I'd like to be able to click on any task, ask it to be queued and have all dependencies run in the correct order. Is that possible?

I'm running Airflow 1.9.0.

like image 643
Paymahn Moghadasian Avatar asked Feb 14 '18 16:02

Paymahn Moghadasian


People also ask

How do I clear DAG runs in Airflow?

Finally, if you want to clear a full DAG run (all tasks in that DAG), go to the Tree View in the UI, click on the DAG circle and select 'Clear'.

How do you clear an Airflow task?

Click on the "select all" checkbox at the top of the list to select all of the queued tasks. Now, in the "Actions" menu, select "Clear" and apply it to all of the queued tasks. Confirm your choice to Clear the queued tasks. Airflow should immediately prepare to run the queued tasks.


1 Answers

It sounds like you need to start a dag from the task where it failed.

Instead of going into the DAG and clicking on a task and clicking run, go to the Dag run with the failed task, click the failed task and click clear.

Clearing the task will re-run the task, and any other tasks after it will run.

like image 131
jhnclvr Avatar answered Sep 30 '22 13:09

jhnclvr