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

Anna Geller

08/30/2022, 4:26 PM
@Tim Enders I hope you don't mind that I move your message here - the other channel is for sharing tutorials I have this snippet from Prefect 1.0. What are the analogs to
results
and
state_handler
in 2.0?
Copy code
with Flow(
    "Subscriptions API Import",
    result=GCSResult(bucket="platformsh-vendor-prefect"),
    # executor=LocalExecutor(),
    executor=LocalDaskExecutor(scheduler="threads", num_workers=5),
    state_handlers=[flow_failure],
1
t

Tim Enders

08/30/2022, 4:26 PM
Thank you, I didn't realize I was in the other channel. facepalm
🙌 1
a

Anna Geller

08/30/2022, 4:27 PM
results are currently handled behind the scenes in 2.0 - you can influence that only by changing the storage location in settings
we are working on that - high priority item to tackle
state handlers are no longer needed, check this for more info https://discourse.prefect.io/t/how-to-take-action-on-a-state-change-of-a-task-run-task-level-state-handler/82 also this upgrade.prefect.io has some good references
t

Tim Enders

08/30/2022, 4:29 PM
OK, My state handler is to automatically alert on failure. How would you recommend doing that in 2.0? I am looking for flow-level state options.
a

Anna Geller

08/30/2022, 4:34 PM
Notifications blocks
t

Tim Enders

08/30/2022, 4:39 PM
sweet, thank you!
l

Leon Kozlowski

09/06/2022, 8:12 PM
Does this mean a flow-level state handling would just checking the state of all tasks? The examples provided contained a flow with just 1 task
a

Anna Geller

09/06/2022, 8:52 PM
many possibilities on how you could approach it @Leon Kozlowski, we are definitely open to suggestions here I was trying to pitch to the product team the idea of having a default flow-run notification that would provide a summary of all task runs that failed with an exception message for each failed task run, but it was rejected for now -- if this is sth you are looking for you can open a feature request and I'll definitely back you up there 😄
👍 1