Condition operators
Learn how to use condition operators in your workflows.
Conditions in workflows
Condition operator is a fundamental component that allows you to control the flow of your workflows based on specific conditions or criteria. It acts as a decision-making point within your workflow, determining the path the workflow will follow based on the evaluation of a condition.
Condition operator allows you to implement complex decision-making logic within your workflows. It enables you to create conditional branches, perform data filtering, and execute different sets of actions based on the evaluated conditions.
Condition operator evaluates a condition or expression and branches the workflow into two different paths: one for the true
outcome and another for the false
outcome. The condition can be defined using various operators and comparisons to assess the values or variables involved.
When the condition evaluates to true, the workflow proceeds along the true
path, executing the subsequent nodes or actions defined in that branch. On the other hand, if the condition evaluates to false
, the workflow follows the false
path and executes the nodes or actions associated with that branch.
With a condition operator, you can build workflows that dynamically respond to changing conditions, automate decision-based processes, and streamline your data flow and operations. Condition operators provide the flexibility and control necessary to create smart workflows that adapt to various scenarios and requirements.
Using data to build conditions
Data from inputs
If your workflow is initiated with a manual trigger and if your trigger has inputs, you can access the values of inputs at workflow execution with input
notation.
You can type input.amount
to get the value entered for amount
input and compare it with your value.
Data from events
If your workflow is triggered with an event (integration or webhook), you can access the trigger event
notation.
For example, event.body.event.body.order.item.type
returns the type
of the ordered item in the event payload.
Data from actions in your workflows
You can use the responses of actions in your workflows. To access the data of an action result, start typing nodes
and then the alias of your action.
For example, nodes.action0.response
returns the response
of action0
.
Condition types
All events: When selected, the workflow will match every data that's evaluated against it and proceed to executing true
branch. No specific condition is specified when this option is selected.
One or more conditions below: When selected, if any one of the conditions are satisfied, it's sufficient to proceed to executing the true
branch.
All conditions below: When selected, if all of the conditions are satisfied, it's sufficient to proceed to executing true
branch. If any of them fails, false
branch is executed.
Advanced mode: In advanced mode, you can write a JavaScript function that returns true
or false
. This feature allows for more complex condition defining in your workflows. If the function evaluates to true
, the workflow proceeds to execute the true
branch. If it evaluates to false
, the workflow proceeds to executed the false
branch.
Functional operations
Operation | Description |
---|---|
Equals | Compares the values of String, Boolean, and Number variables. Returns true if the values are equal. |
Does not equal | Compares the values of String, Boolean, and Number variables. Returns true if the values are not equal. |
Contains | Checks if a String variable contains the expected substring. Returns true if the value contains it. |
Does not contain | Checks if a String variable does not contain the expected substring. Returns true if the value does not contain it. |
Starts with | Determines if a String variable starts with the expected value. Returns true if it does. |
Does not start with | Determines if a String variable does not start with the expected value. Returns true if it does not. |
Ends with | Checks if a String variable ends with the expected value. Returns true if it does. |
Does not end with | Checks if a String variable does not end with the expected value. Returns true if it does not. |
Is empty | Checks if a String or Array variable is empty. Returns true if it is empty. |
Is not empty | Checks if a String or Array variable is not empty. Returns true if it is not empty. |
Is one of | Checks if a variable is one of the elements in the specified array. Returns true if it is in the array. |
Is not one of | Checks if a variable is not one of the elements in the specified array. Returns true if it is not in the array. |
Greater than | Compares the values of Number variables. Returns true if the value is greater than the expected value. |
Less than | Compares the values of Number variables. Returns true if the value is less than the expected value. |