If I encounter a certain condition in a flow run, I'd like to cancel the flow run (rather than fail it or mark it successful). It doesn't seem like there is a way to do this from prefect.engine.signals. Is there any way to do this (apart from the UI)? https://docs.prefect.io/core/concepts/execution.html#state-signals
k
Kevin Kho
08/17/2021, 9:35 PM
Hey @Mark McDonald, I think if you don’t want to use FAIL or SKIP, then you would need to use a state handler to hit the GraphQL API to cancel the run. This is a best effort thing because it’s hard to stop processing that is happening on other compute (think of stuff sent to a Dask cluster). See this recent issue.
You can also maybe use a terminal state handler at the end to check if the last task had a TRIGGERFAILED or SKIPPED, and then return a cancelled state from that
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.