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/langgraphindexTimeoutPolicy
Type●Since v1.5

TimeoutPolicy

Configuration for timing out node attempts.

A timeout applies to a single attempt of a node/task. When a node has a RetryPolicy, the timer resets for each retry attempt.

Timeouts are expressed in milliseconds, matching other LangGraph.js durations (e.g. RetryPolicy intervals and stepTimeout).

Copy
TimeoutPolicy

Cooperative cancellation: timeouts rely on aborting the node's AbortSignal and dropping its buffered writes. A node that ignores its signal and performs blocking work cannot be interrupted mid-operation, but its writes are still discarded and NodeTimeoutError is raised.

Properties

property
idleTimeout: number

Maximum time (in milliseconds) a single node attempt may go without observable progress before timing out.

Refreshed by writes, custom stream writer calls, child-task scheduling, LangChain callback events emitted under the node's run, and explicit runtime.heartbeat() calls (see TimeoutPolicy.refreshOn).

property
refreshOn: "auto" | "heartbeat"

Which signals refresh TimeoutPolicy.idleTimeout.

  • "auto" (default): refreshes on standard graph progress signals and explicit heartbeats.
  • "heartbeat": refreshes only on explicit runtime.heartbeat() calls.
property
runTimeout: number

Hard wall-clock cap (in milliseconds) for a single node attempt.

This timeout is never refreshed by progress signals or runtime.heartbeat().

View source on GitHub