Sanity Library Reference Docs
    Preparing search index...
    interface StageGuardArgs {
        client: WorkflowClient;
        clientForGdr: ClientForGdr;
        definition: {
            description?: string;
            fields?: FieldEntry[];
            groups?: Group[];
            initialStage: string;
            lifecycle?: WorkflowLifecycle;
            name: string;
            predicates?: Record<string, string>;
            roleAliases?: RoleAliases;
            semantics?: Semantic[];
            stages: Stage[];
            start?: StartBlock;
            title: string;
        };
        instance: WorkflowInstance;
        now: string;
        snapshot: HydratedSnapshot
        | undefined;
        stageName: string;
    }
    Index

    Properties

    clientForGdr: ClientForGdr
    definition: {
        description?: string;
        fields?: FieldEntry[];
        groups?: Group[];
        initialStage: string;
        lifecycle?: WorkflowLifecycle;
        name: string;
        predicates?: Record<string, string>;
        roleAliases?: RoleAliases;
        semantics?: Semantic[];
        stages: Stage[];
        start?: StartBlock;
        title: string;
    }
    now: string

    Shell-supplied clock reading (ISO) backing guard $now reads.

    snapshot: HydratedSnapshot | undefined

    The commit's hydrated snapshot, so a metadata read dereferences a doc.ref into content. undefined → identity-only resolution (content reads resolve null). Required (not optional) so a new call site can't silently drop it — pass undefined deliberately.

    stageName: string