Sanity Library Reference Docs
    Preparing search index...

    The OperationArgs of the verbs that own a discrete commit — fireAction, editField, completeEffect, commitEffectOps, setStage, abortInstance. tick deliberately takes the plain base: it owns no commit of its own and re-derives everything, so retrying it blind is already safe.

    interface FireActionArgs {
        action: string;
        activity: string;
        grantsFromPath?: string;
        idempotencyKey?: string;
        idempotent?: boolean;
        instanceId: string;
        params?: Record<string, unknown>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    action: string
    activity: string
    grantsFromPath?: string

    URL path for grant resolution — see StartInstanceArgs.grantsFromPath.

    idempotencyKey?: string

    Caller-supplied key that makes this call safe to retry blind (a network failure ate the response; a queue redelivered the message). The first commit records the key on the instance's processedRequests[] ledger — in the same CAS write as the operation itself — and a retry carrying the same key replays instead of double-applying (or, for a completed effect, throwing EffectNotFoundError): the operation is NOT re-applied, but the cascade runs to convergence (the original may have died before its own cascade), so changed is false unless that cascade repaired something. Keys live for the engine's idempotencyTtlMs (default 24h); reusing a live key on a different verb throws. The caller owns key uniqueness per logical request.

    Only a commit records the key: a keyed call that no-ops (a setStage already at its target, an abort of a terminal instance) leaves no ledger row, so retrying it later re-evaluates fresh rather than replaying.

    idempotent?: boolean

    If true, no-op (instead of throwing) when the activity is missing from the current stage's activityStatus — typically because the workflow has already advanced past it. Distinct from idempotencyKey: this flag tolerates a state the fire no longer applies to (however it got there, including someone else's action), while the key dedupes a retry of this specific request. A drive script tolerating advanced workflows wants the flag; a queue consumer redelivering a message wants the key.

    instanceId: string
    params?: Record<string, unknown>

    Caller-supplied params for the action. Validated against Action.params[] before commit; missing/required mismatch throws ActionParamsInvalidError. Resolved values feed ValueExpr.param lookups in ops and effect bindings.