Can I access task state inside of a flow without e...
# prefect-community
l
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
Like
state = my_task(return_state=True)
?
Or
future = my_task.submit(); current_state = future.get_state(); final_state = future.wait()
?
l
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