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

pushMessage

Copy
pushMessage(
  message: BaseMessageLike | BaseMessage<MessageStructure<MessageToolSet>, MessageType>,
  options
View source on GitHub
:
RunnableConfig
<
Record
<
string
,
any
>
>
__type
)
:
BaseMessage
<
MessageStructure
<
MessageToolSet
>
,
MessageType
>

Parameters

NameTypeDescription
message*BaseMessageLike | BaseMessage<MessageStructure<MessageToolSet>, MessageType>

The message to push. The message must have an ID set, otherwise an error will be thrown.

optionsRunnableConfig<Record<string, any>> & __type

Manually push a message to a message stream.

This is useful when you need to push a manually created message before the node has finished executing.

When a message is pushed, it will be automatically persisted to the state after the node has finished executing. To disable persisting, set options.stateKey to null.

RunnableConfig / Runtime coming from node context.