Back to Prefect

How to manually retry a flow run

docs/v3/how-to-guides/workflows/retry-flow-runs.mdx

3.7.0983 B
Original Source

Use prefect flow-run retry to re-execute a failed or cancelled flow run. The flow run keeps its original ID and parameters, but the run_count increments.

Find flow runs to retry

List failed flow runs to find the name you need:

bash
prefect flow-run ls --state FAILED

Retry a deployment-based flow run

If the flow run was created from a deployment, retry schedules it for a worker to pick up:

bash
prefect flow-run retry adventurous-crocodile

The flow run's state changes to Scheduled and a worker will pick it up for execution.

Retry a local flow run

Flow runs created without a deployment require an --entrypoint to the flow code:

bash
prefect flow-run retry adventurous-crocodile --entrypoint ./flows/my_flow.py:my_flow

The flow executes immediately in the current process.

Retry by ID

If multiple flow runs share the same name, use the UUID instead:

bash
prefect flow-run retry a1b2c3d4-e5f6-7890-abcd-ef1234567890