I have a question about: restarted flows with trigger:any_successful tasks.
I have a flow with some tasks. At the end there I have a cleanup task (trigger: any_successful). So the cleanup task is always executed.
Now if I got an error, I would like to restart the flow and also execute this cleanup task. But this cleanup-task is not executed, because it was already successful at the first run. But I need to rerun this.
Is there an easy way to achieve this?
Thanks in advance!!
06/22/2022, 1:15 PM
Did you try marking it as failed through the UI? I think that should make it run when you restart
06/22/2022, 1:41 PM
@Kevin Kho Thanks for this advice. Yes this should work.
But, it would be awesome if there would be an option for such tasks. Then it would be much easier to maintain bigger flows.
("all_finished" is described as "This is equivalent to "always run"" - https://docs.prefect.io/core/concepts/tasks.html#triggers but not in this case).
So there is no automatic way to get this?
06/22/2022, 1:45 PM
I know what you mean. Definitely would not be added to 1.0, but worth opening a ticket for the idea. We’re still figuring out restarts in 2.0.
@Marvin open “Feature request: label a cleanup task to always run during flow restarts”
Do you need it as a task or can you use a state handler?