hey all, i am trying to update the `flow_run_name`...
# ask-community
j
hey all, i am trying to update the
flow_run_name
in prefect 1. looks like the flow run name gets updated in the client in
RenameFlowRun.run
, but the prefect context doesn't. is there an easy way to update the prefect context's
flow_run_name
?
bump. question's can get buried 😅
b
Hey Jon! Just to clarify, you tried updating the flow run name using something similar to this example?
j
yup
if you look at the source code seems that just the client gets updated but i don't see any changes to the context? https://github.com/PrefectHQ/prefect/blob/ffa9a6c38ec55db7b153f57e7a14469272c344fb/src/prefect/tasks/prefect/flow_run_rename.py#L60-L61
b
Ah, so this is most likely by design. The Prefect context is designed to be immutable
j
yeah, i saw that, too. so there is no way to force an update to the context, even though it doesn't like it?
^^ this says that its possible to modify the global context. but seems that it can't be used within a flow block, ex:
Copy code
with Flow():
   with prefect.context(flow_run_name=flow_run_name):
       ...
i tried that but no dice