AI systemsdurable workflowworkflow enginecheckpointingcheckpoint

Durable execution

Definition

Durable execution is an execution model in which a workflow's progress, such as completed steps, inputs and outputs, is recorded durably, so the workflow survives process crashes, restarts and long waits and continues from its last checkpoint.

In practice

Agent tasks run for minutes or hours across tens of model and tool calls, which is far beyond what a web request can hold. A platform accepts the task onto a queue, and runners take it under a lease, checkpoint after every step (plan, history, tool results, pending actions) and renew the lease with heartbeats. If a runner dies, the lease expires and another runner resumes from the checkpoint. Workflow engines such as Temporal provide this without building it by hand.

Resuming means some steps run more than once: execution is effectively at-least-once, so tools with side effects need idempotency keys. Persisting every step adds latency and storage, and changing workflow code while runs are in flight needs versioning. For short, single-step requests it is unnecessary overhead.

Example

A triage task crashes after step 7 of 12; its lease expires after 30 s, another runner loads the step-7 checkpoint and continues, and create_ticket is not repeated because it uses an idempotency key.