← Blog

LangGraph Multi Agent Orchestration: When a Graph Wins

9 min read

Key takeaways

  • LangGraph's graph-based orchestration fits coding agents because routing, retries, and review gates live in explicit nodes and conditional edges rather than in persona handoffs.
  • CrewAI suits exploratory, single-repo role-based work; LangGraph suits parallel fleets where a wrong routing decision burns hours of tokens.
  • Claude Code and Codex built-ins cover single-repo runs, but past roughly ten parallel agents coordination, not model quality, becomes the bottleneck.
  • A realistic benchmark is about $8 per merge request at API prices, based on a team running thirty Claude Code and Codex sessions on their own servers.
  • Wire review gates as interrupt nodes placed after the coding agent and before the merge request, with acceptance criteria stored as graph state.

For a small team running parallel coding agents across repos, LangGraph multi-agent orchestration wins when you need explicit state tracking, retries, and review gates wired into the flow itself; CrewAI fits simpler role-based delegation, and Claude Code or Codex built-ins cover single-repo runs. This guide scores each against parallel-run state, review-gate wiring, and cost per run, then gives you a recommendation matrix.

When does LangGraph's graph-based orchestration beat role-based frameworks like CrewAI for coding agents?

Coding work rewards explicit graphs. A graph makes the routing decision part of your codebase: which agent picks up the task, what happens on failure, where a human approval prompt sits. CrewAI's role-based model instead asks you to describe agents as personas and let the framework negotiate handoffs between them.

LangGraph's docs frame this directly: you define nodes, conditional edges, and a shared state object, with built-in interrupts for human checkpoints and persistence for state tracking across retries. That maps cleanly onto how coding agents actually fail. An agent that has spent three hours fixing the wrong thing is not a persona problem; it is a routing problem. The task went to the wrong node, or the acceptance criteria were not checked before a merge request was opened.

A graph lets you add a verification node between "agent claims done" and "merge request created", and a retry edge back to the planner when the diff misses the criteria. The same structure is what keeps a fleet of parallel agents from overwriting each other's work across repos: state tracking tells you which worktree is owned by which run, and conditional edges decide whether the next task waits or forks. The coordination cost you feel daily in terminal tabs is mostly missing routing, and a graph is where routing lives.

Where CrewAI's role-based model fits better is exploratory, single-repo work with no hard gates: a researcher agent and a writer agent trading drafts until the output reads well. If your failure mode is "the draft was mediocre" rather than "the agent edited the wrong files in three repos", roles are cheaper to set up than graphs. If you are paying per merge request at API prices, the graph pays for itself; our breakdown of what a coding agent really costs covers where token budget actually goes in parallel runs.

What do LangGraph and CrewAI actually differ on when orchestrating coding agents?

Both frameworks can run parallel agents. They diverge on the three things that decide whether your fleet ships code or burns tokens: state tracking, review gates, and cost control.

State tracking and parallel runs

LangGraph gives you explicit state: a shared graph with typed state objects, checkpoints, and per-node retries. That maps well onto git worktrees, where each agent owns a branch and the orchestrator owns the merge. CrewAI models the same problem as roles and tasks, so state lives in the task handoffs. Fine for three agents, leaky for ten across multiple repos. If your fleet writes cross-repo changes, state discipline is the whole game, which we cover in multi-repo changes with coding agents.

Review gates and human checkpoints

In LangGraph, a checkpoint is a node: you interrupt the graph, wait for approval, resume. Deterministic and testable. CrewAI's human-input flag exists but sits at the task level, so gating a merge request mid-flow takes custom code either way.

Cost per run and token budget control

CriterionLangGraphCrewAIAerunit
State modelExplicit graph stateTask handoffsPer-agent run state
Parallel runsFan-out nodesCrew-level parallelismFleet-level, per worktree
Review gatesInterrupt-and-resume nodesHuman-input flagApproval prompts per merge request
Token budgetPer-node meteringManualTracked per agent run

The honest caveat: LangGraph's explicitness costs you setup time, and Aerunit assumes your agents are already Claude Code or Codex sessions rather than framework-internal nodes.

When should you skip a framework and use Claude Code or Codex's built-in multi-agent orchestration?

If your agents run inside one repo per task, and a human reviews every merge request anyway, Claude Code and Codex already ship the primitives you need: subagents for parallel work, hooks for approval prompts, and session state per run. A framework earns its keep when you need explicit graphs, retries, or cross-repo task distribution. Before you reach for one, note that role-based frameworks like CrewAI are built around named agents delegating tasks to each other, which is a poor fit if your "roles" are just the same model with different prompts.

Claude Code and Codex: subagents, hooks, and their limits

Subagents and hooks cover the happy path: spawn a worker, gate the merge, retry on failure. They do not give you fleet-level state tracking across ten sessions, token budgets per agent, or acceptance criteria enforced before a merge request opens. That gap is where teams start shopping for an orchestrator.

The terminal-tab problem at ten-plus parallel agents

Past roughly ten parallel agents, the bottleneck is coordination, not model quality. One agent waits on an answer while another burns three hours fixing the wrong thing, and your terminal tabs do not tell you which is which. That is the point where a dedicated orchestration layer, such as Aerunit's approach to keeping coding agents on target, beats raw CLI sessions: task distribution, state tracking, and review gates in one place instead of in your head.

How do IDE-native options like Cline and VS Code agents handle multi-agent orchestration?

Cline and kanban-style task distribution

Cline lives in your editor and runs one agent per task, driven by you. That works well for a single worktree, but it has no daemon watching ten parallel sessions, no state tracking across merge requests, and no way to see which agent has been waiting for an answer for an hour. Kanban-style tools like Vibe Kanban add task distribution and a board view, which fixes visibility, but review gates and retries still route through a human.

