Its should ideally have all the tasks and whether ...
# ask-community
s
Its should ideally have all the tasks and whether the failed or succeeded
z
Hey @Saksham Dixit -- we don't want to collect the state of every task each time the flow changes states. Perhaps you're looking for https://docs.prefect.io/core/concepts/flows.html#terminal-state-handlers ?
The terminal state handler has access to the state of the reference tasks.
s
I actually want to send an email out specifying which task failed which made the flow fail
z
Yep! That's exactly the use-case for this handler.
s
so I wanted all tasks instead of just reference tasks..
z
A task will not cause the flow to fail unless it is a reference task
s
Oh okay thanks
z
There is a possible exception to this which would be an upstream task failing causing a downstream (terminal/reference) task to fail. I believe that would be in the task's state message though. Let me know if you run into issues, this is a relatively new feature.
s
yeah that's an approach we can take, thanks for that, but any thoughts on why the result attribute of a flow's state handler be empty