Skip to content

If ​

Type key: if_node
Group: Flow Control
Category: flow
Tier: CORE
Version: 1.1.0

The If node evaluates a condition against the current data and routes execution to either the True or False output branch. It is the primary tool for conditional branching in a workflow.

Handles ​

HandleDirectionColorDescription
inputInput—Receives data from the preceding node
trueOutputEmeraldPath taken when the condition is satisfied
falseOutputRosePath taken when the condition is not satisfied

Configuration ​

FieldTypeDescription
conditionobjectA single condition definition
conditionsarrayArray of condition objects (first one is used)

Condition Object ​

json
{
    "field": "status",
    "operator": "equals",
    "value": "completed",
    "datePart": null,
    "timeUnit": null
}
PropertyTypeDescription
fieldstringDot-notation path to the field (e.g. order.status, user.age)
operatorstringComparison operator (see table below)
valuemixedValue to compare against; supports {{tags}}
datePartstringFor date operators: year, month, day, hour, minute
timeUnitstringFor relative date operators: days, hours, minutes

Supported Operators ​

OperatorDescriptionType-Aware
equals / =Strict equality✓
not_equals / !=Not equal✓
greater_than / >Numeric greater than✓
less_than / <Numeric less than✓
greater_than_or_equal / >=Numeric GTE✓
less_than_or_equal / <=Numeric LTE✓
containsString contains substring—
not_containsString does not contain—
starts_withString starts with—
ends_withString ends with—
is_emptyValue is null/empty string/empty array—
is_not_emptyValue is not empty—
inValue is in a comma-separated list—
not_inValue is not in list—
is_nullValue is null—
is_not_nullValue is not null—
date_equalsDate field equals a date✓ Date
date_afterDate field is after a date✓ Date
date_beforeDate field is before a date✓ Date
date_within_lastDate is within last N time units✓ Date

Type-Aware: The system automatically infers whether to compare as integer, float, string, boolean, or datetime based on the actual value at runtime.

Behavior ​

  1. The node reads $context->input and extracts the field value using dot notation
  2. Compares the extracted value against the configured value using the selected operator
  3. If the condition is true, data flows through the true output handle
  4. If the condition is false, data flows through the false output handle
  5. The original input data is passed unchanged through whichever branch is taken

Examples ​

Route by Order Status ​

Field:    status
Operator: equals
Value:    completed

→ true branch if input.status === "completed"

If node — route by statusIf node — route by status

💾 Try this example

Download the workflow JSON — open an empty workflow and import the file.

Reunify branches with Merge ​

After an If splits the flow, a Merge node can join the true and false paths so downstream nodes run once with whichever branch fired.

If node with Merge — reunify branchesIf node with Merge — reunify branches

💾 Try this example

Download the workflow JSON — open an empty workflow and import the file.

Check Numeric Threshold ​

Field:    total
Operator: greater_than
Value:    1000

→ true branch if input.total > 1000

Dynamic Value from Previous Node ​

Field:    score
Operator: greater_than_or_equal
Value:    {{variables.min_score_threshold}}

→ Compares input.score against a workflow variable

Date Freshness Check ​

Field:    created_at
Operator: date_within_last
Value:    7
timeUnit: days

→ true if the record was created within the last 7 days

Notes ​

  • Both output branches can have their own downstream nodes. You do not need to connect both — unconnected branches simply terminate.
  • The If node passes all input data unchanged through the activated branch. It does not modify data.
  • For more than two branches, use the Switch node.

Voodflow Documentation.