Decision Step
The Decision step lets your workflow take different paths based on conditions. Think of it as an "if/then" branch -- the workflow checks a value or rule and follows the matching path.
Configuring the Decision Step
Click on the Decision step in the canvas to open the properties panel on the right side. The most important choice is the decision type, which controls how the branching logic works.
Decision Types
There are three ways to set up branching:
1. Expression
Use Expression when you want to match a single value against a list of possible outcomes. For example, if a field called "status" can be "approved", "rejected", or "pending", you create a case for each value and connect it to the right path.
How to set it up:
- Set the decision type to Expression.
- Add a case for each possible value (for example, "approved", "rejected", "pending").
- Connect each case to the step that should follow.
2. Decision Tree
Use Decision Tree when you need to check conditions -- like "is the amount greater than 10,000?" or "is the department Finance AND the amount over 5,000?". You can combine multiple conditions using AND/OR logic.
How to set it up:
- Set the decision type to Decision Tree.
- Add one or more cases. For each case, build a condition by choosing:
- A left value (for example, a field from the form data).
- An operator (equals, greater than, less than, etc.).
- A right value (the value to compare against).
- Optionally add a default case as a fallback when nothing else matches.
- Connect each case to the step that should follow.
Available operators:
| Operator | Meaning |
|---|---|
| eq | Equals |
| ne | Does not equal |
| gt | Greater than |
| gte | Greater than or equal to |
| lt | Less than |
| lte | Less than or equal to |
| in | Is one of a list of values |
| nin | Is not one of a list of values |
| ns | Is empty (null) |
| and | All sub-conditions must be true |
| or | At least one sub-condition must be true |
3. Decision Table
Use a Decision Table when you have many rules that are easier to manage in a table format. Instead of building conditions one by one, you point to an external decision table model that contains all the rules.
How to set it up:
- Set the decision type to Decision Table.
- Select the decision table model.
- Set up input mappings to send values from the workflow into the table (for example, customer type and request amount).
- Set up output mappings to bring the result back into the workflow (for example, a risk level).
- Add a case for each possible output value (for example, "High Risk", "Medium Risk", "Low Risk").
- Connect each case to the step that should follow.
Value Types
When building conditions in a Decision Tree, the values on each side of a comparison can come from different sources:
| Source | What it is |
|---|---|
| Context | A value from the running process, like a form field or process data. |
| Literal | A fixed value you type in directly (for example, the number 10000). |
| Input | A workflow input variable. |
| Output | A workflow output variable. |
| Constant | An environment-level constant. |