Rob Teeuwen
Rob Teeuwen

Reputation: 475

How to manually run an Airflow task if it has never ran before

I've ran into this issue several times, and I can't find a solution. I have a DAG in Airflow that runs every day, which works great. Sometimes I add new tasks to this DAG, which are then included during the next scheduled DAG run, which is also great.

Sometimes, however, I want to run the new task right away because I want to use the result right away. This only seems possible by running the entire DAG, which I don't want to do. If a task has already ran, you can click on it, clear it's status, run it manually, and do all kinds of stuff. However, if it's a new task that has never ran before, you can do none of these things, because it shows a "stop" sign when hovering it (and it says "DAG has yet to run"), and you can't click on it. Some of this makes sense (you can't reset a status because it hasn't ran, so it doesn't have a status). However, I still want to be able to run it manually, like I can do with existing tasks. It feels like this should be possible, but I can't figure out how.

Menu for existing task:

Menu for existing task

Hover for new task:

Hover for new task

Upvotes: 4

Views: 3790

Answers (1)

ali_enes_isbilen
ali_enes_isbilen

Reputation: 171

If the task has an upstream or downstream task, you can "Mark Success" using the "Upstream" or "Downstream" button next to "Mark Success". After that, you can click and clear the task. Or you can do it using CLI with help of https://stackoverflow.com/a/58607672/16260639

Upvotes: 6

Related Questions