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

Leon Kozlowski

09/26/2022, 7:40 PM
Can I access task state inside of a flow without explicitly passing task result objects to a task? I am trying to emulate the behavior of a state handler from prefect < 2.0
z

Zanie

09/26/2022, 7:48 PM
Like
state = my_task(return_state=True)
?
Or
future = my_task.submit(); current_state = future.get_state(); final_state = future.wait()
?
l

Leon Kozlowski

09/26/2022, 7:50 PM
Previously a flow run state handler could be used as a “post hook” for a flow run, in my example I have actions I want to take on failures
This didn’t require passing the state of every task in a flow, because it was configured at the flow level
I understand notification blocks exist in prefect 2.0, but I built a custom state handler to create opsgenie alerts that I would like to emulate in prefect 2.0