AI Engineer World's Fair 2025
Breaking the Chain: Agent Continuations for Resumable AI Workflows
Loading slides…
Read the talk
Breaking the Chain: Agent Continuations for Resumable AI Workflows
An agent should be able to stop for approval without keeping its execution loop alive. Recursive continuations preserve the state needed to resume both the agent and its sub-agents.
From a talk by Greg Benson
Before you start: Familiarity with Python functions, JSON, and LLM tool calling will help you follow the continuation interface and nested-agent example.
What happens when a working agent has to wait?
Your agent works well. Now you want to put it into production: can it stop for a human decision, and can a long-running task survive a failure without losing everything it has done? These are the opening questions behind Agent Continuations, the mechanism Greg Benson introduces as a University of San Francisco computer science professor and SnapLogic chief scientist. The approach captures agent state so execution can resume later, supporting both human intervention and snapshots for recovery.
The work comes from SnapLogic’s Agent Creator research group. Consider an agent about to transfer a large amount of money or delete an account. It needs to hand the decision to a human before performing the consequential action. Separately, a long-running agent needs checkpoints so a failure does not force it to restart from the beginning. Moving those agents from a developer’s desktop into a distributed environment adds another requirement: execution must be able to outlive the particular process hosting it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The loop that must survive interruption
An agent alternates between model inference and tool execution. It sends the LLM a request describing available tools; the model may return tool-call requests; the agent executes those calls, collects their results, and sends the results back to the model. That cycle continues until the task is complete. A tool can itself be an agent, so even an apparently simple request can involve several interacting loops.
Three situations make uninterrupted execution an awkward assumption:
- Human approval: A tool may require permission to access an environment or to perform a consequential action within it.
- Rate limiting: Benson points to coding assistants encountering heavily used new models. The workflow needs a way to handle an API that cannot accept more work immediately.
- Long-running work: Extensive research across internal and external systems increases exposure to network or hardware failures. Preserving progress becomes more valuable as the work accumulates.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A paused sub-agent can hold up an entire hierarchy
A main agent or orchestrator may call several sub-agents, each of which can call further sub-agents. Approval and recovery must therefore account for more than the innermost tool. If a deeply nested operation pauses, the system must preserve the parent agents’ progress and the calls through which they are waiting for that operation to return.
Benson calls the hosting problem agent loop persistence. The loop is code running on a physical machine, whether on a desktop or in the cloud. It connects an interface—a command line, a web application, or a channel such as Slack—to the model, tools, and sub-agents.
Benson describes continuously running loops during human approval waits as common among the frameworks his team examined. That characterization should not be read as a requirement of agent frameworks generally. The design target here is precise: shut down every affected loop after suspension, then reconstruct execution when the human responds. A Slack approval should not require keeping the original agent process alive for the duration of the wait.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The messages array already holds much of the state
The inspiration comes from programming-language continuations: capture execution at a particular point, retain what is needed to continue, and resume later. Supporting that operation in a general programming language can require sophisticated runtime machinery. Agent continuations apply the idea to a narrower execution model built around LLM calls, tool calls, and calls into sub-agents.
When the agent suspends, it returns saved state to the application layer. The application can obtain approval or persist the state for later resumption. Here, suspension means stopping at supported execution boundaries, such as before an approval-gated tool; it does not mean preempting arbitrary instructions inside an executing tool or an in-flight model request.
The useful observation is that an agent already maintains a messages array. This is a history of interactions that is supplied back to the LLM for its next inference. The system therefore already performs much of the bookkeeping a continuation needs: previous requests, tool interactions, and results are retained as conversation state. The messages array is close to sufficient, but it does not by itself identify all the control state needed to resume a suspended operation.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A request can return work that is not finished
The Agent Continuations prototype starts with a familiar Python interface. Decorators identify Python functions as tools, and the agent receives a list of those tools at construction. It can also receive instructions or a system prompt. An application submits a user request, and the agent performs its model-and-tool loop before returning a response.
Continuation support changes two pieces of that setup: designate a tool as requiring approval, and construct a ContinuationAgent. The important change is in the result contract.
| Result | Meaning | Application action |
|---|---|---|
| Completed response | The agent finished its task | Present or consume the result |
| Continuation object | Execution suspended | Inspect the suspension metadata |
A returned object is therefore not necessarily the final answer. Its metadata tells the application why execution stopped and what intervention is required.
For the approval path, the application records the human’s decision as true or false. Benson follows the positive branch: update the continuation with approval, then pass that same object back through request. The agent recognizes the continuation and resumes immediately before the pending tool call. Approval changes permission to execute; the resumed agent still has to perform the tool call and continue toward its final response.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Capture recursive state, expose a simple approval surface
Forward execution remains ordinary agent processing until a suspension condition occurs. The framework then creates a continuation containing the messages array and additional resumption metadata. As that object returns to the top-level agent, the framework extracts the information the application needs to understand the suspension and supply any required approvals. The application does not have to navigate the whole nested execution structure to find the decision it must present.
After the application updates the object, the framework reconstructs the agent state and continues execution. The saved continuation replaces the need to keep the suspended loops running. Once capture is complete, the loops can shut down because the object contains the information needed to restore them.
The single-level representation separates interaction history from the pending operation and the application’s decision:
| Field | Role |
|---|---|
messages | Normal interaction history |
resume_request | Identifies the operation at which to resume |
processed | Carries processed information, including approval decisions |
approval_info | Exposes approval information to the application |
The top-level approval surface makes updating the object convenient without discarding the underlying execution structure.
For nested agents, a resume_request can contain a sub-agent continuation with its own messages, resume_request, and processed information. The representation is recursive: each level preserves its local history and the child operation it must resume. This is how the format accommodates arbitrary layers of sub-agent nesting rather than treating the entire workflow as one flat conversation.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
An HR agent pauses inside account authorization
The worked example has two agent levels. The top-level HR agent has an email tool and an account-agent tool. The account sub-agent handles account creation and privilege assignment through its own create-account and authorize-account tools. Authorization requires approval. Each agent has its own system prompt and tool configuration.
A new-account request enters through the HR agent and eventually reaches the account sub-agent’s authorization tool. The suspension travels back through the same hierarchy:
- The account agent reaches the pending authorization and detects that approval is required.
- It captures a continuation before authorization executes.
- As that continuation propagates upward, the parent level expands it with the state needed to resume the HR agent.
- The application receives the full continuation and inspects the approval information.
Once the application has supplied the decision, it sends the continuation back to the HR agent. The framework restores both the parent and the account sub-agent to the suspended point. The application’s job is to resolve the approval; reconstructing the nested execution is the framework’s job.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resume from an edited response file
The demonstration makes the process boundary concrete. Benson supplies the initial prompt as JSON, runs the agent, and writes its response to a file. The point of this arrangement is that the request and its later continuation are decoupled: the saved object must carry the state needed by the later invocation. A small Python file boundary around an already configured agent expresses that handoff:
python
import json
from pathlib import Path
def request_from_file(agent, input_path: Path, output_path: Path):
request = json.loads(input_path.read_text(encoding="utf-8"))
response = agent.request(request)
output_path.write_text(
json.dumps(response, indent=2),
encoding="utf-8",
)
return response
The same function can accept the initial JSON request or the saved continuation because both enter through request.
Inspecting the saved response reveals the top-level continuation and messages, followed by the sub-agent’s messages and system prompt. At the bottom is the application-facing approval information. Benson edits that approval manually, saves the file, and submits the edited response back to the agent. In an application, a review interface would collect the decision and make this update. The resumed invocation reconstructs state with the pending tool now approved.
The resulting output reports successful account creation and a granted security level. The displayed JSON names Alice, shows security level 0, includes a welcome-email confirmation, and ends with end_reason set to completed. These are the workflow’s reported results after resumption.
The completed result also illustrates a useful property of the representation: it contains a normal messages array, with no continuation structure remaining. The continuation is introduced when execution suspends; it is not a permanent wrapper around every finished response.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Beyond human approval
Benson describes the Python prototype as built on the OpenAI Python API with no other dependencies, and makes the implementation available on GitHub. He also reports an implemented version with more general suspension triggers: elapsed time, a number of turns, and asynchronous requests to suspend. Those triggers broaden the reasons to stop while retaining the same capture-and-resume model.
The proposed direction is to bring the mechanism into existing frameworks, such as Strands or Pydantic AI, rather than necessarily grow the prototype into another complete agent framework. These are prospective integrations in the talk, not announced integrations.
Benson explicitly acknowledges that other frameworks already manage state. In his team’s investigation, the missing piece was either human approval or support for arbitrary depths of sub-agent nesting. His novelty claim concerns combining those capabilities: approval can occur inside a nested agent, while the continuation preserves the surrounding execution needed to return there.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The same mechanism in a visual agent builder
The work also exists above the Python layer. SnapLogic’s Agent Creator provides visual agent construction and a way to visualize agent execution. The team prototyped continuations there as well, applying the mechanism both in Python and within the higher-level SnapLogic platform.
Benson closes by pointing readers to the public prototype and to Agent Creator for visual agent building. The concrete capability connecting those implementations is saved, resumable execution: an application can receive the state of a suspended agent hierarchy, obtain the human decision, and return that state so the workflow can continue.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Python prototype with installation instructions, approval-gated tools, suspension predicates, and account and HR agent examples.
Further reading
- How recursive continuations are reconstructedDocumentation
Implementation walkthrough covering nested continuation objects, flattened approval metadata, and parent/sub-agent resumption.
A 2024 explanation of checkpoint-backed approval pauses and resumption, including interrupted-node replay behavior.
Updates since the talk
Current examples of human input, tool interrupts, and persisted multi-agent interruption.
Current guidance for approval-required tools and resuming deferred work using message history and tool results.
Full transcript
Loading transcript…