Skip to content

Workflow validation

Alan B. Christie edited this page Aug 15, 2025 · 6 revisions

There are three levels of validation. They correspond to the actions of "creating", "tagging", and "running" a workflow, each requiring a slightly more invasive and detailed inspection of the YAML file, something the schema is not able to do entirely without help. The validator is used by the DM prior to the execution of workflows, then engine can therefore assume that when a workflow is run validation will have been performed and will have been successful.

The WorkflowValidator module exposes the level and validation results as an Enum and dataclass: -

class ValidationLevel(Enum):
"""Workflow validation levels."""

    CREATE = 1
    RUN = 2
    TAG = 3


@dataclass
class ValidationResult:
    """Workflow validation results."""

    error_num: int
    error_msg: list[str] | None

The ValidationResult indicates success with an instance of the class with an error_num of 0 (zero) and where error_msg is None. On error the error_num will be non-zero and error_msg will contain at least one user-digestible error message.

See also

  1. The Validation and starting workflows (WorkflowValidator) section of the Shortcut doc Workflow engine design
Clone this wiki locally