LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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/langgraphindexGraphNodeTypes
Interfaceā—Since v0.3

GraphNodeTypes

Copy
interface GraphNodeTypes

Properties

View source on GitHub

Example

property
ContextSchema: ContextSchema
property
InputSchema: InputSchema
property
Nodes: Nodes
property
OutputSchema: OutputSchema

Type bag for GraphNode that accepts schema types. All fields are optional - unspecified fields use defaults.

This enables separate input/output schemas for nodes, which is useful when a node receives a subset of state fields and returns different fields.

Schema for runtime context (uses ExtractStateType)

Schema for router state (uses ExtractStateType)

Union of valid node names that can be routed to

Schema for node output/update (uses ExtractUpdateType)

Copy
const node: GraphNode<{
  InputSchema: typeof NodeInputSchema;
  OutputSchema: typeof NodeOutputSchema;
  ContextSchema: typeof ContextSchema;
  Nodes: "agent" | "tool";
}> = (state, runtime) => {
  return { answer: `Response to: ${state.query}` };
};