Sanity Library Reference Docs
    Preparing search index...

    What a state-changing verb reports back. Every mutating verb — startInstance, fireAction, editField, completeEffect, commitEffectOps, tick, setStage, abortInstance, resetActivity — returns this one shape, on the namespace, the Engine, and the reactive session alike.

    interface OperationResult {
        cascaded: number;
        changed: boolean;
        instance: WorkflowInstance;
        nextEvaluationAt?: string;
        ranOps?: OpAppliedSummary[];
    }
    Index

    Properties

    cascaded: number

    Number of auto-transitions that fired during the cascade.

    changed: boolean

    Whether this call changed the instance's workflow state. false means the call succeeded but was a no-op: an idempotent re-fire of an already resolved activity, a tick that wrote nothing, a setStage already at the target, an abort of an already-terminal instance, or a retry whose idempotencyKey was already processed. Failures throw — changed: false never signals an error.

    The instance after the operation + all cascading auto-transitions.

    nextEvaluationAt?: string

    The nearest future instant (ISO 8601) at which the clock alone changes what the instance evaluates to; schedule the next tick for it. Derived per call, never persisted. Absent on a terminal instance, when no site yields a boundary from the instance's values, and for a gate reading $now beside a caller variable, which WorkflowEvaluation.nextEvaluationAt carries.

    ranOps?: OpAppliedSummary[]

    Engine primitives (workflow.op.field.* / status.set) that ran during the action commit. Surfaced for caller-side assertions and audit.