Skip to Content
We are launching Soon! 🚀🚀 🎉
WorkflowsConditions

Conditions

Add intelligence to your workflows with conditions. Make your automations respond dynamically to different scenarios by creating decision points that route execution along different paths based on your criteria.

Smart Branching

Create workflows that adapt and branch based on real-time data and business logic

Dynamic Logic

Evaluate complex expressions and make real-time decisions within your flows

Flexible Control

Handle multiple scenarios easily with boolean logic and multi-branch conditions


What Conditions Do

A condition is a decision point in your workflow that evaluates criteria and routes execution accordingly:

Evaluates Expressions

Resolves conditions to true or false based on your criteria

Directs Workflow Paths

Routes execution along different branches based on results

Adapts Dynamically

Changes workflow behavior based on data and context

Builds Complex Logic

Creates sophisticated branching for advanced scenarios


Types of Conditions

Wakflo offers two main types of conditions to handle different decision-making needs.

Boolean (If/Else)

If/Else Condition
Simple Binary Decisions

The most common condition type—evaluate a single expression and follow one of two paths.

IF

True Branch

Executes when condition is true

ELSE

False Branch

Executes when condition is false

MERGE

Merge Point

Where branches rejoin to continue

💡

Example: If order value > $100, send VIP shipping notification; else send standard notification.

Branch (Multi-Conditions)

Branch Condition
Complex Multi-Path Logic

Evaluate multiple expressions in sequence for sophisticated routing with many possible paths.

1-N

Multiple Conditions

Series of expressions evaluated in order

PATHS

Multiple Branches

One path for each condition plus default

ORDER

Sequential Evaluation

First matching condition determines path

💡

Example: Route customers based on purchase history, account age, and VIP status for personalized experiences.


Creating Conditions

Follow these steps to add decision-making to your workflows.

Add condition component

Click the ”+” button where you want to add a condition. This opens the component selection menu.

Select condition type

Choose Boolean (simple if/else) or Branch (multiple conditions) based on your needs.

Define the expression

Create the logical expression using our intuitive builder with data browser and operators.

Configure branches

Add actions to each branch. Each branch can contain multiple steps and even nested conditions.

Set up merge point

Configure where branches should rejoin to continue the workflow (optional).


Building Expressions

Condition Builder

Condition expressions are logical statements that evaluate to true or false. Wakflo’s expression builder makes creating them simple.

Data Browser

Access data from previous steps, triggers, and variables with autocomplete

Smart Operators

Comparison and logical operators with inline documentation and examples

Live Preview

Test expressions with sample data and see results in real-time

Comparison Operators

OperatorSymbolDescriptionExample
Equals=Checks if values are equalorder.status = “shipped”
Not Equals!=Checks if values differstatus != “cancelled”
Greater Than>Checks if left value is greaterorder.total > 100
Less Than<Checks if left value is lessinventory < 10
Greater or Equal>=Greater than or equal tocustomer.orders >= 5
Less or Equal<=Less than or equal tostock <= reorder_level
ContainscontainsString/array contains valuetags contains “sale”
Starts WithstartsWithString starts with valueemail startsWith “vip”
Ends WithendsWithString ends with valuefile endsWith “.pdf”

Logical Operators

OperatorSymbolDescriptionExample
AndANDBoth conditions must be truetotal > 100 AND vip = true
OrOREither condition can be trueinventory < 5 OR restock = true

Real-World Examples

Copy and adapt these practical examples for your own workflows.

Order Processing

High-Value Orders
order.total > 500

Route high-value orders for special handling or manual verification

International Shipping
NOT (country = “US” OR country = “CA”)

Identify international orders needing customs documentation

Special Product Handling
anyOf(items, i => i.assembly = true)

Detect orders needing assembly instructions

Ready to Fulfill
payment = “paid” AND status = “unfulfilled”

Identify paid orders ready for shipping

Inventory Management

Low Stock Alert
qty <= threshold AND NOT reordered

Trigger reordering when stock falls below threshold

Out of Stock
qty = 0 AND backorder = false

Update availability and notify customers

Seasonal Check
tags has “seasonal” AND days < 30

Identify products for clearance

Warehouse Routing
zip startsWith “9” AND weight < 20

Route west coast orders to local fulfillment

Customer Management

VIP Detection
lifetime_value > 1000 OR orders > 10

Identify high-value customers for VIP treatment

Re-engagement
daysSince(last_order) > 90 AND consent = true

Target inactive customers with special offers

Support Priority
plan = “enterprise” OR value > 5000

Prioritize enterprise customer tickets

Birthday Promotion
birthday = today AND consent = true

Send personalized birthday offers


Advanced Patterns

Techniques for building sophisticated decision logic in your workflows.

Nested Conditions

Nested Conditions
Multi-Level Decision Trees

Create complex decision trees by placing conditions inside other condition branches.

1

First-level condition evaluates primary criterion

2

Second-level conditions evaluate further

3

Each branch can have its own nested conditions

💡

Example: Route by country → order value → product type

Parallel Conditions

Parallel Conditions
Independent Evaluations

Multiple independent conditions that evaluate different aspects simultaneously.

||

Each condition operates independently

Different aspects branch separately

🔀

Results don’t depend on each other

💡

Example: Check inventory, payment, and fraud detection simultaneously

Loop with Conditions

Loop with Conditions
Iterative Decision Making

Combine loops and conditions for powerful iterative processing.

Loop through collection of items

?

Apply conditions to each item

Take different actions based on properties

💡

Example: Process order items based on category or stock status


Best Practices

Follow these guidelines to create maintainable, reliable conditions.

Keep It Simple

Break complex conditions into multiple simpler ones for better readability

Name Clearly

Use descriptive names like “Check High-Value Order”

Handle All Cases

Account for all scenarios including edge cases

Check Data Types

Compare numbers with numbers, strings with strings

Test Thoroughly

Test with various data to ensure correct behavior

Use Default Paths

Always include “else” paths for unexpected scenarios

Document Logic

Add comments explaining complex condition reasoning

Validate Input

Check data exists before using it in conditions


Debugging Conditions

When conditions don’t behave as expected, use these debugging techniques.

Enable condition logging

Turn on detailed logging in workflow settings to capture evaluation details and execution paths.

Use test mode

Run the workflow with sample data to see condition evaluation results in real-time.

Check visualization

View visual indicators showing which path was taken during execution.

Inspect data values

Compare actual data values against your condition criteria using the data inspector.

Simplify for testing

Temporarily simplify complex conditions to isolate issues.

💡

Use the Condition Debugger tool to step through evaluation and see exactly how expressions are evaluated with your data.


Common Issues

Type Mismatches

Comparing values of different types (string “100” vs number 100)

Use toNumber() or toString() to convert
Check types with isNumber() or isString()
Missing Data

Condition fails because expected data is null or undefined

Use isEmpty() to check if data exists
Provide defaults: value || defaultValue
Logic Errors

Condition logic doesn’t match intended business rules

Review operator precedence (AND, OR, NOT)
Use parentheses to clarify complex expressions
Case Sensitivity

String comparisons fail due to case differences

Convert both sides: toLowerCase() or toUpperCase()
Normalize strings before comparison

Keep Learning

Now that you understand conditions, explore these related topics to enhance your skills.

Ready to Build?

Start creating powerful conditional workflows today! Use the examples and patterns in this guide as templates for your own automations.

💡 Pro Tip: Start simple and gradually add complexity as you become more comfortable with conditions.

Last updated on