Having trouble accessing the flow name from within a flow using the context for some reason:
Copy code
Traceback (most recent call last):
File "/home/aradox/code/wfp/wfp-prefect/utilities/slack.py", line 93, in handled_error_func
return func(*args, **kwargs)
File "/home/aradox/code/wfp/wfp-prefect/utilities/van.py", line 213, in alert_new_van_contact
"flow": get_run_context().flow.name,
AttributeError: 'TaskRunContext' object has no attribute 'flow'
Austin Weisgrau
03/23/2023, 8:35 PM
Ah I see, I'm getting a task run context instead of a flow run context
z
Zanie
03/23/2023, 8:35 PM
Hey! Task runs don’t have access to the flow because they may be running on other workers
Zanie
03/23/2023, 8:35 PM
You can use
FlowRunContext.get()
instead though if you’re always running your tasks locally
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.