01 · It finishes
A crash doesn’t start the run over.
Every step is written to the run’s journal as it finishes. If the process dies, a recovery sweep picks the run up again: finished steps come back from the journal, and only the unfinished step runs again.
- Side effects carry an idempotency key from run, step and attempt, so a retried model call is billed once.
- A distributed lock makes sure only one worker resumes a run.