stop/skip a flow run based on some condition #16782
Unanswered
Vijayraj-1210
asked this question in
Q&A
Replies: 1 comment
-
One way to do this would be to from prefect import flow
from prefect.states import Completed
@flow
def skippable_flow(skip: bool = False):
res1 = task1()
if skip:
return Completed(name="Skipped")
res2 = task2()
# etc. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to stop/skip a flow run based on some condition in prefect version 3? like if we are not getting any data in a task then i want to skip the flow run(don't want to execute the other tasks.)
We can skip or stop a flow run in prefect version 1 like below:
raise ENDRUN(
state=Failed(
message=message
)
)
raise ENDRUN(
state=Skipped(
message=message
)
)
Beta Was this translation helpful? Give feedback.
All reactions