How can I change the flow run name, to be somethin...
# prefect-getting-started
t
How can I change the flow run name, to be something more useful than
certain-stingray
discreet-mole
etc 🙂 Ideally in runtime, since I want it to reflect the parameters that was sent in, so lets say that I have
Copy code
@flow
def my_flow(
  name: str,
  some_number: int,
):
  somehow_set_flow_run_name_to(f"{name}: {some_number}")
Something like that 🙂
p
Change @flow to @flow(flow_run_name=‘{instance}’), for example, such that instance is a parameter to the flow function being annotated by @flow.
m
It's also possible to change it when being called, in case it's useful for you, something like:
Copy code
@flow
def my_flow(a: str):
    ...
Copy code
my_flow.with_options(flow_run_name="name")(a="value")
t
@Pēteris Kļaviņš does
instance
in this case become a parameter you can set when starting a flow run?
p
@Theo Sjöstedt Yes, instance would be one of the parameters to the def my_flow(instance: str, …). It can then be referenced by {instance} in the flow_run_name= field.
t
Thank you, that worked!