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.
const node: GraphNode<{ InputSchema: typeof NodeInputSchema; OutputSchema: typeof NodeOutputSchema; ContextSchema: typeof ContextSchema; Nodes: "agent" | "tool";}> = (state, runtime) => { return { answer: `Response to: ${state.query}` };}; Copy
const node: GraphNode<{ InputSchema: typeof NodeInputSchema; OutputSchema: typeof NodeOutputSchema; ContextSchema: typeof ContextSchema; Nodes: "agent" | "tool";}> = (state, runtime) => { return { answer: `Response to: ${state.query}` };};
Optional
Schema for runtime context (uses ExtractStateType)
Schema for node input state (uses ExtractStateType)
Union of valid node names for Command.goto
Schema for node output/update (uses ExtractUpdateType)
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.
Example