A runnable is a LangChain.js unit of work that accepts input, processes it, and produces output. It can be invoked, batched, or streamed. Connect runnables when an AI workflow needs several steps rather than one model call. section 6.1.1
LangChain Expression Language (LCEL) composes runnables in three useful ways:
- RunnableSequence passes each output to the next runnable. section 6.5.1
- RunnableParallel gives multiple runnables the same input and collects their outputs in a keyed object. section 6.5.1
- RunnableLambda wraps a JavaScript function so custom processing can join a chain. section 6.5.1
From input text to a model response
Wrap an uppercase function and a vowel-counting function with RunnableLambda, then place them before a ChatPromptTemplate, ChatOpenAI model, and StringOutputParser. The first function reads the input text; the second produces vowelCount for the prompt. One demonstrated run returns `3 3`. The same ordered components can be assembled with RunnableSequence.from([...]). Model-backed runs require a provider API key. section 6.1.1
An LCEL chain is itself a runnable, so it can be composed into a larger workflow. Agents also fit into chain compositions as Runnable instances. This shared interface helps keep surrounding application code intact when implementation details change, including in a Vercel AI SDK integration. section 6.5.1 section 6.4.3

