Durable Agent Execution & Long-Running Agent Runtimes
Parent: AI Agent Ecosystems · researched 2026-06-03T22:51:16.094Z· 40 sources · 12 concepts · skill durable-agent-execution
The infrastructure/platform layer that lets AI agents run for minutes, hours,
Durable Agent Execution & Long-Running Agent Runtimes
- The infrastructure/platform layer that lets AI agents run for minutes, hours, [source]
- or days and survive process crashes, deploys, and long waits. It checkpoints [source]
- agent progress, replays or restores state on recovery, pauses indefinitely for [source]
- human approval, and makes tool side effects exactly-once. This skill covers the [source]
- PLATFORMS that make agent loops durable - **not how to design the loop logic [source]
When to use / Skip
- Use when you are choosing, integrating, or debugging the runtime beneath a [source]
- An agent must survive a pod restart / deploy mid-run without losing state. [source]
- A run must pause for human approval (HITL) and resume later - without holding a [source]
- worker, socket, or compute. [source]
- A failed run must resume from step N, not re-run completed (paid) LLM/tool work. [source]
- Tool calls that write to a DB, send email, or charge a card must not double-fire. [source]
- You are picking among Temporal / LangGraph / DBOS / Restate / Inngest / [source]
- Cloudflare / Trigger.dev / Vercel Workflow / Hatchet / Resonate. [source]
- You hit a NondeterminismError or ask "where do my LLM calls go?" [source]
- Skip - defer to the right neighbor: [source]
- Designing the agent loop (sequential pipeline, infinite loop, RFC-driven DAG, [source]
- REPL loop) -> autonomous-loops. We make loops durable; that skill designs them. [source]
- Multi-agent topologies / councils / handoff routing -> ai-agents-orchestration [source]
- (this skill is the deep durable-execution spoke that hub routes to). [source]
- Agent memory architecture / context engineering -> ai-mcp-sdk-prompting. [source]
- Generic (non-agent) job scheduling, MV3 alarms, SSE streaming -> [source]
- software-engineering-patterns. [source]
- Eval/observability of agent quality -> ai-agents-orchestration [source]
- (references/eval-driven-development.md) / [source]
- ai-llm-model-layer (references/llm-observability.md). [source]
The durable-execution model
- Workflow-as-code + a journal. You write ordinary-looking async code; the [source]
- runtime records every step's input/output into an append-only event log (a [source]
- "journal" or "checkpoint"), keyed per execution/thread. On crash, the runtime [source]
- restores the pre-failure state so the function continues "effectively once and to [source]
- completion - whether it runs for seconds or years." [source]
- Three architectural camps solve this. **This axis drives every selection [source]
Camp 1 — Deterministic replay / event sourcing
- On recovery the workflow function is re-executed from the start, but completed [source]
- steps return their recorded results instead of re-running. This demands the [source]
- workflow body be deterministic: same inputs -> same command sequence. Hence [source]
- **all non-determinism - LLM calls, tool I/O, time, randomness, UUIDs - must live [source]
- in journaled steps/activities, outside the replay path.** This is THE friction [source]
- when applying classic durable execution to agents. [source]
- Temporal: NondeterminismError if re-generated commands don't match the Event [source]
- History. Use SDK-provided replay-safe time/random; move all I/O to Activities; [source]
- write replay tests before changing workflow code. [source]
- The "function looks normal but is secretly re-run many times" mental model is [source]
- shared by Restate, DBOS, Resonate, and Vercel WDK ("must be deterministic to [source]
- allow resuming after failures"). [source]
Camp 2 — State-checkpoint snapshots
- Instead of replay-from-start, the runtime saves a **snapshot of graph state at [source]
- every super-step** - a checkpoint - keyed by thread. Resume = load the [source]
- latest checkpoint and continue. No determinism constraint on node bodies. [source]
- Caveat: replay/time-travel re-executes nodes after the chosen checkpoint, so [source]
- LLM/API/interrupt calls there fire again and may differ. [source]
Camp 3 — Durable actor
Temporal — the category-definer (deterministic replay)
- Model: Workflow (deterministic orchestrator) + Activity (non-determinism [source]
- sink, auto-retried, result recorded in Event History). On replay, Activities are [source]
- NOT re-run - recorded results are reused. [source]
- Agent fit: put every LLM call + tool call in an Activity. Official **OpenAI [source]
- Agents SDK integration (late 2025). Signals** deliver external/human input [source]
- to a running workflow (HITL); Queries read state; durable Timers for [source]
- delays; ContinueAsNew to trim unbounded history. [source]
- Ops: heavyweight - server cluster (History/Matching/Frontend) + Cassandra/ [source]
- Postgres + Elasticsearch + a separately deployed worker fleet. MIT; self-host or [source]
- Temporal Cloud. SDKs: Go/Java/Py/TS/.NET/PHP/Ruby. [source]
- Best for: multi-tenant, multi-region, very-high fan-out, mission-critical, [source]
- >4h tasks where full restart cost exceeds the Cloud bill. [source]
LangGraph / LangSmith Deployment — state-checkpoint, agent-native
- Renamed: "LangGraph Platform" (GA May 2025) -> "LangSmith Deployment" [source]
- (Oct 2025). Same product; both names appear in the wild. [source]
- Persistence: compile the graph with a checkpointer (Postgres/SQLite/ [source]
- memory) -> a state snapshot is saved every step, organized into threads [source]
- (thread_id is the resume pointer). [source]
- HITL: interrupt(payload) pauses at an exact point, persists state, and [source]
- waits indefinitely; resume with Command(resume=value). Payload must be [source]
- JSON-serializable. Use a durable checkpointer in production. [source]
- Time-travel: Replay (re-run from a prior checkpoint_id) and Fork [source]
- (update_state at a past checkpoint -> branch an alternative trajectory). Nodes [source]
- after the checkpoint re-execute; interrupts always re-trigger. [source]
- Assistants API: one deployed graph -> many assistants (versioned configs: [source]
- prompts/models/tools), promote/rollback versions. ~30 server endpoints; Remote [source]
- Graphs for distributed multi-agent; LangGraph Studio for debugging. [source]
Cloudflare Agents SDK — durable actor on Durable Objects
- Model: class X extends Agent; each instance = one Durable Object with its [source]
- own SQLite DB + WebSocket connections + scheduling. Wakes on event, hibernates [source]
- when idle (zero compute). [source]
- State: this.setState() serializes + persists to SQLite and broadcasts to [source]
- connected clients; this.state lazily loads; this.sql for tables. Survives [source]
- evictions/deploys/hibernation. [source]
- Hibernation: WebSocket clients stay connected to Cloudflare's edge while the [source]
- DO sleeps; on next event the constructor re-runs (keep it light). Use [source]
- serializeAttachment/deserializeAttachment to restore per-connection state. [source]
- Scheduling: this.schedule(60|Date|"cron", "method") and scheduleEvery(s) [source]
- wrap DO alarms; stored in cf_agents_schedules; cron self-reschedules. [source]
- Long work: keepAlive() holds an alarm-backed heartbeat so the DO isn't [source]
- evicted mid-stream; runFiber()/stash() checkpoint & recover long tasks; [source]
- waitForApproval() for HITL; runWorkflow() delegates heavyweight multi-step [source]
- work to Cloudflare Workflows; subAgent() for children. [source]
Inngest (+ AgentKit) — serverless-first memoized steps
- Core: step.run("name", fn) is a durable, auto-retried, memoized unit — [source]
- on resume, completed steps return cached results instantly. step.waitForEvent() [source]
- pauses for HITL/coordination; step.sleep for durable sleep (hours->weeks); [source]
- step.sendEvent() fire-and-forget. Declarative cancellation by event. Priced per step. [source]
- AgentKit (separate TS framework): builds multi-agent Networks with a [source]
- Router + shared State - "a while loop with memory." *The Network/Router [source]
- loop is orchestration (-> autonomous-loops / orchestration); durability comes from [source]
- wrapping network.run() inside an inngest.createFunction to inherit retries, [source]
- concurrency, and throttling.* This is the cleanest illustration of the [source]
- loop-vs-runtime boundary. [source]
DBOS — durable execution *inside Postgres* (no orchestrator)
- Model: install the OSS library, annotate @DBOS.workflow / @DBOS.step. [source]
- Step outputs + workflow state are checkpointed to a Postgres "system database." [source]
- No separate orchestrator - app servers cooperatively dequeue workflows from a [source]
- Postgres table and checkpoint steps themselves. [source]
- Recovery: detect interrupted workflows -> re-call with checkpointed inputs -> [source]
- each step checks Postgres for a saved output and skips if present -> first [source]
- un-checkpointed step runs normally. = resume from last completed step. [source]
- Agent extras: fork a workflow (copy checkpoints up to step N, restart from [source]
- there - "git branch for an agent run"). Durable queues with global/per-worker/ [source]
- per-tenant flow control. Native OpenAI Agents SDK integration; Databricks [source]
- partnership (Apr 2026, runs on Lakebase Postgres). Go SDK (2026). Py/TS/Go/Java. [source]
- Lowest barrier if you already run Postgres; throughput ceiling + PG lock-in are [source]
Restate — lightweight journal/replay, Rust single binary
- Core abstractions: Virtual Objects (stateful keyed entities with serialized [source]
- per-key concurrency), Workflows, Services. Journals completed steps; [source]
- replay returns cached results. Embedded RocksDB + arbitrary external storage; [source]
- HTTP/2 + Connect/gRPC; per-handler idempotency. Single binary or Restate Cloud. [source]
- BSL. Go/Java/TS/Py/Rust/Kotlin. Best when you want durable execution + stateful [source]
- entities without operating a cluster; strong for serverless/edge. [source]
Hatchet — durable task queue on Postgres
- Durable tasks checkpoint to a durable event log every time they wait [source]
- (sleep/event) or spawn children; replay resumes from the last checkpoint with [source]
- exactly-once semantics. While waiting, Hatchet **evicts the task off the worker [source]
- slot** and re-queues it later - ideal for agentic loops with long HITL waits. [source]
- Offers both DAGs (static) and durable tasks (runtime-dynamic). Postgres for both [source]
- runtime + observability (easy self-host). MIT. Py/TS/Go/Ruby. [source]
Trigger.dev (v3) — no-timeout durable serverless via CRIU
- Write linear async code; wait.for({hours:1}) / wait.until(date) / [source]
- wait.forToken() (HITL: token has a callback URL, complete via HTTP POST, [source]
- resume with wait.forToken()); triggerAndWait() / batchTriggerAndWait(). [source]
- No timeouts - code runs in a container paused/resumed via CRIU [source]
- (Checkpoint/Restore In Userspace); checkpointed waits don't bill compute. OSS with [source]
- the most mature self-host path (Postgres + Redis + S3-compatible store) or Cloud. [source]
Resonate — distributed async/await (emerging)
- "Durable Executions, Dead Simple." ctx.run() (durable step), ctx.sleep(), [source]
- ctx.rpc(), and Durable Promises (await human/external input for days). [source]
- Deterministic replay; single-binary Resonate Server. **Maturity caveat: early — [source]
- v0.9.1, repo created Apr 2026, single-digit GitHub stars. Track for the model; [source]
- do not treat as a Temporal peer yet.** [source]
Vercel Workflow — durability as a language directive
- OSS Workflow Development Kit (WDK) + managed Vercel Workflows (beta Oct [source]
- 2025 -> GA; 100M+ runs, 500M+ steps). Two directives: "use workflow" (durable [source]
- fn) and "use step" (isolated, persisted, retried unit; default 3 retries). [source]
- sleep("1 month") suspends with zero resources; createWebhook() returns a URL [source]
- to resume on external/human input. Durable streams: getWritable() survives [source]
- client disconnect/reconnect. Deep AI SDK integration. TS + Python. [source]
Core capabilities (cross-cutting)
- Checkpointing / state persistence: journal of step outputs (Temporal, [source]
- Restate, DBOS, Inngest, Hatchet, Resonate, Vercel) vs state snapshot per node [source]
- (LangGraph) vs actor-embedded SQLite (Cloudflare). Always use a durable backend [source]
- in prod, never in-memory. [source]
- HITL interrupt & resume: the unifying requirement is *pause without holding [source]
- compute/worker/socket, resume on an external event.* LangGraph interrupt() + [source]
- Command(resume=); Temporal Signals; Inngest waitForEvent; Trigger.dev/Vercel [source]
- webhook-or-token; Resonate Durable Promises; Cloudflare waitForApproval(). [source]
- Replay / time-travel debugging: Temporal replays Event History (+ replay [source]
- tests as a CI guard); LangGraph replay + fork; DBOS workflow fork. Forking [source]
- = re-run an agent from step N with edited state to debug prompts/tools. [source]
- Scheduling / cron / delays: Cloudflare schedule/scheduleEvery (DO alarms, [source]
- self-rescheduling cron); durable sleep in Inngest/Trigger.dev/Vercel/Resonate; [source]
- Temporal durable Timers. All survive restarts; long sleeps don't burn compute. [source]
- Concurrency & queues: DBOS durable queues with global/per-worker/per-tenant [source]
- flow control; Hatchet fine-grained parallelism + priorities; Temporal task [source]
- queues; Inngest/AgentKit concurrency + throttling on the function. [source]
Integration patterns
Selection / decision guidance
- Decide by where your workflow's boundary sits and **who operates the control [source]
- Already on Postgres, small team, workflow fits inside one DB boundary -> DBOS [source]
- or Hatchet ("Postgres is enough"). Lowest infra; exactly-once is tightest when [source]
- side effects share the same DB. Watch throughput ceiling + PG lock-in. [source]
- **Cross-service / multi-tenant / multi-region / very-high fan-out, maturity [source]
- matters** -> Temporal. Pay the cluster ops cost; it earns its keep. [source]
- **Agent IS naturally graph-shaped, you want first-class HITL + time-travel + [source]
- versioned assistants** -> LangGraph / LangSmith Deployment. [source]
- Edge / per-user stateful agent, WebSocket chat, zero-idle-cost, global -> [source]
- Cloudflare Agents (Durable Objects). [source]
- **Next.js / Vercel stack, want durability as a language directive, AI SDK [source]
- integration** -> Vercel Workflow. [source]
- TypeScript serverless, fastest onboarding, per-step pricing -> Inngest. [source]
- Unlimited task duration + mature self-host -> Trigger.dev v3. [source]
- Want lightweight durable execution + stateful entities, single binary -> [source]
- Tracking the frontier / distributed async-await model -> Resonate (not yet a [source]
- Rule of thumb: all of them will reliably persist your state. The real questions [source]
- are language, who runs the control plane, migration cost in two years, and whether [source]
- you need replay-determinism discipline (Camp 1) or are happy with snapshots [source]
- (LangGraph) / actors (Cloudflare). [source]
Anti-patterns & failure modes
- Non-determinism in a replay workflow body. Date.now(), Math.random(), [source]
- uuid(), direct HTTP/DB/LLM calls in a Temporal/Restate/Vercel/DBOS workflow -> [source]
- NondeterminismError or silent drift on replay. Fix: move ALL I/O to [source]
- steps/activities; use SDK replay-safe time/random. [source]
- Changing workflow code while runs are in flight -> command/event mismatch. [source]
- Use workflow versioning/patching and replay tests in CI. [source]
- In-memory / non-durable checkpointer in production (LangGraph) -> state lost [source]
- on restart; HITL interrupt() can't resume. Always back it with a DB. [source]
- Holding a worker / socket / compute during a long human wait. Defeats the [source]
- point and costs money. Use durable sleep / wait-for-token / interrupt so the [source]
- platform evicts and re-queues (Hatchet, Trigger.dev, Inngest, Cloudflare [source]
- keepAlive only for active work). [source]
- Assuming replay/time-travel re-reads from cache. In LangGraph, nodes after [source]
- the checkpoint re-execute (LLM/API/interrupt fire again). Budget for it. [source]
- Non-idempotent side effects. Even with exactly-once intent, design tool [source]
- steps to be idempotent (idempotency keys) - retries and recovery can re-enter the [source]
- Unbounded event history / state growth on years-long runs -> use [source]
- ContinueAsNew (Temporal) or equivalent; prune. [source]
- Picking the heaviest platform for a 3-person team. Temporal's cluster is not [source]
- a weekend project; don't adopt it for a single Postgres-centric service. [source]
- Confusing the loop with the runtime. AgentKit Networks / LangGraph node [source]
- wiring are loop design - see autonomous-loops. This skill is the durable [source]
- substrate beneath them. [source]
2025-2026 frontier
- First-party durable execution everywhere: AWS Durable Functions (Lambda), [source]
- Cloudflare Workflows GA, Vercel Workflow - all shipped late 2025; durable [source]
- execution is now table-stakes infra. [source]
- "Postgres is all you need" vs dedicated orchestrator is the live debate [source]
- (DBOS/Hatchet vs Temporal). DBOS Go SDK + Databricks/Lakebase (Apr 2026) push the [source]
- library-on-your-DB model. [source]
- Official agent-SDK integrations: Temporal x OpenAI Agents SDK (late 2025); [source]
- DBOS x OpenAI Agents SDK; Vercel Workflow x AI SDK - durability wired directly [source]
- under agent frameworks so tool calls become steps automatically. [source]
- Durable streams (Vercel getWritable(), Cloudflare): agent output survives [source]
- the user closing the browser; reconnect resumes the stream. [source]
- Workflow forking as agent-debugging (DBOS, LangGraph): "git branch" a run [source]
- from a checkpoint to reproduce and fix prompt/tool issues. [source]
- Maturity spread is wide: Temporal (battle-tested) -> Vercel/Cloudflare/Inngest [source]
- (production, young) -> Resonate (v0.9.x, experimental). Calibrate accordingly. [source]
Sources
- Temporal - Workflow definition/determinism, put LLM/AI/API/DB calls in Activities: https://docs.temporal.io/workflow-definition , /workflows , /workflow-execution [source]
- Temporal - durable AI agent tutorial: https://learn.temporal.io/tutorials/ai/durable-ai-agent/ [source]
- LangGraph - persistence, interrupts, time-travel, assistants: https://docs.langchain.com/oss/python/langgraph/persistence , /interrupts , /use-time-travel , https://docs.langchain.com/langsmith/assistants [source]
- LangGraph Platform GA / rename to LangSmith Deployment: https://www.langchain.com/blog/langgraph-platform-ga [source]
- Cloudflare Agents - agent-class, long-running-agents, schedule-tasks, DO websockets: https://developers.cloudflare.com/agents/concepts/agent-class/ , /concepts/long-running-agents/ , /api-reference/schedule-tasks/ [source]
- Inngest - durable steps for AI agents, durable workflows, AgentKit Networks: https://www.inngest.com/blog/ai-agents-inngest-durable-steps , https://www.inngest.com/uses/durable-workflows , https://agentkit.inngest.com/concepts/networks [source]
- DBOS - architecture, postgres-is-all-you-need, durable agents + Databricks, Go-native, vs Temporal: https://docs.dbos.dev/architecture , https://www.dbos.dev/blog/postgres-is-all-you-need-for-durable-execution , https://www.dbos.dev/blog/building-durable-agents-dbos-databricks , https://docs.dbos.dev/explanations/comparing-temporal [source]
- Hatchet - durable tasks: https://docs.hatchet.run/v1/durable-tasks , https://github.com/hatchet-dev/hatchet [source]
- Trigger.dev v3 - no-timeout, CRIU, wait.* / waitpoints: https://trigger.dev/blog/v3-announcement , https://trigger.dev/docs/wait-for [source]
- Restate - develop docs / virtual objects: https://docs.restate.dev/ [source]
- Resonate - develop docs + repo (v0.9.1, Apr 2026, early): https://docs.resonatehq.io/develop , https://github.com/resonatehq/resonate [source]
- Vercel Workflow - introducing-workflow, new-programming-model, docs: https://vercel.com/blog/introducing-workflow , https://vercel.com/blog/a-new-programming-model-for-durable-execution , https://vercel.com/docs/workflows [source]
- 2025-2026 landscape/comparisons: https://www.tiarebalbi.com/en/blog/dbos-vs-temporal-postgres-durable-execution , https://reptile.haus/journal/durable-execution-ai-agents-temporal-restate-inngest-2026/ , https://agentmarketcap.ai/blog/2026/04/10/durable-agent-execution-production-temporal-modal-event-sourced [source]
- > Boundary note: agent loop DESIGN (sequential/infinite/DAG/REPL) defers to autonomous-loops; multi-agent topologies to ai-agents-orchestration (this is the deep durable-execution spoke that hub routes to). Maturity is uneven - Temporal battle-tested; Vercel/Cloudflare/Inngest production-but-young; Resonate is v0.9.x experimental. [source]
Children
- Deterministic replay & event sourcing (frontier)
- Workflow-as-code / durable functions (frontier)
- Checkpointing & state persistence (frontier)
- Human-in-the-loop interrupts & resume (frontier)
- Activities vs workflow body (non-determinism isolation) (frontier)
- Time-travel debugging & workflow forking (frontier)
- Durable sleep, timers & cron scheduling (frontier)
- Exactly-once side effects & idempotency (frontier)
- Durable actors & hibernation (Durable Objects) (frontier)
- Durable queues & concurrency flow control (frontier)
- Durable streams (reconnectable agent output) (frontier)
- Postgres-backed vs orchestrator-based durability (frontier)
Frontier under this node: Activities vs workflow body (non-determinism isolation), Checkpointing & state persistence, Deterministic replay & event sourcing, Durable actors & hibernation (Durable Objects), Durable queues & concurrency flow control, Durable sleep, timers & cron scheduling, Durable streams (reconnectable agent output), Exactly-once side effects & idempotency, Human-in-the-loop interrupts & resume, Postgres-backed vs orchestrator-based durability, Time-travel debugging & workflow forking, Workflow-as-code / durable functions