Intermediate11 min
LCEL: Advanced Runnables
RunnableParallel, RunnableBranch, RunnableLambda, fallbacks, retry logic, and dynamic routing within LCEL chains.
Quick Reference
- →RunnableParallel runs multiple chains concurrently and merges results
- →RunnableBranch routes input to different chains based on conditions
- →RunnableLambda wraps any function into the Runnable interface
- →.with_fallbacks() adds retry logic with alternative models
- →.with_retry() adds exponential backoff for transient failures
LCEL in LangChain v1
Advanced LCEL is for custom pipelines, not agents
In LangChain v1, agent logic lives in create_agent with middleware — not in LCEL chains. Advanced Runnables (RunnableParallel, RunnableBranch, fallbacks) remain useful for custom data pipelines, RAG chains, and model composition. But if you're building an agent loop, use create_agent or LangGraph instead of chaining Runnables.