Skip to main content
control.fail, Terminate the workflow with a typed status code + message. With an optional condition, only fails when the condition is truthy; otherwise always fails when reached. Pair with ai.classify or any prior step to fail fast on bad inputs.

Configuration

Configuration fields sit at the step level (not inside with:).
condition
string
Optional LiquidJS expression. When set, the step only fails if this evaluates truthy; when omitted, it always fails when reached (compose with control.if for legacy gating).
statusCode
integer
default:"422"
HTTP-style status code returned to the caller (sync runs) and persisted on the execution. Default 422 (Unprocessable Entity).
message
string
required
Human-readable failure message. Supports template expressions, e.g. “Document classified as {{ steps.classify.output.label }}”.

Output

Returns unknown. control.fail never produces output, it terminates the workflow when triggered.