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
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 UiUtilsServer
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/svelteStreamSubmitOptions
Interfaceโ—Since v0.4

StreamSubmitOptions

Copy
interface StreamSubmitOptions

Properties

View source on GitHub
property
_stateType: StateType
property
command: __type
property
config: __type
property
forkFrom: __type
property
metadata: Record<string, unknown>
property
multitaskStrategy: "reject" | "rollback" | "interrupt" | "enqueue"
property
onError: (error: unknown) => void
property
signal: AbortSignal
property
threadId: string | null

Command shape widened to the v1 surface + protocol-v2 additions.

  • resume โ€” dispatches to thread.input.respond targeting the most recent root-namespace interrupt (honoured today).
  • goto โ€” routes execution to a specific node (planned, forwarded via /run.start metadata).
  • update โ€” merges a partial state update into the thread's values before resuming (planned, forwarded via /run.start).

Only resume is currently executed by the controller; goto / update are accepted by the type surface so callers can migrate without breakage once the server work lands (plan-roadmap.md ยง5.3 R2.4).

Fork the run from an explicit checkpoint instead of the thread's latest. Emits a forkFrom field on the /run.start request that the API layer forwards to graph.streamEvents(input, { version: "v3", forkFrom }).

See plan-roadmap.md ยง5.3 R2.4.

Behaviour when a run is already in-flight on the thread.

  • "rollback" (default) โ€” abort the active run client-side and start the new one immediately.
  • "interrupt" โ€” server-side cancel of the in-flight run, then start the new one (requires API support, roadmap A0.3).
  • "enqueue" โ€” do NOT abort the active run; the new submission lands in StreamController.queueStore and is forwarded once the current run terminates.
  • "reject" โ€” error out client-side when a run is already in flight.

Only "rollback" is honoured client-side today; the other three are accepted on the type surface so callers can start migrating ahead of the matching server work (plan-roadmap.md ยง5.3 R2.3 and A0.3).

Per-submit error callback. Invoked when the run errors out โ€” either before the first event lands (network/dispatch failure) or mid-stream. Does NOT suppress the error from being written to RootSnapshot.error; the callback is a local hook for showing toasts or routing the submission error to a component state slot, letting the rest of the UI keep using stream.error for render-level error display.

Per-submit thread-id override. When provided, the controller rebinds to this thread before dispatching the run; subsequent submits stick with the new id unless the hook's threadId prop changes. Useful when you want to start a new thread without unmounting the component (e.g. "New Chat" buttons).