Skip to main content
The langgraph-supervisor package is no longer actively maintained. Instead use the subagents pattern: a main agent coordinates specialized workers by calling them as tools. This guide covers how to migrate from create_supervisor to create_agent, including setups that use interrupt and external API callbacks.

Summary of changes

langgraph-supervisorRecommended replacement
create_supervisor with worker agents as graph nodescreate_agent with subagents wrapped as @tool functions
output_mode for message historyFormat subagent output in the tool wrapper (see subagent outputs)
create_handoff_tool for custom routingCustom @tool that calls subagent.invoke(...)
Nested supervisors (create_supervisor of supervisors)A subagent wrapped as a @tool that calls other subagents

Basic migration

With langgraph-supervisor, worker agents were graph nodes and the supervisor routes between them using handoff tools:
Migrate to the subagents pattern by wrapping each worker as a tool on a main agent:
For a full walkthrough, see Build a personal assistant with subagents.

Migrate interrupt and resume flows

A common langgraph-supervisor setup uses interrupt inside a worker agent’s tool to pause execution until an external service completes:
With the subagents pattern, the same flow works. interrupt inside a subagent tool propagates up through tool-wrapped create_agent layers to the outermost graph. Your external callback can still resume with Command(resume=result).

Requirements for interrupt propagation

For interrupt to bubble up through nested create_agent layers, follow these rules:
  1. Compile only the outermost graph with a checkpointer. Leave subagents without checkpointer=... so they use per-invocation persistence and inherit the parent’s checkpointer at runtime.
  2. Pass thread_id in configurable. The outer invoke() or stream_events() call must include a thread_id so the graph can checkpoint and resume.
These rules apply to arbitrarily nested setups. For example, a custom StateGraph outer layer, a middle create_agent supervisor, and an inner create_agent subagent all follow the same mechanism:
When preview_tool calls interrupt, the exception bubbles through both create_agent layers and surfaces as __interrupt__ on the outer StateGraph’s invoke result. Your existing Command(resume=result) callback path keeps working. For more on how interrupts propagate through subgraphs, see Subgraph persistence: Interrupts and Checkpointing and state inspection.

When to use a custom StateGraph instead

Use a custom StateGraph when you need to mix deterministic steps with agentic ones. For example, fixed routing, validation, or external API calls alongside create_agent nodes.

Migrate nested supervisors

langgraph-supervisor supports multi-level hierarchies by compiling supervisors and passing them to another create_supervisor call. With the subagents pattern, you have two options:
  1. Flatten to a single supervisor with one tool per leaf agent. This is the simplest approach when each worker is independent.
  2. Nest tool calls when you need intermediate coordination. Wrap a middle-tier agent (itself a create_agent with its own subagent tools) as a tool on the top-level supervisor.
If you need static subgraph discovery, checkpoint namespaces per tier, or shared state keys between levels, use a custom StateGraph with subgraph nodes instead.

Migrate message history options

create_supervisor exposes output_mode to control how worker messages appear in conversation history:
  • full_history: Include all messages from the worker agent.
  • last_message: Include only the worker’s final response.
With the subagents pattern, control this in the tool wrapper. Return only the final message for last_message behavior, or return a formatted summary of the full conversation for full_history behavior. See Subagent outputs for patterns that pass additional state back to the supervisor.

See also