Skip to main content

validate_workflow

Function validate_workflow 

Source
pub fn validate_workflow(
    script: &str,
) -> Result<WorkflowValidation, ScriptError>
Expand description

Deep validation of a workflow script without executing main().

Performs three layers of checks:

  1. SyntaxLua::load + exec the top level (safe: only meta assignment and function definitions run). SDK functions are stubbed so stray top-level calls don’t crash validation.
  2. Structure — verifies meta table exists with reasoning and phases, and that main() is defined.
  3. Heuristic — checks for report( call and phase_begin/phase_end pairing.

Returns a WorkflowValidation regardless of semantic errors (only syntax errors or internal failures produce Err).