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

LangChain Assistant

Ask a question to get started

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/langgraphwebNodePolicyOptions
Type●Since v1.4

NodePolicyOptions

Retry and cache policies configurable on graph nodes.

Use with StateGraph.addNode for per-node overrides, or with StateGraph.setNodeDefaults for graph-wide defaults applied at compile() time. Per-node values always take precedence over defaults. setNodeDefaults may be called before or after addNode, including as the last step before compile().

Copy
NodePolicyOptions

Properties

property
cachePolicy: CachePolicy | boolean

Cache policy controlling how node results are keyed and how long they persist.

  • Pass a CachePolicy object for fine-grained control (e.g. custom keyFunc, ttl).
  • Pass true to enable caching with default settings.
  • Pass false to disable caching.
property
retryPolicy: RetryPolicy

Retry policy controlling backoff, max attempts, and which errors trigger a retry.

property
timeout: number | TimeoutPolicy

Maximum duration for a single attempt of this node. Accepts a number of milliseconds (a hard wall-clock cap) or a TimeoutPolicy for finer control over run / idle timeouts. When exceeded, a NodeTimeoutError is raised and the node's retry policy (if any) decides whether to retry.

View source on GitHub