The problem: real AI workflows don't fit in one function call
A demo agent runs in a single process, in one uninterrupted burst. A production AI workflow does not. It fans out across multiple model calls, tool and API calls, database writes, and sometimes a human approval that can take hours or days. The longer and more distributed a run gets, the more ways it has to fail partway through.
Any of these can interrupt a run in flight:
- The process crashes or is OOM-killed mid-run.
- A model provider fails or times out on one call out of twenty.
- An API returns a 429 rate limit and needs backoff.
- A transient network failure drops a tool call.
- A worker restarts or is rescheduled by the orchestrator.
- A step waits on a human approval that arrives much later.
- A deployment ships while a run is halfway through.
The failure mode to avoid
Concepts
What durable execution actually means
Durable execution turns a workflow from an in-memory program into a persisted, recoverable one. A handful of concepts do the work:
Persisted workflow state
The run's progress — which steps completed, their outputs, what's pending — lives in a database, not only in process memory. If the process disappears, the state does not.
Checkpoints
After each meaningful step, the workflow writes a checkpoint: a durable marker of "this step finished, here is its result." Checkpoints are the points a run can safely resume from.
Retries and backoff
Failed steps are retried with a policy (attempt limits, exponential backoff) rather than failing the whole run. Because state is persisted, retries pick up against the last checkpoint.
Resumability
After a crash, restart or pause, the workflow resumes from its last checkpoint — not from the beginning. The completed work is not repeated.
Idempotency
Steps with side effects (sending mail, charging a card, calling a tool) should be safe to re-enter. Durable engines lean on idempotency keys so a retried step doesn't duplicate its effect.
Timers and approvals
Waiting — for a backoff window, a scheduled time, or a human decision — is modeled as durable state, so a run can sleep for days without holding a live worker the entire time.
How Vectorbea helps
Durable execution, as the default
Vectorbea is a control plane for long-running agentic workflows. Durability isn't a library you wire up — it's how every run works:
- Every node checkpoints as it runs. Each step's completion and output are recorded durably, so a run always has a known-good point to resume from.
- Resume from the last checkpoint. A failed tool call, a rate limit, or a worker restart picks up exactly where it left off — no work lost, no tokens re-spent.
- Automatic retries with per-node backoff. Transient failures are retried on top of persisted state instead of failing the whole workflow.
- Immutable event history. Every tool call, LLM response, retry and approval is recorded as an event you can inspect — and replay a whole run to debug it.
- Human approval gates. A run can suspend on a decision and resume when it's approved, without a process sitting idle in between.
- Token and cost visibility. Usage is tracked per run so durability doesn't come at the price of a black box.
A durable run, step by step
Consider a renewals agent that runs on a schedule:
- Start: the workflow begins and checkpoints its trigger and inputs.
- Triage: an agent classifies the account; the node completes and checkpoints its output.
- Tool call: a pricing API returns a 429. The node retries with backoff — against the checkpoint, not from scratch.
- Approval: the run requests a human sign-off and suspends. It holds durable state, not a live worker, while it waits.
- Resume & finish: on approval, the run continues from the approval checkpoint and completes.
The payoff
FAQ
Durable AI workflows — FAQ
- What is a durable AI workflow?
- A durable AI workflow is an AI/agent process whose state is persisted at each step, so it can survive crashes, restarts and long pauses and resume from the last completed step instead of starting over. Durability comes from checkpointing progress to a database rather than holding it only in a running process's memory.
- Why do AI workflows need durable execution?
- Production AI workflows chain many model calls, tool calls, API requests and sometimes human approvals over minutes to days. Any of those can fail or stall — a provider outage, a rate limit, a worker restart, a deploy. Without durable execution a failure loses all in-progress work and re-runs everything, which is slow, expensive and often non-idempotent.
- How is durable execution different from just adding retries?
- Retries alone re-attempt a failed call, but if the process holding the workflow's state dies, retries can't help — the state is gone. Durable execution persists the workflow's progress so that after any failure the run resumes from the last checkpoint, and retries operate on top of that persisted state.