await run.retry(); // from whichever step failed
await run.retry("transform"); // from a chosen steprun.retry() # from whichever step failed
run.retry("transform") # from a chosen stepWhat is kept
- Every step before the one you restart from, with its output — nothing is recomputed.
- The replaced attempt, moved into that step's
attempts. - The run's identifier: it is the same run, continued.
A chain that failed at step five has already paid for four. Re-running the whole thing would pay again and could repeat an effect — a second message, a second write.
What it is for
- A transient failure — a service that was briefly down.
- A fixed configuration: change the workflow, then retry the run against the new definition.
- A step whose input was wrong, once whatever produced it is corrected.
When it is refused
| Code | When |
|---|---|
| run_not_retryable | The run is still going, or a step before the one chosen did not succeed. |
The second half of that is the useful guard: restarting from step five when step four failed would run five on something that never happened.
Effects are repeated, not resumed
If a storage write succeeded and a later step failed, retrying from the write writes twice. Choose the step to restart from with that in mind — the default, the failed one, is usually right for exactly this reason.