Thread
#prefect-community
    Subhajit Roy

    Subhajit Roy

    5 months ago
    Hi folks, in a prefect flow , for one particular task, I am trying to raise a SKIP signal
    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
    Kevin Kho

    Kevin Kho

    5 months ago
    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?
    Subhajit Roy

    Subhajit Roy

    5 months ago
    @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 !
    Kevin Kho

    Kevin Kho

    5 months ago
    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?
    Subhajit Roy

    Subhajit Roy

    5 months ago
    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.
    Kevin Kho

    Kevin Kho

    5 months ago
    Yes that is expected because SKIP is not an end state for a Flow. It is treated as successful
    Subhajit Roy

    Subhajit Roy

    5 months ago
    Cool . So in order to make that flow as SKIPPED , do we have any way other than state handler?
    Kevin Kho

    Kevin Kho

    5 months ago
    Ok I was just checking that it’s possible and it is, but the only way is the state handler
    Subhajit Roy

    Subhajit Roy

    5 months ago
    Alright .. SKIP signal + state handler is the combination will do for me in this case.
    Kevin Kho

    Kevin Kho

    5 months ago
    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?
    Subhajit Roy

    Subhajit Roy

    5 months ago
    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
    Kevin Kho

    Kevin Kho

    5 months ago
    I know but is the condition based on a task result? You might need to query the GraphQL API for that
    Subhajit Roy

    Subhajit Roy

    5 months ago
    The condition is based on a value of a variable/argument passed in from another task