Interface GraphExpansionContext

interface GraphExpansionContext {
    graph: CompiledExecutionGraph;
    runId: string;
    nodeId: string;
    state: GraphState<unknown, unknown, unknown>;
    request: GraphExpansionRequest;
    checkpointIdBefore?: string;
    completedNodes: string[];
    skippedNodes: string[];
    nodeResults: Record<string, {
        effectClass: EffectClass;
        output: unknown;
        durationMs: number;
    }>;
}

Properties

runId: string
nodeId: string
state: GraphState<unknown, unknown, unknown>
checkpointIdBefore?: string

The checkpoint the runtime saved after the node and before it handed any of this step's expansion requests to the handler. The node's edges are decided after the expansion, on the graph it leaves, so the checkpoint does not list the node in visitedNodes, and a resume from it routes the node once by its edges. A write, external or human node keeps its result and what it wrote, and a resume marks it complete with its recorded output; a pure or read node is saved as it was before it ran, and a resume runs it again. After a parallel batch, whose nodes' edges are decided before the expansion, the checkpoint lists every node of the batch.

completedNodes: string[]
skippedNodes: string[]
nodeResults: Record<string, {
    effectClass: EffectClass;
    output: unknown;
    durationMs: number;
}>

Type declaration

  • effectClass: EffectClass
  • output: unknown
  • durationMs: number