Hi folks, in a prefect flow , for one particular t...
# prefect-community
s
Hi folks, in a prefect flow , for one particular task, I am trying to raise a SKIP signal
Copy code
from prefect.engine.signals import SKIP
........
........
raise SKIP('Skipping all downstream dependencies.')
With this all the following tasks are being skipped and was expecting the flow state will be
skipped
. Though the following tasks are being skipped but at the end the flow becomes
successful
. I have two questions around : 1. Is this something expected? 2. If this is expected, whats the remedy . Do I need to explicitly use a state handler on top of it to make the flow
skipped
eventually
k
There is no SKIPPED state for the Flow level. Just SUCCESS (and SKIP is treated as SUCCESSful). What are you trying to do? Get a different indicator in the UI?
s
@Kevin Kho Earlier by mistake the question got posted before it was actually completed. Please let me know your inputs now. Completed my question is the same thread. Thanks !
k
Yes to expected. SKIPPED is not a terminal state for a Flow. It’s just treated as successful
SKIPPED on a Flow level is a bit ambiguous right? Like if you have 10 successful tasks but 10 skipped tasks, is that Flow skipped?
Or does it mean the Flow didn’t run at all right?
s
The flow is running as expected and I m getting the flow as successful though most of the tasks of the same flow is skipped (I am doing it intentionally with raise SKIP signal.
k
Yes that is expected because SKIP is not an end state for a Flow. It is treated as successful
s
Cool . So in order to make that flow as SKIPPED , do we have any way other than state handler?
k
Ok I was just checking that it’s possible and it is, but the only way is the state handler
s
Alright .. SKIP signal + state handler is the combination will do for me in this case.
k
It’s kinda hard though to determine the condition whether or not to
return Skipped
in the state handler. How are you planning to do it?
s
The idea right now I have is not to raise the SKIP signal in the state handler. Based on certain condition , I will raise the SKIP signal and with that I will also call a method which will trigger a relevant email to some stakeholders which is basically a state handler function -- combining the feature of making the flow as SKIPPED
k
I know but is the condition based on a task result? You might need to query the GraphQL API for that
s
The condition is based on a value of a variable/argument passed in from another task