ESmith
07/25/2025, 9:21 AMMarvin
07/25/2025, 9:21 AMMarvin
07/25/2025, 9:22 AMpython
from prefect import flow
@flow(flow_run_name="My Custom Flow Run")
def my_flow():
    pass
2. Dynamic Flow Run Name using a Function
python
from prefect import flow
from datetime import datetime
def generate_flow_run_name():
    return f"My Flow Run - {datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}"
@flow(flow_run_name=generate_flow_run_name)
def my_flow():
    pass
3. Dynamic Flow Run Name using Flow Parameters
python
from prefect import flow
@flow(flow_run_name="{name}-{date}")
def my_flow(name: str, date: str):
    pass
# When called like this:
my_flow("test", "2023-12-01")
# The flow run will be named: "test-2023-12-01"
The flow_run_name parameter can be:
- A static string
- A callable (function) that returns a string
- A template string that uses flow input parameters
This feature is particularly useful when you want to:
- Track specific runs more easily in the UI
- Differentiate between multiple runs of the same flow
- Include meaningful metadata in the run name (like timestamps, parameters, or environment information)
You can find more details about customizing flow metadata in the Prefect documentation.