LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • 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
LangGraph SDK
ClientAuthReactLoggingReact UiServer
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/langgraphwebGraph
Class●Since v0.3

Graph

Copy
class Graph

Constructors

constructor
constructor

Properties

property
branches: Record<string, Record<string, Branch<RunInput, N, any>>>
property
compiled: boolean
property
edges: Set<[N | "__start__", N | "__end__"]>
property
entryPoint: string
property
nodes: Record<N, NodeSpecType>

The nodes in the graph, mapping node names to their PregelNode instances

property
allEdges: Set<[string, string]>

Methods

method
addConditionalEdges→ this
method
addEdge→ this
method
addNode→ Graph<N | K, RunInput, RunOutput>
method
compile→ CompiledGraph<N>
method
validate→ this

Validates the graph structure to ensure it is well-formed. Checks for:

  • No orphaned nodes
  • Valid input/output channel configurations
  • Valid interrupt configurations
method
warnIfCompiled
deprecatedmethod
setEntryPoint→ this
deprecatedmethod
setFinishPoint→ this
View source on GitHub