Skip to main content
Skip table of contents

If

The If node is used for conditional branching within a Flow.

image-20251023-150527.png

It evaluates a condition defined using the Expression Language and determines which outgoing branch (True / False) will be followed.

image-20251023-150455.png

The condition must always resolve to a Boolean value.

For a complete description of the Expression Language syntax, available functions, and type rules, see Expression Language (Low-Code Syntax).

Condition Definition

The condition field of the If node accepts a single expression.

During Flow execution:

  • the expression is evaluated against the current DataStore state

  • the resulting Boolean value determines the selected branch:

    • trueTrue output

    • falseFalse output

The If node does not modify data and does not perform assignments.
Its sole responsibility is decision making.

Basic Rules for If Conditions

When defining conditions in an If node, the following rules apply:

  • The expression must evaluate to Boolean

  • Comparison is typically performed using comparison operators (=, !=, <, >, <=, >=)

  • All functions and DataStore references follow standard Expression Language rules

  • Nested expressions are fully supported

  • There is no implicit Boolean logic (AND, OR, NOT) beyond comparison expressions

If more complex logic is required, it should be modeled using multiple If nodes or Flow structure rather than a single expression.

Simple Condition Examples

Numeric comparison

CODE
{{dataStore.variables.orderAmount}} > 100

Result:

  • true if orderAmount is greater than 100

  • false otherwise

String-based condition

CODE
string_length({{dataStore.variables.userName}}) = 9

Result:

  • true if the username length equals 9

  • false otherwise

Function-based calculation

CODE
mul({{dataStore.process.Start.input3}}, 5) = 50

Result:

  • true if the calculated value equals 50

  • false otherwise

Complex Expressions in If Conditions

The If node supports fully nested expressions, allowing conditions to be derived from calculated values rather than raw data.

Example:

CODE
add(
    mul(2, 3),
    {{dataStore.variables.offset}}
) >= 10

Evaluation:

  • mul(2, 3)6

  • add(6, offset) → calculated value

  • comparison against 10

Final result:

  • true or false based on runtime data

Conditional Value Selection Using if( )

In addition to controlling Flow branching, the Expression Language also provides the if() function, which can be used inside expressions to conditionally return values.

This is conceptually different from the If node itself.

if( ) function signature

CODE
if(condition, valueIfTrue, valueIfFalse)
  • condition must evaluate to Boolean

  • exactly one of the two values is returned

  • the function itself does not affect Flow branching

Example: Conditional value selection

CODE
if(
    string_length({{datastore.global.userName}}) = 9,
    {{datastore.global.userName}},
    format_number(
        {{datastore.global.userId}},
        add(1, 1),
        ",",
        " "
    )
)

Evaluation:

  • If username length equals 9 → returns userName

  • Otherwise → returns formatted userId

The result of the if() function can then be:

  • assigned to a variable

  • used in another expression

  • compared further in an If node condition

Expression Pipelines in Conditions

Expressions may also be written as pipelines, where the result of one expression is passed to the next step.

Example:

CODE
trim({{datastore.global.userName}})

Or as part of a longer evaluation chain:

CODE
string_length(trim({{datastore.global.userName}})) > 5

Each step is evaluated sequentially, and the final result must still resolve to Boolean when used in an If node.

Recommended Modeling Practices

When using expressions in If nodes:

  • Keep conditions focused and readable

  • Prefer calculated variables for complex logic

  • Avoid deeply nested expressions when Flow structure is clearer

  • Use multiple If nodes rather than a single complex condition

The If node should express business decisions, not embed full business logic.

Summary

The If node uses the Expression Language to evaluate conditions and control Flow branching.

Key characteristics:

  • Conditions must evaluate to Boolean

  • Expressions are evaluated at runtime against the DataStore

  • Full Expression Language syntax is supported

  • Flow structure should remain the primary tool for complex logic

For detailed syntax rules, functions, and type compatibility, refer to the Expression Language (Low-Code Syntax) documentation.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.