LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
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
LangGraph SDK
ClientAuthReactLoggingReact UiServer
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/langgraph-sdkclientRunsClientjoinStream
Method●Since v0.0

joinStream

Stream output from a run in real-time, until the run is done.

Copy
joinStream(
  threadId: string | null | undefined,
  runId: string,
  options: AbortSignal | __type
): AsyncGenerator<__type>

Parameters

NameTypeDescription
threadId*string | null | undefined

The ID of the thread. Can be set to null | undefined for stateless runs.

runId*string

The ID of the run.

optionsAbortSignal | __type

Additional options for controlling the stream behavior:

  • signal: An AbortSignal that can be used to cancel the stream request
  • lastEventId: The ID of the last event received. Can be used to reconnect to a stream without losing events.
  • cancelOnDisconnect: When true, automatically cancels the run if the client disconnects from the stream
  • streamMode: Controls what types of events to receive from the stream (can be a single mode or array of modes) Must be a subset of the stream modes passed when creating the run. Background runs default to having the union of all stream modes enabled.
View source on GitHub