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/langgraphwebGraphNodeTypes
Interface●Since v1.1

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 node input state (uses ExtractStateType)

property
Nodes: Nodes

Union of valid node names for Command.goto

property
OutputSchema: OutputSchema

Schema for node output/update (uses ExtractUpdateType)

View source on GitHub