In a workflow, a condition is an automated decision based on rules:
If one or mutliple rules are met,the output is true.
If not, the output is false.
Based on this principle, conditions route documents within the workflow to tasks or any other action allowing precise control over the direction and handling of each action.
Example: The incoming invoices of a company are processed based on their amount. The rule for this decision is “Amount > 10.000”. If the amount of an invoice exceeds €10.000, the condition is met (true). In this case, the invoice is routed to a Senior Manager for approvement. If the invoice is below the threshold of €10.000, the condition is not met and the invoice directed to team level.
Conditions are created in the Workflow Designer canvas. To define a condition, follow these steps:
1. Add a condition
You have two options to a add a condition in a workflow - as action of the type Condition or as conditional output. For both options, enter a specific title for the condition, because the condition name will be visible in the Web Client as a part of the workflow history.
To add a condition as action, go the to the left sidebar and click Condition.
Conditional output is defined within a Trigger or in an action like Task, Assign Data. Find the conditional output in the Output area an action.
Comparing conditional output and condition as action
The output of a condition as an action and of conditional output is the same. Which option fits better, depends on the workflow and your preference. Consider the following aspects:
Representation on the canvas: The condition action is shown as a separate, distinct workflow element. Conditional output, on the other hand, is listed in the settings of an action or of the trigger.
So, if an automatic decision is a crucial part of a workflow, it may be useful to mirror this on the canvas with a condition as a distinct action.
However, if the workflow includes a lot of actions, the use of a conditional output reduces visual clutter and makes the configuration easier to read.
Condition as action - “Route invoice” is a distinct action in the workflow configuration.
Conditional output: The rules for routing are integrated in the trigger settings.
Search in canvas: You can search for a condition action in the workflow list view.
Workflow history: Both a condition action and an action with conditional output would be visible in the workflow history.
Conditional behavior: In a condition action, a basic condition is created, which returns “True” or “False” and routes the document in the workflow. For both results “True” or “False”, you may chain multiple conditional outputs, which are validated AFTER the first condition has been checked and will exit to the first conditional output which results to True.
2. Set a condition
A condition is based on the index data of the current workflow document.
To specify the condition you define the index data, that needs to be met:
In the Condition dialog, click Set conditions to define the rule.
Combine conditions and condition groups to handle the most common scenarios.
Read more about Filtering documents based on index criteria
Alternatively, you can use expressions to cover more complex use cases.
To do so, click Set conditions > Advanced query.
Read more about using expressions in a workflow configuration
Read more about Workflow Expression Parser
3. Name the outputs
A condition always has two outputs, true and false. The outputs determine the next step based on whether the condition is met or not.
To keep a workflow clear, it is recommended to rename the outputs.
Example: For routing an invoice, “<10.000” and “>10.000” are easier to understand than “Then” and “False”.
The output names are not visibile in the Web Client.
If you use the condition as an action you may even select a color to represent the "Then" and “False” connectors in the canvas.
4. Connect conditional output with actions
Connect the conditional output with other workflow actions to route the document.
Drag the connector lines from the output port to the input ports of an action - see here how it is done in detail:
See here How to connect actions
5. Handle errors in a condition
If the condition causes an error, it can unexpectedly pause the workflow, holding back the document.
To prevent unnecessary loops, specify the error handling in the conditions settings:
In the condition action go to the Errors tab.
Choose an option:
No error handling
Restart workflow
End workflow
Go to step
Read more about the error handling