create_supervisor is a wiring shortcut for the supervisor and workers shape, with a pre-baked routing prompt; under the hood it is the same StateGraph you would write by hand.
Think of it like the meal-kit version of a recipe. The full recipe is in the cookbook, with every step from raw ingredients up. The meal kit hands you pre-measured ingredients and a one-page card that says 'mix, cook, serve'. You can still cook the full recipe from scratch any time you want something the kit does not cover. create_supervisor is the meal kit for the supervisor plus workers shape: it pre-measures the nodes, the routing prompt, and the edges so you do not type them by hand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Prebuilts in LangGraph are deliberately small. They package the most common topologies as one-call constructors so you do not have to rewrite the same wiring on every project. create_supervisor is the canonical example: it covers the supervisor and workers shape, which is probably 60 to 70 percent of multi-agent code in the wild.
Knowing what the prebuilt does and what it does not is a tidy way to demonstrate fluency with the underlying StateGraph model. If you can articulate the exact nodes and edges it generates, you can also write the same topology by hand the moment the prebuilt stops fitting.
Mental model: the prebuilt is wiring sugar plus a routing-prompt template. Under the hood it is a normal compiled graph with all of LangGraph's persistence and interrupt features intact.
What the prebuilt actually wires
The shape it generates
Given a list of worker agents and a supervisor model, create_supervisor builds:
- A
StateGraphover a state schema with at minimum amessageschannel and anextchannel for routing. - One node per worker. The node body is the worker's agent loop (model call plus tool execution), wrapped so its output appends to
messagesand the control returns to the graph. - A supervisor node whose body runs an LLM call with the routing prompt against
messagesplus the agent roster, parses the model's output into one of{worker_1, ..., worker_N, FINISH}, and writes the result to thenextchannel. - A conditional edge from supervisor keyed on
next, mapping each worker name to that worker's node andFINISHto the graph's terminal node. - An unconditional edge from each worker node back to supervisor.
Compile it (optionally with a checkpointer and interrupt_before list) and you have a runnable graph.
Why this is a non-trivial chunk of code by hand
The conditional-edge mapping has to enumerate every worker name. The routing prompt has to list them, instruct the model on output format, and enforce that the response is one of the listed names. The state schema needs both a message channel with the right reducer and a routing channel. Getting any of these subtly wrong silently breaks routing. The prebuilt encodes the conventions so you do not.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
from langgraph_supervisor import create_supervisor
from langgraph.checkpoint.memory import MemorySaver
from langchain_anthropic import ChatAnthropic
model = ChatAnthropic(model="claude-sonnet-4-5")
researcher = ... # any LangGraph-compatible agent
writer = ... # any LangGraph-compatible agent
app = create_supervisor(
agents=[researcher, writer],
model=model,
prompt="Route work between researcher and writer. Reply FINISH when done.",
).compile(checkpointer=MemorySaver())
# Behaves like any other compiled LangGraph: streaming, thread_id, interrupts.Real products, models, and research that use this idea.
- LangGraph's official multi-agent tutorial uses create_supervisor for the canonical research and write team.
- LangChain's `langgraph-supervisor` package extracts the prebuilt for stand-alone use across LangChain agents.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you implement parallel fan-out across workers if the prebuilt is sequential?
Drop to raw StateGraph. Use the Send API to dispatch from the supervisor to N workers in one tick, give the state a list-reducer on messages, and add a synthesiser node that consumes the merged list. The supervisor then routes to the synthesiser or to another round.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Treating create_supervisor as a different runtime. It is not; it produces a regular compiled StateGraph that you can inspect, extend, and checkpoint like any other.
60 second bullets to scan on the way to the call.
What nodes and edges the prebuilt sets up under the hood
Why the pre-baked routing prompt is the highest-leverage piece
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.