LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
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
WebChannelsPregelPrebuiltRemoteStream
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/langgraph-sdkstreamStreamControllerrespondAll
Methodā—Since v1.9

respondAll

Copy
respondAll(
  responsesById: Record<string, unknown>,
  options: StreamRespondAllOptions<ConfigurableType>
): 
View source on GitHub
Promise
<
void
>

Parameters

NameTypeDescription
responsesById*Record<string, unknown>
optionsStreamRespondAllOptions<ConfigurableType>

Example 1

Example 2

Resume several pending interrupts at the same checkpoint in a single command.

Required when a run pauses on multiple interrupts simultaneously (e.g. parallel tool-authorization prompts): a single Command({ resume }) carrying every interrupt's payload resumes them together. Sequential respond calls would fail because the first resume starts a run, leaving the rest with no interrupted run to respond to.

responsesById maps each pending interruptId to the payload sent back to it, so different interrupts can receive different responses (approve one, deny another). To send the same payload to several interrupts, build the map with that value for each id, e.g. Object.fromEntries(ids.map((id) => [id, response])).

The server resumes by interruptId, so namespaces are resolved internally from getThread()?.interrupts and need not be supplied.

Map of pending interruptId to its response payload. Must contain at least one entry.

Optional run-level config / metadata folded into the single run that services the batched resume. Equivalent to the same fields on StreamSubmitOptions.

Copy
await stream.respondAll({
  [interruptA.id]: { approved: true },
  [interruptB.id]: { approved: false },
});
Copy
await stream.respondAll(
  Object.fromEntries(stream.interrupts.map((i) => [i.id!, { approved: true }])),
);