If
Branches workflow execution based on a boolean condition. When the condition evaluates to true, execution follows the true branch; otherwise it follows the false branch.
Use If when you need a binary decision:
- Did the HTTP request succeed? (
input.status == 200) - Is the user on the Pro plan? (
input.body.plan == "pro") - Does the payload contain a required field? (
input.body.email)
For more than two outcomes, use Switch instead.
| Handle | Type | Description |
|---|---|---|
input | any | The value to evaluate the condition against. Optional. |
None. If has no data output handles. Execution continues through one of these control branch handles:
| Handle | Type | Description |
|---|---|---|
true | control | Execution continues here when the condition is true. |
false | control | Execution continues here when the condition is false. |
Data from the input handle is passed through to whichever branch executes. The downstream node on either branch receives the same value that was wired into input.
| Setting | Type | Required | Description |
|---|---|---|---|
condition | expression | Yes | Boolean expression evaluated against input. Supports template bindings. Example: input.body.status == 200 |
The condition field accepts bare Python expressions — no {"{{ }}"} wrapper needed. Comparison operators: ==, !=, >, <, >=, <=. Logical operators: and, or, not.
Use eq(input.status, 200) instead of == when comparing values that might be strings or numbers (common with webhook payloads). Reference a field directly to check if it exists — missing fields return None (falsy).
Check if an HTTP request succeeded before sending a notification:
Webhook → HTTP Request → If (input.status == 200) → true: Send Email
→ false: Stop
If settings:
- Condition:
input.status == 200
import webhook from @tensorify/webhook-trigger:4.0.0
import http_request from @tensorify/http-request:3.0.0
import check_status from @tensorify/if:3.0.0
import send_email from @tensorify/resend-send-email:1.0.0
import halt from @tensorify/stop:3.0.0
node trigger @tensorify/webhook-trigger:4.0.0 {
path = "/notify"
method = "POST"
provider = "generic"
}
node fetch @tensorify/http-request:3.0.0 {
method = "GET"
url = "https://api.example.com/status"
timeout = 30
}
node gate @tensorify/if:3.0.0 {
condition = "input.status == 200"
}
node notify @tensorify/resend-send-email:1.0.0 {
to = "[email protected]"
subject = "Status check passed"
}
node stop_node @tensorify/stop:3.0.0
trigger.payload -> fetch.body
fetch.response -> gate.input
gate.true -> notify.input
gate.false -> stop_node.input
- You do not need to connect both
trueandfalseoutputs. 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". Uselower()for case-insensitive checks. - Use
eq()instead of==when comparing values that might be strings or numbers (common with webhook data). - Old workflows with
{"{{ }}"}in conditions still work — the runtime strips them automatically. New workflows should use bare expressions.
- Expression Reference — full list of operators and helpers
- Expressions & Conditions Guide — workflow recipes
- Switch — route across more than two outcomes
- Stop — explicitly terminate a branch
