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/langgraphindexGraphNodeTypes
Interface●Since v0.3

GraphNodeTypes

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.

Copy
interface GraphNodeTypes

Example

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

Properties

property
ContextSchema: ContextSchema

Schema for runtime context (uses ExtractStateType)

property
InputSchema: InputSchema

Schema for router state (uses ExtractStateType)

property
Nodes: Nodes

Union of valid node names that can be routed to

property
OutputSchema: OutputSchema

Schema for node output/update (uses ExtractUpdateType)

View source on GitHub