Type bag for ConditionalEdgeRouter that accepts schema types. Unlike GraphNodeTypes, conditional edges don't have separate input/output - they just read state and return routing decisions.
const router: ConditionalEdgeRouter<{ Schema: typeof StateSchema; ContextSchema: typeof ContextSchema; Nodes: "agent" | "tool";}> = (state, config) => { return state.done ? END : "agent";}; Copy
const router: ConditionalEdgeRouter<{ Schema: typeof StateSchema; ContextSchema: typeof ContextSchema; Nodes: "agent" | "tool";}> = (state, config) => { return state.done ? END : "agent";};
Optional
Schema for runtime context (uses ExtractStateType)
Schema for router state (uses ExtractStateType)
Union of valid node names that can be routed to
Type bag for ConditionalEdgeRouter that accepts schema types. Unlike GraphNodeTypes, conditional edges don't have separate input/output - they just read state and return routing decisions.
Example