Robert Szomolanyi
11/28/2025, 5:58 PMMarvin
11/28/2025, 5:58 PMMarvin
11/28/2025, 6:05 PMprefect flow-run ls --state RUNNING --limit 100
- Note: the CLI list does not include the deployment name in the table. For a single run you can inspect to see its `deployment_id`:
prefect flow-run inspect <flow_run_id>
- Python (list running flow runs with their deployment names)
import asyncio
from prefect.client.orchestration import get_client
from prefect.client.schemas.filters import FlowRunFilter
from prefect.client.schemas.objects import StateType
async def main():
async with get_client() as client:
runs = await client.read_flow_runs(
flow_run_filter=FlowRunFilter(
state={"type": {"any_": [StateType.RUNNING]}}
),
limit=200,
)
# Lookup deployment names (some runs may have no deployment)
dep_names = {}
for r in runs:
if r.deployment_id and r.deployment_id not in dep_names:
dep = await client.read_deployment(r.deployment_id)
dep_names[r.deployment_id] = dep.name
for r in runs:
dep_name = dep_names.get(r.deployment_id, "None")
print(f"{r.id} {r.name} deployment={dep_name}")
asyncio.run(main())
- UI
- Navigate to Flow Runs → filter by state “Running”. The table includes a Deployment column and lets you click through.
If you’d prefer a different format (e.g., JSON output for scripting) or want to include the flow name as well, I can tweak the example.