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/langgraphwebConvertToProtocolEventOptions
Interfaceā—Since v0.3

ConvertToProtocolEventOptions

Copy
interface ConvertToProtocolEventOptions

Properties

View source on GitHub
property
meta: StreamChunkMeta
property
mode: StreamMode
property
namespace: Namespace
property
payload: unknown
property
seq: number

Converts a raw [ns, mode, payload, meta?] stream chunk emitted by graph.stream() into one or more CDDL-aligned ProtocolEvents.

Most modes produce a single event. values chunks carrying StreamChunkMeta.checkpoint additionally produce a companion checkpoints event immediately after the values event, so clients that subscribe only to checkpoints can build a branching timeline without also paying for full-state values payloads, and clients that subscribe to both can correlate the pair by (namespace, step) or by adjacent seq numbers.

Returns an empty array for stream modes that have no protocol mapping.