Sanity Library Reference Docs
    Preparing search index...

    Studio-specific behavior for one (docType, definition) binding. A row may customize an automatically discovered subject binding or explicitly bind a definition modeled with a plain doc.ref.

    interface WorkflowMapping {
        autoStart?: boolean;
        contextBuilder?: (subjectGdr: GlobalDocumentReference) => StartContext;
        definition: string;
        docType: string;
        initialStateBuilder?: (
            subjectGdr: GlobalDocumentReference,
        ) => InitialFieldValue[];
        label: string;
        perspectiveField?: { name: string; required?: boolean };
    }
    Index

    Properties

    autoStart?: boolean

    Start this workflow when a fresh document of docType is created.

    contextBuilder?: (subjectGdr: GlobalDocumentReference) => StartContext

    Optional $context seed passed to startInstance as its context.

    definition: string

    The definition name the engine deployed under.

    docType: string

    Studio schema type.

    initialStateBuilder?: (
        subjectGdr: GlobalDocumentReference,
    ) => InitialFieldValue[]

    Optional initial workflow field entries to seed on Start.

    label: string

    Human-readable label for menus and dialogs.

    perspectiveField?: { name: string; required?: boolean }

    When set, the Start action reads Studio's usePerspective() to pull the active release. If a release is selected, the named release.ref field entry is seeded with the release's system-document GDR plus its bare releaseName, and the engine derives the instance's perspective from it — so editors can pick a release in the Studio header and start the workflow against it.

    Type declaration

    • Readonlyname: string

      Field entry name on the workflow definition (e.g. "release").

    • Optional Readonlyrequired?: boolean

      If true, the Start action stays disabled until a release is selected in Studio's perspective. If false (default), the action runs without perspective and the workflow uses its defaults.