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

# Bool Condition

> Add conditional branching logic to workflows

The **Bool Condition** node creates branching logic in your workflow based on conditions. The workflow follows the `true` or `false` edge depending on the evaluation result.

## Parameters

| Parameter                | Type    | Required | Description                                                                                                     |
| ------------------------ | ------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `execution`              | string  | Yes      | Execution type: `STATIC` (UI: "Static"), `LLM_VISION` (UI: "AI (Screenshot)"), or `PROMPT` (UI: "AI (Context)") |
| `comparison_operator`    | string  | No       | Comparison operator for `STATIC` execution                                                                      |
| `comparison_value_1`     | string  | No       | First value to compare (for `STATIC` execution)                                                                 |
| `comparison_value_2`     | string  | No       | Second value to compare (for `STATIC` execution, not needed for `IS_NULL`/`IS_NOT_NULL`)                        |
| `prompt`                 | string  | No       | Natural language condition for `LLM_VISION` or `PROMPT` execution                                               |
| `wait_time`              | number  | No       | Maximum time (ms) to wait before evaluation                                                                     |
| `clear_cookies_on_false` | boolean | No       | Clear cookies if condition evaluates to false                                                                   |
| `error_on_false_message` | string  | No       | Throw this error message when the condition evaluates to false instead of following a `false` edge              |

## Comparison Operators

For `STATIC` execution, use these operators:

| Operator      | Description                |
| ------------- | -------------------------- |
| `EQUAL`       | Values are exactly equal   |
| `NOT_EQUAL`   | Values are not equal       |
| `IS_NULL`     | Value is null or undefined |
| `IS_NOT_NULL` | Value is not null          |

## Examples

### Basic Comparison

Check if a value equals a specific string:

```json theme={null}
{
  "id": "abc123",
  "name": "Check status",
  "action": "BOOL_CONDITION",
  "parameters": {
    "execution": "STATIC",
    "comparison_operator": "EQUAL",
    "comparison_value_1": "{{context.status}}",
    "comparison_value_2": "active"
  }
}
```

### JSONata Expression

Use complex logic with JSONata:

```json theme={null}
{
  "id": "abc123",
  "name": "Drug in list?",
  "action": "BOOL_CONDITION",
  "parameters": {
    "execution": "STATIC",
    "comparison_value_1": "{{context.drug in [\"Skyrizi\", \"Tremfya\", \"Botox\"]}}",
    "comparison_value_2": "true",
    "comparison_operator": "EQUAL"
  }
}
```

### LLM\_VISION Condition

Use AI to evaluate a visual condition based on a screenshot:

```json theme={null}
{
  "id": "abc123",
  "name": "Check if modal is visible",
  "action": "BOOL_CONDITION",
  "parameters": {
    "execution": "LLM_VISION",
    "prompt": "Is there a confirmation modal visible on the screen?"
  }
}
```

### PROMPT Condition

Use AI to make a decision based on context data (no screenshot):

```json theme={null}
{
  "id": "abc123",
  "name": "Check if order qualifies for discount",
  "action": "BOOL_CONDITION",
  "parameters": {
    "execution": "PROMPT",
    "prompt": "Based on the order total {{context.order_total}} and customer status {{context.customer_status}}, does this order qualify for a 10% discount? Orders over $100 from premium customers qualify."
  }
}
```

### Clear Cookies on False

Reset session if condition fails. Relevant for login flows to remove stale browser state:

```json theme={null}
{
  "id": "abc123",
  "name": "Check session valid",
  "action": "BOOL_CONDITION",
  "parameters": {
    "execution": "STATIC",
    "comparison_operator": "NOT_CONTAINS",
    "comparison_value_1": "{{context.current_url}}",
    "comparison_value_2": "/login",
    "clear_cookies_on_false": true
  }
}
```

## Notes

* Use `STATIC` execution with comparison operators for simple, fast evaluations
* Use `LLM_VISION` when you need to evaluate visual conditions based on a screenshot
* Use `PROMPT` when you need AI reasoning on context data without requiring a screenshot
