Sanity Library Reference Docs
    Preparing search index...
    • Validate, desugar, and return a workflow definition in its stored shape, plus the runtime hosting the workflow or its effects declared. Throws with a formatted, path-prefixed error message if validation fails.

      Example error:

      defineWorkflow("article-review") failed validation (2 issues):
      - stages[1].transitions[0].to: transition target "ready" is not a declared stage. Known stages: "drafting", "review", "approved"
      - predicates.allActivitiesDone: predicate "allActivitiesDone" shadows the built-in $allActivitiesDone — pick another name

      Parameters

      Returns DefinedWorkflow