Durable Agent Execution & Long-Running Agent Runtimes

Durable Agent Execution & Long-Running Agent Runtimes

The infrastructure/platform layer that lets AI agents run for minutes, hours, or days and survive process crashes, deploys, and long waits. It checkpoints agent progress, replays or restores state on recovery, pauses indefinitely for human approval, and makes tool side effects exactly-once. This skill covers the PLATFORMS that make agent loops durable — not how to design the loop logic itself.

When to use / Skip

Use when you are choosing, integrating, or debugging the runtime beneath a long-running agent:

Skip — defer to the right neighbor:

The durable-execution model

Workflow-as-code + a journal. You write ordinary-looking async code; the runtime records every step’s input/output into an append-only event log (a “journal” or “checkpoint”), keyed per execution/thread. On crash, the runtime restores the pre-failure state so the function continues “effectively once and to completion — whether it runs for seconds or years.”

Three architectural camps solve this. This axis drives every selection decision below:

Camp 1 — Deterministic replay / event sourcing

(Temporal, Restate, DBOS, Hatchet, Resonate, Vercel Workflow, Inngest) On recovery the workflow function is re-executed from the start, but completed steps return their recorded results instead of re-running. This demands the workflow body be deterministic: same inputs -> same command sequence. Hence all non-determinism — LLM calls, tool I/O, time, randomness, UUIDs — must live in journaled steps/activities, outside the replay path. This is THE friction when applying classic durable execution to agents.

Camp 2 — State-checkpoint snapshots

(LangGraph / LangSmith Deployment) Instead of replay-from-start, the runtime saves a snapshot of graph state at every super-step — a checkpoint — keyed by thread. Resume = load the latest checkpoint and continue. No determinism constraint on node bodies. Caveat: replay/time-travel re-executes nodes after the chosen checkpoint, so LLM/API/interrupt calls there fire again and may differ.

Camp 3 — Durable actor

(Cloudflare Agents SDK on Durable Objects) Each agent is an addressable stateful micro-server with an embedded SQLite DB. It consumes zero compute when hibernated, wakes on an event (HTTP / WebSocket / alarm / email), reads its state, works, then sleeps. State lives with the actor, not in a central journal.

Platform landscape

Temporal — the category-definer (deterministic replay)

LangGraph / LangSmith Deployment — state-checkpoint, agent-native

Cloudflare Agents SDK — durable actor on Durable Objects

Inngest (+ AgentKit) — serverless-first memoized steps

DBOS — durable execution inside Postgres (no orchestrator)

Restate — lightweight journal/replay, Rust single binary

Hatchet — durable task queue on Postgres

Trigger.dev (v3) — no-timeout durable serverless via CRIU

Resonate — distributed async/await (emerging)

Vercel Workflow — durability as a language directive

Core capabilities (cross-cutting)

Integration patterns

Temporal — non-determinism goes in Activities:

@workflow.defn
class AgentWorkflow:
    @workflow.run
    async def run(self, goal: str) -> str:
        # orchestration only — deterministic
        while not done:
            # LLM call + tool call MUST be Activities (recorded, retried, not replayed)
            decision = await workflow.execute_activity(call_llm, state, ...)
            result   = await workflow.execute_activity(run_tool, decision, ...)
            state = update(state, result)   # pure, deterministic
        return state

LangGraph — interrupt for human approval, resume by thread:

graph = builder.compile(checkpointer=PostgresSaver(...))      # durable
cfg = {"configurable": {"thread_id": "user-42"}}
# node body: value = interrupt({"approve_action": proposed})  # pauses, persists
graph.invoke(inputs, cfg)                                      # runs until interrupt
# ...hours later, after a human decides...
graph.invoke(Command(resume="approved"), cfg)                 # resumes same thread

Cloudflare — durable actor with cron + state:

export class ProjectManager extends Agent<Env, State> {
  async onStart() {
    await this.schedule("0 9 * * *", "checkDeadlines", {}, { idempotent: true });
    await this.scheduleEvery(1800, "syncProgress");           // every 30 min
  }
  @callable() bump() { this.setState({ n: this.state.n + 1 }); } // persisted to SQLite
}

Inngest AgentKit — loop is orchestration, durability via the wrapper:

const network = createNetwork({ agents:[...], router: ({network,callCount}) => ... });
// durability + retries + concurrency come from wrapping network.run in a function:
inngest.createFunction({ id:"net", retries:1 },
  { event:"net/run" },
  async ({ event }) => network.run(event.data.input));        // <- the durable engine

Selection / decision guidance

Decide by where your workflow’s boundary sits and who operates the control plane:

Rule of thumb: all of them will reliably persist your state. The real questions are language, who runs the control plane, migration cost in two years, and whether you need replay-determinism discipline (Camp 1) or are happy with snapshots (LangGraph) / actors (Cloudflare).

Anti-patterns & failure modes

2025-2026 frontier

Sources

  1. Temporal — Workflow definition/determinism, put LLM/AI/API/DB calls in Activities: https://docs.temporal.io/workflow-definition , /workflows , /workflow-execution
  2. Temporal — durable AI agent tutorial: https://learn.temporal.io/tutorials/ai/durable-ai-agent/
  3. LangGraph — persistence, interrupts, time-travel, assistants: https://docs.langchain.com/oss/python/langgraph/persistence , /interrupts , /use-time-travel , https://docs.langchain.com/langsmith/assistants
  4. LangGraph Platform GA / rename to LangSmith Deployment: https://www.langchain.com/blog/langgraph-platform-ga
  5. 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/
  6. 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
  7. 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
  8. Hatchet — durable tasks: https://docs.hatchet.run/v1/durable-tasks , https://github.com/hatchet-dev/hatchet
  9. Trigger.dev v3 — no-timeout, CRIU, wait.* / waitpoints: https://trigger.dev/blog/v3-announcement , https://trigger.dev/docs/wait-for
  10. Restate — develop docs / virtual objects: https://docs.restate.dev/
  11. Resonate — develop docs + repo (v0.9.1, Apr 2026, early): https://docs.resonatehq.io/develop , https://github.com/resonatehq/resonate
  12. 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
  13. 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

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.