---
title: "Condition"
description: "Evaluate AND/OR comparisons on context variables and route to true or false."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/condition/condition"
---
# Condition

> Evaluate AND/OR comparisons on context variables and route to true or false.

<block-meta block="Yes" channels="Any" folder="basic/condition" group="Condition" groupTo="/build/workflows/blocks/condition" icon="i-lucide-git-branch" pipe="Value" scope="Any" tool="No" type="cond.condition">



</block-meta>

**Condition** evaluates a query against the current run context and continues on either the **true** or **false** outlet. Use it to branch a [workflow](https://docs.vettero.com/build/workflows) without writing code.

For many exclusive paths, use [Switch](https://docs.vettero.com/build/workflows/blocks/condition/switch). For a single variable check, use [Is Null](https://docs.vettero.com/build/workflows/blocks/condition/is-null), [Is Empty](https://docs.vettero.com/build/workflows/blocks/condition/is-empty), or a related check.

## Configure

Build a **query**:

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Logic
      </strong>
    </td>
    
    <td>
      <strong>
        AND
      </strong>
      
       or <strong>
        OR
      </strong>
      
       for the group
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Rules
      </strong>
    </td>
    
    <td>
      Compare a context variable to a fixed value or another variable
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Groups
      </strong>
    </td>
    
    <td>
      Nested groups for mixed AND/OR
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Not
      </strong>
    </td>
    
    <td>
      Invert a rule or group
    </td>
  </tr>
</tbody>
</table>

Left-side fields come from this block’s context (`args.*`, `pipe.*`, named variables, and so on). If the query is empty or not configured, the run takes the **false** path.

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues when the query is <strong>
        true
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        False
      </strong>
    </td>
    
    <td>
      Continues when the query is <strong>
        false
      </strong>
      
       (or empty)
    </td>
  </tr>
</tbody>
</table>

Connect both outlets if every path should keep running. An unconnected outlet ends that branch.

## Pipe schema

The next block reads this on the data pipe (`pipe.value`).

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Result
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      <code>
        true
      </code>
      
       when the query matches, <code>
        false
      </code>
      
       when it does not or the query is empty
    </td>
  </tr>
</tbody>
</table>

## Use case

- Skip or take a different path when an argument, pipe value, or variable matches a rule (for example status is `open`, or amount is above a limit).
- Inside a loop, send matching items down one branch and the rest down the other.
- Combine several checks with AND/OR (and nested groups) instead of chaining many condition blocks.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
