Decision Activity
Purpose: Evaluate a Boolean condition to determine which path to execute next. This is the flowchart version of the If activity, designed for use in flowchart-based workflows.
Input Properties
The Boolean condition to evaluate. If true, execution follows the "True" outcome path; if false, execution follows the "False" outcome path.
Type: bool
Default: false
Required: Yes
Note: Can be a literal boolean, expression, or variable reference. Supports all Elsa expression syntaxes.
Output Properties
This activity has no output properties. It completes with either "True" or "False" outcome.
Outcomes
The outcome path when the condition evaluates to true.
Note: Connect activities to this outcome path to execute when the condition is true.
The outcome path when the condition evaluates to false.
Note: Connect activities to this outcome path to execute when the condition is false.
Usage Example
Scenario: Check if a value is greater than 10 in a flowchart
Configuration:
- Condition: "{{ Variables.Count > 10 }}"
- True outcome: Connect to WriteLine activity with text "Count is high"
- False outcome: Connect to WriteLine activity with text "Count is low"
Result:
- If Count > 10: "Count is high" is written (True path)
- If Count <= 10: "Count is low" is written (False path)
- Execution continues along the selected path
Important Notes
- Decision is designed for flowchart-based workflows
- The condition is evaluated once at the start of the activity
- Decision completes with either "True" or "False" outcome
- Only one path (True or False) is executed based on the condition result
- You can use complex expressions in the Condition property
- Both True and False outcome paths should be connected in flowcharts
- For non-flowchart workflows, use the If activity instead
- Decision uses the FlowNode attribute to define its outcomes
Related Activities
- If - Similar functionality for non-flowchart workflows
- Switch - Evaluate multiple case conditions (for multiple branches)
- FlowSwitch - Flowchart version of Switch activity
- FlowDecision - This is the technical name for Decision activity