<@ULVA73B9P> can you create flow.deploy(...) with ...
# ask-marvin
o
@Marvin can you create flow.deploy(...) with flow_run_name that will be used when flow would be executed?
m
thought for 151.0 seconds
Short answer: not on the deployment. In Prefect 3.x there’s no
flow_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):
Copy code
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:
Copy code
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.