Condition Block (IF)

The Condition block evaluates a comparison and branches the flow into two paths: TRUE and FALSE. This is how your flow makes decisions.


How It Works

The block compares a variable against a value using an operator:

Variable [operator] Value → TRUE or FALSE

On the canvas, the IF block displays:

  • Left box (orange) — the variable being checked
  • Center circle — the comparison operator
  • Right box (blue) — the comparison value
  • Bottom left (green) — TRUE exit path
  • Bottom right (red) — FALSE exit path

Configuration

Variable

Select a flow variable to check. This is typically a value read by a previous Sensor Read block (e.g., current_ph, water_temp).

Operator

OperatorSymbolMeaning
===Equal to
!=≠Not equal to
>>Greater than
<<Less than
>=≥Greater than or equal
<=≤Less than or equal

Comparison Value

The value to compare against. Can be a fixed number (e.g., 6.5) or a variable reference (e.g., {{target_ph}}).

Tip: Using a variable as the comparison value makes your flow dynamic — you can change thresholds without editing the flow.


Connecting the Branches

After placing an IF block, you need to connect both output handles:

  1. TRUE handle (bottom-left, green ✅) → connect to blocks that execute when the condition is met
  2. FALSE handle (bottom-right, red ❌) → connect to blocks that execute when it is NOT met

Example: pH Control

Sensor Read (pH) → current_ph
        ↓
   IF: current_ph < 6.0
     ├── TRUE  → Actuator: pH Up Pump ON → Wait 30s → Pump OFF
     └── FALSE → Log "pH is OK"
        ↓
      (continue)

Error Handling

The IF block’s On Failure has a special option:

OptionEffect
StopStops the flow if the variable is missing or comparison fails
PausePauses the flow
Treat as FALSEIf the variable can’t be read, the flow follows the FALSE path instead of failing. Useful for graceful degradation.
Jump to LabelJumps to a specific label block

This “Treat as FALSE” option is unique to the IF block.


Troubleshooting

Both paths go to the same place

  • This is valid but unnecessary — consider removing the IF block and connecting directly.

Variable shows “var?” placeholder

  • The variable hasn’t been selected yet, or was deleted from the Variable Manager.

Value shows “val?” placeholder

  • No comparison value has been entered. Type a number or select a variable.