Jordan Fisher
05/26/2026, 7:19 AMMarvin
05/26/2026, 7:19 AMMarvin
05/26/2026, 7:21 AMprefect flow-run ls can list failed runs, but the table output does not include messages
- Best workaround: use prefect flow-run inspect per run, or use the Python client to fetch many runs and print state.message
CLI options verified:
- prefect flow-run ls --help
- prefect flow-run inspect --help
A quick shell pattern is:
bash
prefect flow-run ls --state FAILED
Then inspect individual runs:
bash
prefect flow-run inspect <FLOW_RUN_ID> --output json
If you want a bulk list without clicking, Python is the fastest option:
python
import asyncio
from prefect import get_client
from prefect.client.schemas.filters import FlowRunFilter
async def main():
async with get_client() as client:
runs = await client.read_flow_runs(
flow_run_filter=FlowRunFilter(
state={"type": {"any_": ["FAILED", "CRASHED"]}}
),
limit=50,
)
for run in runs:
msg = run.state.message if run.state else None
short = (msg[:120] + "...") if msg and len(msg) > 120 else msg
print(f"{run.id} | {run.name} | {short}")
asyncio.run(main())
That gives you a compact, truncated summary of failed run messages across many runs.
If helpful, I can also give you:
- a one-liner using the REST API / CLI JSON output
- a version filtered by deployment name or time window
- a script that exports these to CSV
Related docs:
- Prefect docs
- Python client referenceJordan Fisher
05/26/2026, 7:35 AMMarvin
05/26/2026, 7:35 AMMarvin
05/26/2026, 7:36 AM