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

# Condition

> Branch execution based on a condition expression

`control.if`, Branch execution based on a condition expression

Use `control.if` when the workflow should choose one branch based on a value
already produced by earlier steps: route high-value invoices for approval, skip
optional enrichment, or use a different extraction path for a document class.

The condition is a LiquidJS expression and should evaluate to a boolean. Keep
branching conditions simple; move multi-line calculations into
`transform.script` and branch on that result.

```yaml theme={null}
- name: needs-review
  type: control.if
  condition: "{{ steps.extract.output.requiresApproval }}"
```

## Configuration

Configuration fields sit at the step level (not inside `with:`).

<ParamField path="condition" type="string" required>
  LiquidJS expression that evaluates to boolean
</ParamField>

## Output

<ResponseField path="condition" type="boolean" required>
  Evaluated condition result
</ResponseField>

<ResponseField path="branch" type="&#x22;then&#x22; | &#x22;else&#x22;" required>
  Which branch was executed
</ResponseField>

<ResponseField path="result" type="unknown" required>
  Output from executed branch
</ResponseField>
