Pipe Chaining
The | operator builds a RunnableSequence, as introduced in Runnables and LCEL. Each step's output becomes the next step's input, and the types have to line up — a prompt template's PromptValue output must be something the chat model's invoke accepts, and so on down the chain.
Parallel & Branching
Real chains are rarely a single straight line. RunnableParallel runs several steps against the same input concurrently, RunnablePassthrough threads the original input through unchanged so a later step can still see it, and RunnableBranch picks one path out of several based on a condition.
Config & Fallbacks
Any Runnable can be wrapped with retry and fallback behavior, and any call can carry per-invocation configuration — without changing the chain's shape.
Streaming
stream (sync) and astream (async) yield output incrementally instead of waiting for the whole result. For a chat model alone, that means tokens as they're generated:
Async & Batching
Every Runnable exposes sync and async twins (invoke/ainvoke, batch/abatch, stream/astream, from Runnables and LCEL), plus batch for running many independent inputs efficiently.