Sanity Library Reference Docs
    Preparing search index...

    The diagnosis projection — why an instance is or isn't progressing.

    The engine's SuggestedRemediation is already small and LLM-friendly, so remediations passes through verbatim rather than being re-projected. The verbose WorkflowEvaluation the engine returns alongside the diagnosis is dropped — per-activity action detail belongs to ProjectedInstanceState (workflows_get_state), not here.

    interface ProjectedDiagnosis {
        cause?:
            | "failed-effect"
            | "hung-effect"
            | "failed-activity"
            | "no-transition-fires"
            | "transition-unevaluable";
        explanations?: string[];
        instanceId: string;
        remediations: SuggestedRemediation[];
        state: | "aborted"
        | "completed"
        | "progressing"
        | "waiting"
        | "blocked"
        | "stuck";
        summary: string;
    }
    Index

    Properties

    cause?:
        | "failed-effect"
        | "hung-effect"
        | "failed-activity"
        | "no-transition-fires"
        | "transition-unevaluable"

    When state is "stuck", the structured cause kind.

    explanations?: string[]

    Per unsatisfied exit transition, its insight summary ("the "Publish" transition: Needs: «Legal approved» must be true") — present when any exit is currently held.

    instanceId: string

    Sanity document id of the diagnosed workflow.instance.

    remediations: SuggestedRemediation[]

    What would unstick the instance — empty unless stuck. Each names a surface-neutral verb, whether it's runnable as an engine operation today (available), and why. None are executable through this MCP server: they say what a human or admin tool would need to do.

    state: "aborted" | "completed" | "progressing" | "waiting" | "blocked" | "stuck"

    The diagnosis verdict.

    summary: string

    One-line plain-English explanation of the verdict.