Hi! Is there a simple way to skip a failed task fo...
# ask-community
d
Hi! Is there a simple way to skip a failed task for a specific run? My issue is that I've launched a flow run processing a lot of data (probably too much at once), and it failed for a dumb reason (there is no need to relaunch that particular task). The task is badly designed (not idempotent), such that if I retry it it would do a lot of unnecessary processing again, just so that the flow can move on... Obviously I will fix this for the next runs, but for now I need to find a way to unlock this one. Here are options I'm considering: • Tweaking in GraphQL to change that task's state from failed to success, such that when I retry the flow run it would move on to the next task (Is it possible ?) • Write an ad-hoc flow that would start from where the previous run left (Guaranteed to work, but it means writing code and pushing to prod just for this special case) Thank you in advance! 🙏
a
Take a look at triggers: https://docs.prefect.io/core/concepts/execution.html#triggers It sounds like you want the tasks downstream of this task to have an
all_finished
or
always_run
trigger.
upvote 1
d
Thank you Amanda. But this would require me to modify my flow and update it? I don't think this would work, because my stuck flow run would still be on the old version of the flow, right?
a
I would also recommend using trigger for it. But still to answer your question here:
Tweaking in GraphQL to change that task’s state from failed to success, such that when I retry the flow run it would move on to the next task (Is it possible ?)
it is possible using the mutation “set_task_run_states”. I understand you need to set this state only once so that you can restart this flow run in prod without redeploying anything, correct? 🙂 If so, you would need a task_run_id for it which you can get from the task run page of the failed task in the UI.
@Didier Marin btw you can also do that from the UI:
d
Oh great, I did not know you could change the state for a task run! Thank you Anna!
🙌 1