Oleksandr Riabyi
08/15/2025, 3:38 PMMarvin
08/15/2025, 3:38 PMMarvin
08/15/2025, 3:40 PMflow_run_name
parameter on Flow.deploy(...)
.
How to set it instead:
- Set a default on the flow itself via the @flow
decorator. Runs created from a deployment will use this.
- Optionally override the name at trigger time (UI or run_deployment
) for individual runs.
Example (default name via the flow):
from prefect import flow
@flow(flow_run_name="etl-{dataset}")
def etl(dataset: str):
...
# Create a deployment; runs from this deployment will use the flow_run_name above
etl.deploy(
name="etl-prod",
work_pool_name="my-pool"
)
Override at trigger time:
from prefect.deployments import run_deployment
# The 'name' argument sets the flow run name for this invocation
run_deployment(
name="etl/etl-prod",
parameters={"dataset": "orders"},
name="etl-orders-2025-08-15"
)
Docs for deployments (alas, no flow_run_name
there): Deployments in Prefect 3.
If you were hoping for a per-deployment run-name template (distinct from the flow), that existed in 2.x YAML but isn’t in 3.x. Set it on the flow or override per run. I know, thrilling.