Hey everyone, I am working on some flows using pr...
# ask-community
d
Hey everyone, I am working on some flows using prefect 2.7.12, specifically sending an email when a flow fails. I'm having trouble accessing the name of the flow run instance (adjective, noun). I would like to be able to include this information in the email. I've tried a handful of things including: flow_run_name =context['flow_run_name'] flow_run_name = prefect.context.get("flow_run_name") flow_run_name = prefect.context.flow_run.name flow_name = get_flow_name() and probably a few that I am forgetting. Does anyone have any suggestions or advise? Anything you can provide is much appreciated!
1
a
Copy code
from prefect.context import FlowRunContext

context = FlowRunContext.get()
flow = context.flow.name
flow_run = context.flow_run.name
🦜 1
d
Awesome that worked! Thanks a lot for your help!
a
No problem