https://prefect.io logo
#prefect-community
Title
# prefect-community
r

Roger Webb

03/08/2022, 3:52 PM
Hey All, Im wondering the best way to make a flow force a failure. For instance, if you have a task that fails, and a task that runs a trigger for "any failed" toward the end of your flow... the flow succeeds if the "onfailure" task succeeds. However I want the OnFailure task to do what it needs to .. then make the entire flow fail.
discourse 1
k

Kevin Kho

03/08/2022, 3:52 PM
Hi @Roger Webb, so the question is how to force failure on the Flow level right?
Look at the code example here . I think you want
flow.set_reference_task
and then you can make the task before the OnFailure task the reference task so the Flow level success will depend on that
r

Roger Webb

03/08/2022, 3:55 PM
Oh.. Thats amazing.. I read that like 4 times.. but it never registered!
k

Kevin Kho

03/08/2022, 3:56 PM
😆 I know the feeling
4 Views