Sanity Library Reference Docs
    Preparing search index...
    interface BenchEditFieldArgs {
        access?: WorkflowAccess;
        actor?: Actor;
        attributes?: UserAttributes;
        grants?: Grant[];
        grantsFromPath?: string;
        idempotencyKey?: string;
        instanceId: string;
        mode?: EditMode;
        target: EditFieldTarget;
        value?: unknown;
    }
    Index

    Properties

    actor?: Actor
    attributes?: UserAttributes
    grants?: Grant[]
    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.

    instanceId: string
    mode?: EditMode

    How to write: set replaces the value (reassign / reschedule), append adds a row to an array field (a running log / todo list), unset clears it. Default set.

    Which declared-editable field to write. Omit scope to resolve lexically — the nearest declaring scope wins (activity, then stage, then workflow); an explicit activity pins the match to that activity's field when the bare name is ambiguous.

    value?: unknown

    The new value (for set) or row (for append), as plain JSON matching the field's kind. Validated against the field kind in the op path; omit for unset.