Sanity Library Reference Docs
    Preparing search index...

    Interface WorkflowStageTransitionedData

    The caller-provenance fields every engine event payload carries: the engine's own view of the host that invoked it. ExecutionContext.id is never reported.

    interface WorkflowStageTransitionedData {
        definitionContentHash?: string;
        dwellMs?: number;
        executionKind?: ReportedExecutionKind;
        executionRuntime: string;
        fromStageIndex: number;
        instanceId: string;
        isRevisit: boolean;
        toIsTerminal: boolean;
        toStageIndex: number;
        via: "transition" | "setStage";
    }

    Hierarchy (View Summary)

    Index

    Properties

    definitionContentHash?: string

    Absent only when the definition predates content fingerprinting.

    dwellMs?: number

    Time spent in the exited stage (its entry's enteredAt to this exit, on the engine clock). Omitted when the exited entry is unavailable.

    executionKind?: ReportedExecutionKind

    Where the operation came from: the host's declared EXECUTION_KINDS value projected onto the reported vocabulary, or other for a kind outside it. Absent when the host declared none.

    executionRuntime: string

    The JavaScript runtime the engine inferred for itself, matching the executionContext.runtime the same operation stamps on its history entries.

    fromStageIndex: number

    Positional index of the exited stage in the definition's stages[] order — indexes, never names, so the payload stays content-free.

    instanceId: string

    The instance document _id — the per-instance join key (engine-minted <tag>.wf-instance.<random>; caller-supplied ids ride verbatim).

    isRevisit: boolean

    The entered stage was already visited on this instance — a loop-back.

    toIsTerminal: boolean

    The entered stage is terminal (no transitions out) — reaching it completes the instance.

    toStageIndex: number

    Positional index of the entered stage in the definition's stages[] order.

    via: "transition" | "setStage"

    Condition-driven transition vs. the setStage admin override.