LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraphindexcreateGraphRunStream
Function●Since v0.3

createGraphRunStream

Creates a GraphRunStream with built-in transformers and kicks off the background pump that feeds raw stream chunks through the transformer pipeline.

Built-in transformers are registered in this order:

  1. subgraph discovery — materializes SubgraphRunStream handles for each newly observed top-level namespace and announces them on the mux _discoveries log.
  2. lifecycle — synthesizes lifecycle channel events.
  3. values — powers run.values / run.output.
  4. messages — powers run.messages / .messagesFrom.

Subgraph discovery is registered first so that downstream transformers (notably lifecycle) observe child namespaces with their stream handles already in place. User-supplied transformer factories are registered afterwards.

Copy
createGraphRunStream<
  TValues = Record<string, unknown>,
  TTransformers extends readonly () =
> StreamTransformer<any>[] = []>(
  source: AsyncIterable<StreamChunk>,
  transformers: TTransformers = ...,
  optionsOrAbortController: AbortController | CreateGraphRunStreamOptions
): GraphRunStream<TValues, InferExtensions<TTransformers>>

Parameters

NameTypeDescription
source*AsyncIterable<StreamChunk>

Raw async iterable from graph.stream(…, { subgraphs: true }).

transformersTTransformers
Default:...

User-supplied transformer factories.

optionsOrAbortControllerAbortController | CreateGraphRunStreamOptions

Either a full CreateGraphRunStreamOptions object or (for backward compatibility) a bare AbortController.

View source on GitHub