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

Subhajit Roy

04/15/2022, 4:42 AM
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

Kevin Kho

04/15/2022, 4:43 AM
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

Subhajit Roy

04/15/2022, 4:53 AM
@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

Kevin Kho

04/15/2022, 4:57 AM
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

Subhajit Roy

04/15/2022, 5:01 AM
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

Kevin Kho

04/15/2022, 5:08 AM
Yes that is expected because SKIP is not an end state for a Flow. It is treated as successful
s

Subhajit Roy

04/15/2022, 5:11 AM
Cool . So in order to make that flow as SKIPPED , do we have any way other than state handler?
k

Kevin Kho

04/15/2022, 5:21 AM
Ok I was just checking that it’s possible and it is, but the only way is the state handler
s

Subhajit Roy

04/15/2022, 5:22 AM
Alright .. SKIP signal + state handler is the combination will do for me in this case.
k

Kevin Kho

04/15/2022, 5:23 AM
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

Subhajit Roy

04/15/2022, 5:26 AM
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

Kevin Kho

04/15/2022, 5:31 AM
I know but is the condition based on a task result? You might need to query the GraphQL API for that
s

Subhajit Roy

04/15/2022, 5:33 AM
The condition is based on a value of a variable/argument passed in from another task
8 Views