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}`
                | "runtime",
            >]?: 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 with two accepted exceptions: the document envelope (the closed system-key union, so a typed DeployedDefinition passes castless) and the authoring-only root runtime block, so a DefinedWorkflow passes castless too. Every other unknown key is never, making a typo'd literal a compile error rather than a silent collapse to the record arm.

    Type Parameters

    • T