What is Prefect-ish way to end a flow run. Suppose...
# ask-community
h
What is Prefect-ish way to end a flow run. Suppose one of the early tasks in a flow does not have the required data to continue the rest of the flow, how does one gracefully end a flow?
k
Hi @Hawkar Mahmod, what do you mean by gracefully? You don’t want it to be displayed as
FAILED
?
h
It wouldn’t be failed because its valid path. It’s just not possible to run a subsequent tasks because a dataframe is empty.
k
Have you looked into state signals ? I am thinking you can raise the SKIP signal based on the empty dataframe then it would skip downstream tasks
👍 1
More info on SKIP
a
k
nice suggestion @Alex Papanicolaou !
h
I did notice
case
and do use it in my flow for something else but it strikes as odd that Prefect doesn’t support the ability to use native Python conditional like it does for returning results of tasks. I don’t know enough about way Prefect works to understand why this is. Thank you for the suggestion about state signals. I’ll have a look.
@Kevin Kho using the SKIP signal worked perfectly for my use case. Thank you. It means not having to write loads of extra guard clauses in downstream tasks and a way of the flow succeeding even when many tasks are skipped.
🎉 1
k
Happy to help!