How to stop/kill Airflow tasks from the UI

Chetan J picture Chetan J · Apr 26, 2017 · Viewed 51.5k times · Source

How can I stop/kill a running task on Airflow UI? I am using LocalExecutor. Even if I use CeleryExecutor, how do can I kill/stop the running task?

Answer

Jorge Almeida picture Jorge Almeida · Apr 26, 2017

In the DAGs screen you can see the running tasks:

enter image description here

Example

On 'Recent Tasks' press the running icon and Airflow will automatically run the search query with the filters for the Dag Id and State equal to 'running' and show the results on the Task Instances screen (you can find it manually on the tab Browse > Task Instances).

There you can select the presented tasks and set them to another state or delete them.

Please notice that if the DAG is currently running, the Airflow scheduler will start again the tasks you delete. So either you stop the DAG first by changing its state or stop the scheduler (if you are running on a test environment).