Member-only story
What Are Subgraphs in LangGraph?
A subgraph is a complete LangGraph graph that runs as part of another LangGraph graph. The graph that contains and uses the subgraph is called the parent graph.
You build a subgraph the same way you build any other LangGraph graph. You define a state schema, add nodes, connect them with edges, and compile the graph.
The only difference is how it is used. Instead of running it on its own, you use it as a single node inside a parent graph. This lets you reuse the same workflow in one or more parent graphs.
Why Use Subgraphs?
As your LangGraph applications grow, a single graph can become large and difficult to manage. Subgraphs help by breaking a large workflow into smaller, independent parts.
They offer 3 main benefits:
1] Building Multi-Agent Systems
Multi-agent systems are usually not built as one large flow. Each agent can have its own steps, tools, and logic. Using subgraphs lets you keep each agent separate and manage them through a parent graph. This keeps the internal logic of one agent from mixing with the rest of the system.
2] Reusability
Once a subgraph is built and compiled, you can use it in more than one parent graph. That means you…









