<@ULVA73B9P> how can I control the suffix of the `...
# marvin-ai
t
@Marvin how can I control the suffix of the
task name
or
flow name
on the UI? it always appears with smt like: my-task-3dac
m
thought for 467.5 seconds
Short answer: that suffix is only added to the auto-generated run names. If you set your own run names, Prefect will use them as-is (no random suffix). In Prefect 3.x: - Flow runs: set
flow_run_name
on the
@flow
decorator - Task runs: set
task_run_name
on the
@task
decorator You can use: - A static string - A format string that references parameters by name - A callable to build the name dynamically Examples
Copy code
from prefect import flow, task

# Static run names (no suffixes)
@flow(flow_run_name="daily-sync")
def sync_flow():
    ...

@task(task_run_name="load-users")
def load_users():
    ...

# Use flow parameters in the flow run name
@flow(flow_run_name="ingest-{customer_id}")
def ingest_flow(customer_id: str):
    ...

# Use task parameters in the task run name
@task(task_run_name="transform-{table}")
def transform(table: str):
    ...

# Build names via callables
from prefect import runtime

@flow(flow_run_name=lambda: f"backfill-{runtime.flow_run.parameters['date']}")
def backfill(date: str):
    ...

@task(task_run_name=lambda params: f"normalize-{params['entity']}")
def normalize(entity: str):
    ...
Notes - The
name
argument controls the definition name (e.g., how the task/flow is labeled in the graph), while `flow_run_name`/`task_run_name` control the run name shown in the UI. If you only set
name
, you’ll still see a run name with a suffix unless you set
*_run_name
. - If you already set a run name and still see a suffix, share a minimal snippet and your Prefect version—I’ll help debug.