Florent VanDeMoortele
11/19/2025, 5:28 PMMarvin
11/19/2025, 5:28 PMMarvin
11/19/2025, 5:29 PMfrom prefect import flow, runtime
@flow
def my_flow():
print(runtime.flow_run.flow_name) # <-- the Flow object's name
my_flow()
- Via the run context (inside a flow):
from prefect import flow
from prefect.context import get_run_context
@flow
def my_flow():
ctx = get_run_context()
print(ctx.flow.name)
my_flow()
Note: runtime.flow_run.name is the flow run name (e.g., “solid-gibbon”), while runtime.flow_run.flow_name is the Flow object’s name you’re asking for.