VS Code multi agent orchestration: what the editor gives you

VS Code gives you per-repo agent sessions, approval prompts, and git integration, all close to where you review diffs. What it does not give you is cross-repo coordination: shared acceptance criteria, token budget tracking across a fleet, or automatic task distribution when an agent finishes early.

The honest test: if your fleet is three agents in one repo, IDE-native is enough. At ten agents across five repos, you need an orchestrator layer above the editor. That is the gap Aerunit targets, and we track our own thinking on it on the Aerunit blog.

How do you wire review gates and human checkpoints into a LangGraph multi-agent workflow?

The pattern is an interrupt node: the graph pauses, serializes its state, and waits for a human decision before the next agent step runs. In LangGraph you mark a node with interrupt_before, the run halts, and you inspect the pending state — the diff, the agent's reasoning, the token spend so far — then resume or redirect. That maps directly onto approval prompts: the orchestrator blocks the merge-request path until someone approves.

Interrupt nodes and approval prompts

Put the gate after the coding agent and before the commit or MR step, not at the end of the whole graph. One gate per risky transition (writing to a shared repo, bumping dependencies) beats one giant approval at the end, where a wrong turn has already burned three hours of tokens. The Anthropic Claude Code documentation describes the same shape with hooks: deterministic checks that run before an agent action is allowed to proceed.

Acceptance criteria as graph state

Store acceptance criteria as fields in the graph state, written when you create the task. A reviewer node checks each criterion and returns pass or fail; fail routes back to the coding agent with the failing criterion attached, not a vague "fix it." Ticksly's team, running up to thirty Claude Code and Codex sessions, describes the same split: humans provide tasks and direction, agents do the doing. Aerunit applies this at the fleet level: reviewing agent pull requests with criteria attached, so one person can gate ten parallel runs without reading ten terminals.

What does running multiple orchestrated coding agents really cost in tokens and compute?

The $8-per-merge-request baseline

The clearest public number comes from the Ticksly team, who run up to thirty Claude Code and Codex sessions on their own servers and pay roughly $8 per merge request at API prices, with the three of them supplying tasks and direction (their write-up). That is the honest unit cost to benchmark against: not a seat fee, but dollars per accepted merge. Model choice moves it more than orchestration choice does, since frontier-model token pricing is published per million tokens, so a fleet's monthly bill is roughly merges × $8, plus the overhead your orchestrator adds.

Where token budgets leak: retries, duplicated work, agents fixing the wrong thing

Three leaks dominate. Retries multiply the cost of every failed run. Parallel agents on the same repo duplicate work or overwrite each other, burning tokens arguing about who is right. And an agent that spends three hours fixing the wrong thing is pure loss. An orchestrator that enforces acceptance criteria and state tracking pays for itself the first time it prevents one wrong-direction run.

Which orchestration framework fits a small team shipping cross-repo changes with parallel agents?

Decision matrix: build with LangGraph, adopt CrewAI, or use a purpose-built orchestrator

If you have one or two repos and a single agent per task, skip the orchestrator. Claude Code or Codex with git worktrees covers it, and Cursor Cloud Agents plus Linear handles the queue.

Build with LangGraph when your routing logic is genuinely custom: agents that hand off mid-task, retries conditioned on test output, state tracking that no tool models the way you need. Budget engineering time to maintain it. CrewAI fits when your workflow maps cleanly to roles and you want something running today, not a graph you own.

If your bottleneck is coordination, not graph logic, a purpose-built orchestrator wins. Teams like Ticksly run up to thirty Claude Code and Codex sessions with three people providing tasks and direction, and they feel the cost of tracking which agent is waiting, which went sideways, and which is burning token budget on the wrong fix.

How Aerunit scores against the same criteria

Aerunit is built for that case: task distribution across a multi-repo fleet, state tracking, and approval prompts so agents stop when they should. Where it does not compete with LangGraph is custom graph logic; it is not a framework you program, it is an orchestrator you run. If your team is 2-10 people paying for Cursor Cloud Agents and Linear and losing track of terminal tabs, that trade is the point.

FAQ

Is LangGraph overkill for a solo developer chaining two or three agent sessions?

Usually, yes. With two or three sessions in one repo, Claude Code or Codex built-ins plus git worktrees cover routing, retries, and approval. LangGraph earns its keep when you need conditional edges, persistent state across failures, or gates wired into the flow itself, especially when your failure mode is an agent editing the wrong files.

Can LangGraph orchestrate Claude Code and Codex as the worker agents?

Yes. LangGraph is framework-agnostic about what runs inside a node: each node can shell out to a Claude Code or Codex session, parse the diff, and route based on the result. You supply the wrapper code that invokes the CLI, checks output, and updates graph state, while the graph handles routing, checkpoints, and retries.

What is hermes agent orchestration and how does it compare?

We do not have a verified source on "hermes agent orchestration," so we will not invent one. As a general pattern, most orchestrators differ on three axes: explicit state tracking, review-gate placement, and per-run token metering. Score any candidate against those three before comparing setup cost.

How many parallel coding agents can one person supervise before quality drops?

Somewhere below ten. Past roughly ten parallel agents, coordination becomes the bottleneck: one agent waits on an answer while another burns hours fixing the wrong thing, and terminal tabs stop telling you which is which. Teams running thirty sessions report needing dedicated tooling for task distribution and state tracking.

Aerunit

Keep the agents busy. You do the thinking.

Sign-up is open — create an account and start with pay-as-you-go credits. No subscriptions, and teams share one credit pool at no extra cost.

Create account