Sanity Library Reference Docs
    Preparing search index...
    FieldSource:
        | { type: "input" }
        | { query: string; type: "query" }
        | { type: "literal"; value: unknown }
        | {
            field: string;
            path?: string;
            scope?: "workflow" | "stage";
            type: "fieldRead";
        }

    Supplies a field's initialValue once, when the field is initialized. Omitting the source starts the field empty; an operation can fill it later. The source does not grant permission to edit. Direct editing requires an editable declaration.

    Distinct from ValueExpr, which supplies an operation's write value. Only the literal and field-read forms are shared.

    input reads workflow inputs supplied at start or spawn. Stage and activity input seeds receive no caller value; activity input seeds produce a deploy warning. literal supplies a fixed value. query runs against the Content Lake with earlier fields in the same scope available as $fields. Reference normalization can omit unrecognized values without recording fieldQueryDiscarded. A result that fails validation after normalization uses the field's empty value (null or []) and records that event. A failed query throws.

    A fieldRead seed reads earlier fields in its own scope when scope is omitted. A stage or activity seed can read workflow fields with scope: 'workflow'. An activity seed cannot read stage fields. At workflow scope, omit scope to read an earlier workflow field. path selects a nested value; these reads do not load referenced documents.