https://prefect.io logo
Title
s

scott

02/06/2023, 2:35 PM
Is there any way to get the name/id/etc. of the task that failed in a flow? Idea being to be able to put in a slack message which task in the flow failed.
j

Jessica Smith

02/06/2023, 5:18 PM
Where are you trying to get it from? The API? The actual python code in the flow?
s

scott

02/06/2023, 5:18 PM
Using Prefect Automations
j

Jessica Smith

02/06/2023, 5:23 PM
That is a very good question. I wonder if you could get it out of the state attribute. Hopefully someone else has an actual answer
s

scott

02/06/2023, 5:23 PM
Okay, yeah would be a nice treat to see which task failed 😄
I’ll look into state
Poked around some - most likely candidate seems to be
task_run_results
via your docs - but i’m not sure how i’d pull the task name from that. locally testing, and i’m not sure how to get a failed task and also get metadata from
get_run_context