The problem: a late failure shouldn't undo early work
A workflow that fails at step 18 of 20 and restarts from step 1 is worse than slow — it re-issues every model and tool call, doubling cost and risking duplicate side effects. Good failure recovery for AI workflows rests on a few mechanisms working together:
- Retry policies — attempt limits and which errors are retryable.
- Backoff — spacing out retries (often exponential) so you don't hammer a struggling provider.
- Persistent state — progress that outlives the process that produced it.
- Idempotency — steps that are safe to re-enter without duplicating effects.
- Partial completion — recognizing which steps already finished.
- Resume semantics — continuing from the next incomplete step.
- Checkpointing — the durable markers that make all of the above possible.
Concepts
Retry, resume, and not doing it twice
Retry vs. resume
Retry re-attempts a single failed step. Resume continues an entire run from its last checkpoint. You need both: retries handle a flaky call in place; resume handles the process itself dying. Retry without persisted state can't survive a worker restart — the state is gone.
Idempotency is what makes resume safe
Resuming is only safe if re-entering a step can't double its side effects. An idempotency key per side-effecting step (send, charge, write) means "if this already happened, don't do it again." Without it, recovery risks sending the second email.
Backoff protects the thing that's failing
When a provider returns 429 or 503, immediate retries make it worse. Exponential backoff gives the dependency room to recover and turns a transient failure into a short delay rather than a dead run.
Worked example: recovering a data-enrichment run
An agent enriches 500 records, calling an LLM and two APIs per record:
- At record 320, an API rate-limits. The step backs off and retries — the first 319 records stay done.
- During the backoff, the worker is redeployed. The run is checkpointed, so it isn't lost.
- A new worker resumes from record 320, not record 1.
- Records already written are guarded by idempotency keys, so nothing is written twice.
- The run completes; its history shows the retry and the resume for later inspection.
The difference
How Vectorbea helps
Recovery is the default behavior
- Per-node retries with backoff. Transient failures are retried under a policy instead of failing the run.
- Resume from the last checkpoint. After a crash, restart or deploy, a run continues where it stopped.
- Immutable history. Retries and resumes are recorded, so you can see exactly how a run recovered.
- Replay for debugging. Reproduce a failed run from its event history to find the root cause.
FAQ
AI workflow failure recovery — FAQ
- How do you recover a failed AI workflow?
- With durable execution you recover by resuming from the last checkpoint rather than re-running from the start. The engine reloads the run's persisted state, retries the failed step under a retry policy, and continues. Completed steps aren't repeated.
- How do you resume an AI workflow instead of restarting it?
- Resuming requires that the workflow's progress was checkpointed as it ran. On failure, the run loads its last checkpoint and continues from the next step. Restarting — losing all prior work — is what happens when there's no persisted state to resume from.
- How do retries avoid duplicate side effects?
- By making steps idempotent, usually with an idempotency key. If a step is retried after it already performed its side effect, the key ensures the effect isn't applied twice — so a retried 'send email' or 'charge card' doesn't fire again.