Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate
Read the talk
Every step you take, every call you make: the reliable agent stack
Giselle van Dongen shows how Restate gives long-running agents journal-based recovery, suspended human approvals, isolated session state, midflight signals, cancellation, and shared infrastructure controls.
From a talk by Giselle van Dongen
At a glance
Ideas worth remembering
Reliable agent infrastructure separates four concerns: recoverable execution, consistent concurrent sessions, distributed communication, and deliberate execution control.
Journaled durable steps preserve completed progress through failures, and durable promises use the same mechanism to suspend human-approval waits across restarts and redeployments.
Virtual objects isolate state by session key and serialize updates within a session; execution IDs separately make active runs retrievable, signalable, and cancellable.
Signaling can amend work already in progress, while cancellation unwinds active subagents and controllers. Completed external side effects still require application-specific compensation.
Moving inline model calls into a shared gateway creates one place for policy checks and concurrency limits, such as the example limit of 300 simultaneous calls per department.
The distributed log and event loop connect journal events to state updates, timers, and service requests; push-based dispatch is intended to reduce latency and wake serverless functions directly.
Persistent agents change the infrastructure problem
A question-answering model can finish in seconds. A tool-using application may stay active for a session. The next step is harder: persistent, asynchronous agents that remain in an organization’s infrastructure, use tools and context, and communicate with other agents. Once work becomes long-running, stateful, and distributed, the surrounding infrastructure must survive failures and connect components that no single agent SDK owns.
Agent SDKs and memory can accelerate a proof of concept, but production systems still need retries, recovery, state consistency, communication, and operational control. Restate is presented as an open-source foundation for those backend concerns rather than an agent framework. Its ideas draw on Apache Flink and work by architects associated with Meta’s event infrastructure.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Four jobs underneath the agent loop
The infrastructure layer has four distinct jobs. Durable execution preserves a run through failure instead of restarting a week-long task. Session consistency lets thousands of conversations proceed without corrupting one another’s state. Distributed communication connects agents, MCP servers, and tools. Execution control stops work that is stuck or no longer wanted. Recovery preserves desired work; cancellation deliberately ends it.
Restate runs as a separate server in front of the agent service, acting somewhat like a proxy or message broker. It pushes an invocation to the service and keeps an open connection that van Dongen calls a “lifeline.” As the service works, operations emit events to Restate. Those events form a journal from which the execution can be reconstructed after a failure.
What relationship does that journal create between an ordinary request and a recoverable agent run? The flow below makes the persistence boundary visible: application work produces journal entries before later recovery depends on them.
The result is intended to feel like an ordinary application function while gaining long-running execution and state. The demonstration applies that model to a Slack research agent available to employees inside a company.
The journal is the recovery path
Read the diagram as text
- Incoming request. A request targets the agent service through Restate.
- Restate server. infrastructure — Proxies and pushes the invocation while maintaining the connection.
- Agent service. application — Runs application logic and emits events as durable operations occur.
- Execution journal. infrastructure — Persists the event history used for recovery.
- Recovered execution. application — Continues from recorded progress rather than restarting the whole run.
- Incoming request → Restate server: enters.
- Restate server → Agent service: pushes invocation.
- Agent service → Execution journal: emits events.
- Execution journal → Recovered execution: replays recorded progress.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A research run survives a failed search
The concrete example begins when a user asks Slack, “What is new in AI?” Restate’s UI shows the corresponding execution. A planner first calls an LLM and returns proposed research subtopics. Clicking Approve unblocks the workflow, launches parallel research agents, and eventually hands their output to a writer agent. Planning, authorization, parallel research, and synthesis are separate stages of one durable run.
An injected failure makes the recovery mechanism observable. One subagent completes an LLM call, begins web searches, and encounters a search API outage. The failed search retries and later completes successfully. The surrounding research does not restart because the journal already records the run’s progress; recovery returns to the failed operation rather than discarding earlier work.
In code, the application unit is an HTTP handler using the Restate SDK. Its Restate object context represents the connection to the server, and operations performed through that context create journal events. The planner’s Python LLM function becomes a durable step when wrapped in restate.run. If the process fails much later, the journal supplies the recorded execution point from which it can continue.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A month-long wait without a month-long function
Durability also handles intentional inactivity. A human approval may take weeks or a month, spanning service restarts and redeployments. Keeping a conventional function active for that entire period would tie the workflow’s lifetime to one process invocation.
Restate instead creates a durable promise in the journal. The promise marks a suspension point; Slack presents the approval button, and the function suspends while it waits. On serverless infrastructure, van Dongen says the suspended process consumes no function execution time. When approval arrives, the promise resolves and execution resumes where it stopped. The claim concerns serverless execution time during the wait, not the absence of storage or platform operating costs.
This works well for a sequence of durable steps, but a persistent agent needs more than a workflow-shaped history. It also needs an identity, memory, and a way to accept new input while work is already underway.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Virtual objects turn sessions into stateful actors
Restate models that persistent entity as a virtual object, similar to a stateful actor. Each object has a unique key such as a session ID, isolated key-value state such as message history, and handlers that can run durable functions for the session. A user can therefore add context while research is underway instead of waiting ten minutes for the first run to finish.
Isolation alone does not prevent two messages in the same session from racing. If both handlers updated the same conversation state concurrently, one could overwrite the other. The session controller prevents this by allowing one execution at a time for a given object key; another execution waits in a queue behind it. Separate sessions can still run concurrently, but serialization within one session trades some per-session latency for consistent updates.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Signal relevant context; cancel a new direction
A session ID addresses persistent conversation state. A separate execution ID addresses one active run. Other processes can use that execution ID to retrieve output, send a signal containing new state, or cancel the run. Together, the two identities let a controller remember the conversation while directly contacting the particular research execution already in flight.
The application adds an LLM classifier on top of those control primitives. When a new Slack message arrives, the classifier asks whether it is relevant to the current research. Relevant context is sent as a signal; unrelated context causes cancellation followed by a new run. Restate supplies addressability and control, while the classifier makes the application-level routing decision.
The first follow-up—“focus on frontier models”—stays within the original “What is new in AI?” assignment. The controller classifies it as relevant and injects it into the active loop. The UI then shows the message entering the research execution, which takes the added focus into account and starts its work again. The talk does not evaluate classifier accuracy or establish precisely how much prior research is reused after this signal.
The second follow-up changes the assignment: “Forget about that. Research AI policy.” The coordinator cancels the existing run and starts a new one. Cancellation travels through the call chain, stopping spawned subagents before the controller unwinds. This can give application code an opportunity to roll back, but stopping execution does not by itself reverse external effects that have already completed.
What decides whether a live run is amended or replaced? The comparison below separates the classifier’s semantic choice from Restate’s execution mechanisms.
Routing a follow-up into an active session
Read the diagram as text
- New Slack message. Additional context arrives while research is active.
- Relevance classifier. controller — An LLM decides whether the message belongs to the current task.
- Signal active execution. continue — Injects relevant state through the execution ID.
- Cancel call chain. replace — Stops subagents before unwinding the controller.
- Start replacement run. replace — Begins research for the newly requested topic.
- New Slack message → Relevance classifier: classify.
- Relevance classifier → Signal active execution: still relevant.
- Relevance classifier → Cancel call chain: new direction.
- Cancel call chain → Start replacement run: after unwinding.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The distributed log underneath the programming model
Under the SDK, Restate uses an event-driven distributed log between clients and services. The log persists journal events, while an event loop interprets them. Depending on the event, it may update an embedded state store, set a timer, or send a request to another agent. The same substrate therefore backs recorded function steps, session state, suspension points, and distributed calls.
What turns the journal into actual application behavior? The diagram shows the event loop dispatching persisted events into three different effects rather than treating the log as passive history.
A notable architectural choice is push-based invocation. Van Dongen contrasts it with workflow workers polling a server for new tasks: Restate sends the request directly to the target service, which also fits serverless functions that wake on incoming requests. She reports 45 milliseconds at p99 for a 10-step workflow, but supplies no benchmark setup, workload, or deployment conditions, so the figure should be read as a reported example rather than a general latency guarantee.
The server packages the state store and UI in one binary. A highly available deployment is described as multiple instances snapshotting to object storage, although the talk does not detail replication, coordination, or restoration. Adoption options include six SDKs, integrations with popular agent frameworks, direct use with arbitrary LLM SDKs, open-source self-hosting, deployment into a customer’s cloud account, and a managed cloud. Keeping Restate in the customer account can keep this layer’s data there; external tools and model providers remain separate data paths.
The closing lesson is narrower than “use a workflow engine for every agent.” Persistent agents need recoverable steps, addressable sessions, communication with live work, and a reliable way to stop it. Putting those mechanics beneath the agent loop lets the application evolve—from an inline LLM call to a governed gateway—without rebuilding retries, state management, and control each time.
From journal event to durable effect
Read the diagram as text
- Clients. Submit requests through the Restate layer.
- Distributed log. restate — Persists the journal events produced by executions.
- Event loop. restate — Reads each event and selects the corresponding effect.
- Embedded state store. effects — Receives persistent state updates.
- Durable timer. effects — Represents work that must wait until a later time or event.
- Agent or service request. effects — Dispatches work to another application component.
- Clients → Distributed log: submit work and events.
- Distributed log → Event loop: feeds persisted events.
- Event loop → Embedded state store: persist state.
- Event loop → Durable timer: set timer.
- Event loop → Agent or service request: send request.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Related talks
- Building Durable, Production-Ready Agents with OpenAI SDK and Temporal
A complementary implementation-focused workshop on persisted LLM calls, event-sourced recovery, state management, and exposing durable workflow activities as agent tools.
- Breaking the Chain: Agent Continuations for Resumable AI Workflows
Explores another mechanism for capturing nested agent and tool state so executions can suspend for approval, recover after failure, and resume without keeping loops active.
- Two Roads to Durable Agents: Replay vs. Snapshot — Eric Allam, Co-founder, Trigger.dev
Compares replay-based durability like the journal model discussed here with snapshot-based preservation of complete stateful execution environments.
Transcript & slides
Loading transcript and slides…