When does a LangGraph conditional-edge router beat LangChain `RouterRunnable`?
Both `RouterRunnable` (LangChain LCEL) and a conditional-edge router (LangGraph) let you pick which downstream chain runs based on the input. When should you reach for the LangGraph version instead of the LCEL one?
RouterRunnable is for one-shot routing inside a DAG; LangGraph wins when routing repeats in a loop, branches share state, or runs need checkpointing.
Picture a phone tree at a clinic. RouterRunnable is the menu you hear once when you call. 'press 1 for billing, 2 for appointments, 3 for records'. You press, get sent to one department, they handle it, the call ends. One decision, one path. LangGraph routing is the back office where staff hand a chart between desks several times in the same visit. The triage nurse sends you to radiology, who sends you back to the doctor with the X-ray, who sends you to the pharmacy. Many decisions, shared chart, sometimes the doctor pauses for a senior consult before continuing. Use the phone tree for single-decision flows; use the back-office model when the chart keeps moving.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: DAG vs graph topology, where RouterRunnable wins, the four LangGraph capabilities, and the heuristic for picking between them.
| Capability | RouterRunnable (LCEL) | LangGraph conditional edges |
|---|---|---|
| Workflow shape | DAG, no cycles | Graph with cycles |
| Routing decisions per run | One | Many (after each node) |
| Shared state across branches | Pass outputs forward | Typed State with reducers |
| Checkpointing | Not native | Built into runtime |
| HITL interrupts | Not native | interrupt_before / after any node |
| Parallel fan-out + merge | RunnableParallel (static) | Super-step + reducer (dynamic) |
| Best fit | One-shot classify and dispatch | Agent loops, multi-step routing, HITL |
Real products, models, and research that use this idea.
- LangChain's own templates use RouterRunnable for 'pick the right RAG chain' flows and LangGraph for 'tool-using agent' flows.
- Replit's coding agent uses LangGraph because the routing decision repeats after every tool call and needs checkpointing for HITL approval.
- Klarna's customer-support classifier uses LCEL RouterRunnable to dispatch to one of several response chains in a feed-forward pipeline.
- LangGraph Studio visualises conditional edges as routing arrows with the predicate inline; the same flow in pure LCEL is invisible inside a RunnableLambda.
What an interviewer would ask next. Try answering before peeking at the approach.
QCould you implement a LangGraph-style loop using only LCEL?
QHow does LangGraph's State + reducers compare to a Redux store?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Using RouterRunnable for an agent loop and discovering halfway through that LCEL cannot cycle. Forcing a rewrite into LangGraph after the codebase is committed.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.