https://prefect.io logo
Title
b

Bradley Hurley

03/15/2022, 4:55 PM
Hi Folks - I have a flow that uses the Prefect provided
RenameFlowRun
. Would it be expected that in a downstream task if I call
prefect.context.get("flow_run_name")
the new/updated name is returned?
k

Kevin Kho

03/15/2022, 4:58 PM
Yes because it makes an API call to change the name
b

Bradley Hurley

03/15/2022, 4:59 PM
That was my assumption, but the logs are showing the auto generated flow run name instead of the new name.
k

Kevin Kho

03/15/2022, 5:27 PM
Ohh my bad that makes sense because context is already generated and immutable for the most part
b

Bradley Hurley

03/15/2022, 5:30 PM
Is there a way to easily get the updated name?
I was thinking
client.get_flow_run_info
k

Kevin Kho

03/15/2022, 5:32 PM
I haven’t used that. I was thinking the FlowRunView. Instantiate from a flow_run_id, and then try pulling the
name
attribute
b

Bradley Hurley

03/15/2022, 5:36 PM
Thanks!
k

Kevin Kho

03/15/2022, 5:37 PM
Your way might be better though. Not sure