Automation

Conditions

Create branching logic with comparisons and operators.

Conditions

Conditions enable branching logic in workflows, allowing different paths based on data values and comparisons.

Condition Nodes

Basic Structure

A condition node evaluates an expression and routes to different paths:

Condition: order.total > 1000
├── True path → Send VIP notification
└── False path → Standard processing

Creating Conditions

  1. Add a Condition node
  2. Define the expression
  3. Connect True and False outputs
  4. Add actions to each path

Operators

Comparison Operators

OperatorDescriptionExample
eqEqual tostatus eq "completed"
neqNot equal tostatus neq "cancelled"
gtGreater thanamount gt 100
ltLess thanamount lt 50
gteGreater than or equalquantity gte 10
lteLess than or equalquantity lte 5

Text Operators

OperatorDescriptionExample
containsString containsname contains "Pro"
startsWithString starts withcode startsWith "SKU"
endsWithString ends withemail endsWith "@company.com"

Collection Operators

OperatorDescriptionExample
inValue in arraystatus in ["active", "pending"]
notInValue not in arraytype notIn ["archived"]
isEmptyArray/string emptyitems isEmpty
isNotEmptyHas contentcomments isNotEmpty

Existence Operators

OperatorDescriptionExample
existsField existsmetadata.custom exists
notExistsField doesn't existdeleted_at notExists

Expression Syntax

Simple Expressions

{{order.status}} eq "completed"
{{order.total}} gt 1000
{{customer.type}} in ["vip", "premium"]

Accessing Nested Data

{{order.customer.name}} contains "Inc"
{{trigger.entity.metadata.priority}} eq "high"

Using Previous Step Data

{{steps.checkInventory.output.available}} gt 0
{{steps.query.output.count}} eq 0

Branching Patterns

Simple If/Else

Condition: status eq "approved"
├── True → Process order
└── False → Send for review

Multiple Conditions (Nested)

Condition: amount > 10000
├── True → Condition: customer.verified
│          ├── True → Auto-approve
│          └── False → Manual review
└── False → Standard processing

No False Branch

If only True path is needed:

Condition: sendNotification eq true
├── True → Send email
└── (continues to next step)

Common Patterns

Value Thresholds

Condition: order.total gt 5000
True: Apply VIP discount
False: Standard pricing

Status Checks

Condition: order.status eq "paid"
True: Fulfill order
False: Wait for payment

Data Validation

Condition: email isNotEmpty
True: Send notification
False: Log missing email

List Processing

Condition: items.length gt 0
True: Process each item
False: Log empty order

Loop Nodes

Iterating Over Arrays

Loop nodes execute actions for each item in an array:

Type: Loop
Array: {{order.items}}
Variable: item

Inside Loops

Access current item:

{{item.product_code}}
{{item.quantity}}
{{item.price}}

Best Practices

Clear Conditions

  • Use descriptive condition names
  • Keep conditions simple
  • Break complex logic into multiple nodes

Error Prevention

  • Check for null/undefined values
  • Use exists operator before accessing nested data
  • Handle empty arrays

Testing

  • Test both true and false paths
  • Verify with edge case data
  • Check boundary conditions