How do LlamaIndex Workflows differ from LangChain LCEL?
LlamaIndex Workflows and LangChain LCEL both let you compose multi-step LLM pipelines. Describe the core abstraction each one uses and call out the one structural capability LlamaIndex Workflows have that LCEL does not.
LCEL pipes Runnables in a DAG; LlamaIndex Workflows dispatches events to step handlers and supports cycles natively, so agent loops do not need a separate library like LangGraph.
Picture two ways to build a pinball machine. The first uses ramps and gates set up in a fixed path. The ball goes in one end, rolls through the gates in order, and comes out the other end. You cannot send the ball back to an earlier ramp without adding new physical hardware. The second uses lights and sensors: the ball can trigger any sensor at any time, and each sensor can light up other sensors anywhere on the board. The ball can revisit the same ramp over and over because the wiring is logical, not physical. LCEL is the first machine; Workflows is the second.
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.
LCEL and LlamaIndex Workflows look similar from far away, both are composition layers for LLM pipelines, and very different up close. Knowing where the difference lies is what makes the choice between them coherent rather than tribal.
This deep dive walks through each framework's primitive, explains why the structural difference forces cycles into a separate library on the LangChain side, and lays out the tradeoffs that decide which bundling style fits which team.
LCEL: typed function composition with a pipe operator
LCEL is the composition layer of LangChain. The abstraction is Runnable: a class with .invoke, .batch, .stream, and their async variants. Anything that satisfies the Runnable interface composes with the pipe operator.
What a Runnable pipe looks like
A simple chain is chain = prompt | model | parser. The pipe operator stitches the right operand's input type to the left operand's output type. The runtime walks this chain when you call chain.invoke(input), passing the output of each step into the next.
Composition primitives
LCEL provides several Runnable variants for non-linear shapes:
- RunnableSequence. What
|produces under the hood. - RunnableParallel. Runs several Runnables on the same input and returns a dict of outputs.
- RunnableBranch. Picks one of several Runnables based on a predicate on the input.
- RunnableLambda. Wraps a plain function so it satisfies the Runnable interface.
- RunnablePassthrough. Passes the input through, often used in RAG to combine retrieval output with the original query.
Why it is structurally a DAG
Every composition primitive produces a graph where every node has well-defined upstreams and downstreams. There is no syntax for a later Runnable to feed an earlier one. The runtime walks the composition from input to output and never revisits a node.
This is a deliberate design choice. DAGs are easy to reason about, easy to type-check, easy to optimize for parallelism. The cost is that anything that requires a cycle, agent loops, retries, HITL pauses, cannot be expressed in LCEL alone.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
| Axis | LCEL (LangChain) | Workflows (LlamaIndex) |
|---|---|---|
| Primitive | Runnable + pipe operator | @step methods + events |
| Composition shape | DAG, left to right | Event dispatch, any topology |
| Cycles | Not supported in pure LCEL | Native |
| Branching | RunnableBranch | Step emits different event types |
| Parallelism | RunnableParallel | Multiple steps consume same event |
| Cycle-capable cousin | LangGraph (separate library) | Built in |
Real products, models, and research that use this idea.
- LlamaIndex 0.13 ships Workflows as the recommended orchestration layer for agent-style pipelines.
- LangGraph 1.x is LangChain's separate library for cycle-capable orchestration, layered on top of LCEL.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you express a supervisor-worker pattern in Workflows?
Define a SupervisorStep that consumes a TaskEvent and emits one WorkerTaskEvent per worker; multiple WorkerSteps consume WorkerTaskEvent and emit WorkerResultEvent; an AggregateStep collects WorkerResultEvent and emits FinalEvent; the cycle returns to SupervisorStep if it needs 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.
Trying to express an agent loop in pure LCEL and getting stuck because the DAG cannot revisit earlier steps without graduating to LangGraph.
60 second bullets to scan on the way to the call.
The composition primitive each framework uses
Why LCEL is structurally a DAG
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.