Built.io Flow allows you to set conditions between two actions of your workflow. Using this functionality, you can define one or more custom conditions between two actions. The workflow proceeds to the next action only if the conditions are met.
Let’s understand how to use conditions in a workflow.
Step 1 - Create a workflow
First, start with creating a valid workflow. Here’s an example of how a valid workflow looks.
Step 2 - Set Conditions
To define conditions between two actions, click the line that connects the two actions, and select the ‘settings’ icon. This will open a new dialog where you can set conditions.
To specify a condition, you will need to enter the following details:
Input: Enter the input on which you wish to apply the condition. Here, you need to use the output of the previous action.
Condition: Select the condition operator that you wish to apply on the specified input data from the drop-down list. Learn more about various operators here.
Expected Value (Optional): Enter the output value that you wish to check against the specified input.
You can also specify multiple conditions by using 'AND' or 'OR' operators. Simply click on '+AND' or '+OR' link to use these operators.
Let's understand more about these operators with an example:
Step 3 - Use AND operator
This operator is used to specify a number of interrelated conditions. When all the conditions specified with 'AND' operator return 'True', then only the workflow will continue execution. If any of the condition returns 'false', the workflow will stop execution immediately.
In above example, if the specified input field returns a value that is both greater than 10 and less than 50, only then, the workflow will continue execution otherwise it will be terminated. Learn more about this operator here.
Step 4 - Use OR operator
This operator is used to specify a number of independent conditions. When any of the conditions specified with 'OR' operator return 'True', the workflow ignores the rest of the conditions and will continue with the workflow execution. If none of the conditions return 'True', only then the workflow execution will be terminated.
In the above example, the first condition checks if the input array is empty. If it returns 'True', then the workflow will ignore the second condition and will continue with the workflow execution. If it returns 'False', only then it will proceed to check the next condition and so on. Learn more about this operator here.