If

Branches workflow execution based on a boolean condition. The workflow takes the true path when the condition is met and the false path otherwise.

When to Use

Use If when you need to make a binary decision:

  • Did the HTTP request succeed? (status == 200)
  • Is the user on the Pro plan?
  • Does the payload contain a required field?

For more than two outcomes, use Switch instead.

Inputs

HandleTypeDescription
inputanyThe value to evaluate the condition against.

Outputs

HandleTypeDescription
truecontrolExecution continues here when the condition is true.
falsecontrolExecution continues here when the condition is false.

Data from the If node's input is passed through to whichever branch executes. The downstream node on either branch receives the same value that was wired into input.

Settings

SettingTypeDescription
conditionexpressionA boolean expression evaluated against input. Returns true or false.

Condition Syntax

Write the condition as a Tensorify expression using {{ }} bindings:

{{ input.status }} == 200
{{ webhook.body.plan }} == "pro"
{{ http_request.data.active }} == true

Comparison operators: ==, !=, >, <, >=, <=

Logical operators: and, or, not

{{ input.status }} >= 200 and {{ input.status }} < 300

Example

Check if an HTTP request succeeded before sending a notification:

Webhook → HTTP Request → If ({{ http_request.status }} == 200) → true: Send Email
                                                                 → false: Stop

Common Gotchas

  • You do not need to connect both true and false outputs. Leave a branch unconnected if you want execution to simply stop on that path.
  • If the condition references a variable that does not exist, it evaluates to false.
  • String comparisons are case-sensitive: "Pro" is not equal to "pro".

See Also

  • Switch — route across more than two outcomes
  • Stop — explicitly terminate a branch
On this page