← Back to all posts

If-Else

On this page

Purpose

If-Else compares text and sends the flow down either the True or False output.

When to use it

  • Route a message when it contains a keyword.
  • Compare a numeric value against a threshold.
  • Match a regular expression before continuing a flow.

How to use it

  1. Connect a text or message value to Text Input.
  2. Choose an operator such as contains, equals, or regex.
  3. Enter the comparison value or pattern.
  4. Connect True and False to the appropriate downstream paths.

Configuration

SettingWhat it controlsRecommended starting point
OperatorSelects equals by default, not equals, contains, starts with, ends with, regex, less than, less than or equal, greater than, or greater than or equal.Start with contains for a simple keyword check.
Match TextDefines the literal value, regex pattern, or numeric threshold to compare.Use a short, specific value.
Case SensitiveApplies to non-regex text comparisons. It is enabled by default and hidden for regex.Turn it off only when case should not matter.
Case True and Case FalseSet the Message carried by the True and False outputs. Both default to an empty Message.Connect the input message to both when it should continue.
Max IterationsLimits repeated evaluation in a cycle. The default is 10.Keep the default unless a bounded cycle needs a different limit.
Default RouteSelects the branch left active at the cycle limit. The default is false_result. It does not guarantee a non-empty payload.Keep False unless the safe cycle exit is True.

Expected result

Exactly one Message output, True or False, runs for each evaluation. A malformed regular expression or nonnumeric value for a numeric comparison evaluates as false. In a cycle, the fallback can activate the configured default branch with an empty payload when that branch's Case message is empty.

Reference details

Regex matching starts at the beginning of the input. For contains-like behavior, use a pattern such as .*(urgent|warning|caution).*.

Works well with

Use Chat Input as the compared text and, when needed, as both branch payloads. Send True and False to separate Chat Output paths. Put If-Else inside a Loop only when a repeated path needs a bounded conditional exit.

← Back to all posts