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.

Slide titled “Challenges with Agents in Practice” with three illustrated boxes labeled Human in the Loop, Long Running, and Distributed Execution.Open full source frame
Three challenges with agents: human oversight, long-running work, and distributed execution.
0:000:10
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:00 · section reference included

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.
2:533:01
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:53 · section reference included

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.

Agent Loop Persistence diagram with CLI, WebApp, and 3rd Party (Slack) on the left, Agent (Loop) in the center, and LLM, Tool 1, Tool 2, and Sub Agent on the right, joined by bidirectional arrows.Open full source frame
The agent loop connects user interfaces to an LLM, tools, and a sub-agent.

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.

6:016:23
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:01 · section reference included

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.

8:088:33
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

8:08 · section reference included

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.

ResultMeaningApplication action
Completed responseThe agent finished its taskPresent or consume the result
Continuation objectExecution suspendedInspect 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.

11:2211:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

11:22 · section reference included

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:

FieldRole
messagesNormal interaction history
resume_requestIdentifies the operation at which to resume
processedCarries processed information, including approval decisions
approval_infoExposes 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.

Continuation Object Examples slide comparing single-level and nested structures, with messages, resume_request, processed, and approval_info fields highlighted and annotated.Open full source frame
Single-level and nested continuation objects shown side by side.
14:4315:04
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

14:43 · section reference included

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:

  1. The account agent reaches the pending authorization and detects that approval is required.
  2. It captures a continuation before authorization executes.
  3. As that continuation propagates upward, the parent level expands it with the state needed to resume the HR agent.
  4. 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.

18:4619:07
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

18:46 · section reference included

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.

JSON output showing an account creation result for Alice, security level 0, a welcome-email confirmation, and an underlined end_reason value of completed.Open full source frame
The demo output reports successful account creation and an end reason of completed.

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.

21:4621:56
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

21:46 · section reference included

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.

24:1324:26
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

24:13 · section reference included

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.

25:4826:11
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

25:48 · section reference included

Resources

From the talk

Updates since the talk

Transcript download
Full transcript

Loading transcript…