> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eigenpal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

`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:`).

<ParamField path="condition" type="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).
</ParamField>

<ParamField path="statusCode" type="integer" default="422">
  HTTP-style status code returned to the caller (sync runs) and persisted on the execution. Default 422 (Unprocessable Entity).
</ParamField>

<ParamField path="message" type="string" required>
  Human-readable failure message. Supports template expressions, e.g. "Document classified as \{\{ steps.classify.output.label }}".
</ParamField>

## Output

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