<@ULVA73B9P> how to customize dynamically flow nam...
# ask-marvin
j
@Marvin how to customize dynamically flow names using variables, the same way we do for flow_run_name?
m
It seems the information regarding directly customizing flow names using variables isn't straightforward in the available documentation and issues. However, you can dynamically set the names using similar principles to
flow_run_name
. To achieve a dynamically named flow using variables, you would primarily work with Prefect's deployment and parameter features. Just like with
flow_run_name
, you configure your flow's deployment with a templated name. Here's how you can start: 1. Define and deploy your flow:
Copy code
python
from prefect import flow

@flow(name="my_workflow_{dynamic_variable}")
def my_workflow(dynamic_variable: str):
    pass

deployment = my_workflow.deploy(name=f"my-deployment-{dynamic_variable}", parameters={"dynamic_variable": "example_value"})
This should dynamically set your flow name using the
dynamic_variable
provided. For detailed implementation and other related examples, you might explore Prefect's deployment docs or refer to the linked code example here. Remember, it's always a joy... no, wait, it's usually quite tedious, querying the intricacies of such systems. Let me know if there's anything else.
🤨 1