Sanity Library Reference Docs
    Preparing search index...

    Type Alias WorkflowDefinitionInput<T>

    WorkflowDefinitionInput: string extends keyof T
        ? Record<string, unknown>
        : WorkflowDefinition & {
            [K in Exclude<
                keyof T,
                | keyof WorkflowDefinition
                | | "tag"
                | "version"
                | "modelVersion"
                | "minReaderModel"
                | "contentHash"
                | `_${string}`,
            >]?: never
        }

    What deploy/diff accept, conditioned on how the value is typed. The string extends keyof T test matches ONLY index-signature types (keyof of a literal is a finite key union that string never extends) — i.e. how fetch results are typed (Record<string, unknown>), which pass through to the runtime boundary parse. Everything precisely typed gets the exact WorkflowDefinition contract: beyond the document envelope (the closed system-key union, so a typed DeployedDefinition passes castless), unknown keys are never — a typo'd literal is a compile error, never a silent collapse to the record arm.

    Type Parameters

    • T