langchain.js
    Preparing search index...

    Interface ConditionalEdgeRouterTypes<InputSchema, ContextSchema, Nodes>

    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";
    };
    interface ConditionalEdgeRouterTypes<
        InputSchema = unknown,
        ContextSchema = unknown,
        Nodes extends string = string,
    > {
        ContextSchema?: ContextSchema;
        InputSchema?: InputSchema;
        Nodes?: Nodes;
    }

    Type Parameters

    • InputSchema = unknown
    • ContextSchema = unknown
    • Nodes extends string = string
    Index

    Properties

    ContextSchema?: ContextSchema

    Schema for runtime context (uses ExtractStateType)

    InputSchema?: InputSchema

    Schema for router state (uses ExtractStateType)

    Nodes?: Nodes

    Union of valid node names that can be routed to