-
Stream graph state—get state updates / values with
updatesandvaluesmodes. - Stream subgraph outputs—include outputs from both the parent graph and any nested subgraphs.
- Stream LLM tokens—capture token streams from anywhere: inside nodes, subgraphs, or tools.
- Stream custom data—send custom updates or progress signals directly from tool functions.
-
Use multiple streaming modes—choose from
values(full state),updates(state deltas),messages(LLM tokens + metadata),custom(arbitrary user data),checkpoints,tasks, ordebug(detailed traces). -
Use v2 streaming format—opt into a unified, type-safe streaming format with
version="v2"(requires LangGraph >= 1.1).
Supported stream modes
Pass one or more of the following stream modes as a list to thestream or astream methods:
Basic usage example
LangGraph graphs expose thestream (sync) and astream (async) methods to yield streamed outputs as iterators.
Extended example: streaming updates
Extended example: streaming updates
Stream multiple modes
You can pass a list as thestream_mode parameter to stream multiple modes at once.
With version="v2", every chunk is a StreamPart dict. Use chunk["type"] to distinguish between modes:
Stream graph state
Use the stream modesupdates and values to stream the state of the graph as it executes.
updatesstreams the updates to the state after each step of the graph.valuesstreams the full value of the state after each step of the graph.
- updates
- values
Use this to stream only the state updates returned by the nodes after each step. The streamed outputs include the name of the node as well as the update.
Stream subgraph outputs
To include outputs from subgraphs in the streamed outputs, you can setsubgraphs=True in the .stream() method of the parent graph. This will stream outputs from both the parent graph and any subgraphs.
The outputs will be streamed as tuples (namespace, data), where namespace is a tuple with the path to the node where a subgraph is invoked, e.g. ("parent_node:<task_id>", "child_node:<task_id>").
- v2 (LangGraph >= 1.1)
- v1 (default)
With
version="v2", subgraph events use the same StreamPart format. The ns field identifies the source:Extended example: streaming from subgraphs
Extended example: streaming from subgraphs
Debugging
Use thedebug streaming mode to stream as much information as possible throughout the execution of the graph. The streamed outputs include the name of the node as well as the full state.
LLM tokens
Use themessages streaming mode to stream Large Language Model (LLM) outputs token by token from any part of your graph, including nodes, tools, subgraphs, or tasks.
The streamed output from messages mode is a tuple (message_chunk, metadata) where:
message_chunk: the token or message segment from the LLM.metadata: a dictionary containing details about the graph node and LLM invocation.
If your LLM is not available as a LangChain integration, you can stream its outputs using custom mode instead. See use with any LLM for details.
Filter by LLM invocation
You can associatetags with LLM invocations to filter the streamed tokens by LLM invocation.
Filter by node
To stream tokens only from specific nodes, usestream_mode="messages" and filter the outputs by the langgraph_node field in the streamed metadata:
Extended example: streaming LLM tokens from specific nodes
Extended example: streaming LLM tokens from specific nodes
Stream custom data
To send custom user-defined data from inside a LangGraph node or tool, follow these steps:- Use
get_stream_writerto access the stream writer and emit custom data. - Set
stream_mode="custom"when calling.stream()or.astream()to get the custom data in the stream. You can combine multiple modes (e.g.,["updates", "custom"]), but at least one must be"custom".
- node
- tool
Use with any LLM
You can usestream_mode="custom" to stream data from any LLM API—even if that API does not implement the LangChain chat model interface.
This lets you integrate raw LLM clients or external services that provide their own streaming interfaces, making LangGraph highly flexible for custom setups.
Extended example: streaming arbitrary chat model
Extended example: streaming arbitrary chat model
Disable streaming for specific chat models
If your application mixes models that support streaming with those that do not, you may need to explicitly disable streaming for models that do not support it. Setstreaming=False when initializing the model.
- init_chat_model
- Chat model interface
Not all chat model integrations support the
streaming parameter. If your model doesn’t support it, use disable_streaming=True instead. This parameter is available on all chat models via the base class.v2 streaming format
Requires LangGraph >= 1.1. All examples in this page use
version="v2".version="v2" to stream() or astream() to get a unified output format. Every chunk is a StreamPart dict with a consistent shape — regardless of stream mode, number of modes, or subgraph settings:
TypedDict — ValuesStreamPart, UpdatesStreamPart, MessagesStreamPart, CustomStreamPart, CheckpointStreamPart, TasksStreamPart, DebugStreamPart — all importable from langgraph.types. The union type StreamPart is a discriminated union on part["type"], enabling full type narrowing in editors and type checkers.
With v1 (default), the output format changes based on your streaming options (single mode returns raw data, multiple modes return (mode, data) tuples, subgraphs return (namespace, data) tuples). With v2, the format is always the same:
chunk["type"] and get the correct payload type:
Subgraph streaming with v2
With v2, subgraph events use the sameStreamPart format. The ns field identifies the source graph:
Pydantic and dataclass state coercion
When your graph state is a Pydantic model or dataclass, v2values mode automatically coerces output to the correct type:
v2 invoke format
Passversion="v2" to invoke() or ainvoke() to get a GraphOutput object with .value and .interrupts attributes:
"values" stream mode, invoke(..., stream_mode="updates", version="v2") returns list[StreamPart] instead of list[tuple].
This cleanly separates state from interrupt metadata. With v1, interrupts are embedded in the returned dict under __interrupt__:
Migrate to v2
The table below summarizes the format changes when migrating from v1 to v2:Async with Python < 3.11
In Python versions < 3.11, asyncio tasks do not support thecontext parameter.
This limits LangGraph ability to automatically propagate context, and affects LangGraph’s streaming mechanisms in two key ways:
- You must explicitly pass
RunnableConfiginto async LLM calls (e.g.,ainvoke()), as callbacks are not automatically propagated. - You cannot use
get_stream_writerin async nodes or tools—you must pass awriterargument directly.
Extended example: async LLM call with manual config
Extended example: async LLM call with manual config
Extended example: async custom streaming with stream writer
Extended example: async custom streaming with stream writer
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

