LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
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/langgraphindexinputMessageId
Function●Since v1.7

inputMessageId

The id a run's input message gets when it has none.

runId is the run's configurable.run_id, a UUID; any other string throws. key is the channel the message is written to (__root__ in a graph with one root channel) and index its position in the list written there, 0 when it is written alone. The id can be found from the run alone, without reading its checkpoints, so servers store and look it up: the uuid5("input:{key}:{index}", runId) form will not change. It is the same id Python's input_message_id gives.

Each run on a thread needs its own run id. A run that reuses an earlier run's id would give its input that run's ids; a message whose id is already on the thread gets a random id instead, with a warning.

Copy
inputMessageId(runId: string, key: string, index: number): string

Parameters

NameTypeDescription
runId*string

The run's id, a UUID.

key*string

The channel the message is written to.

index*number

The message's position in the list written to key.

View source on GitHub