Add a Condition action when the workflow must choose which path to follow based on workflow data.
A Condition evaluates an expression for each configured branch and continues along the matching path. Only the selected branch continues; other branches aren't run for that evaluation.
For an overview of workflow actions, see Understand workflow actions. For a summary of Condition behavior, see Workflow actions reference. For help writing comparison expressions, see Use expressions in workflows and agent tools.
Before you begin
Make sure you have:
- A workflow open in the designer with a configured Start action.
- The Experience Designer or Tenant administrator role.
- The data you want to evaluate available as a workflow input, action output, or state variable.
- A clear rule for each path the workflow can take after the decision.
When to use a Condition action
Use a Condition action when the workflow should:
- Branch approval or eligibility paths.
- Route by employee type, status, or another attribute.
- Skip actions that aren't needed for the current run.
- Handle different outcomes from an earlier Agent or Run Tool action.
Don't use Condition when you need conversational clarification from the employee. Use an Agent action to collect or clarify the information first, then use Condition to evaluate the resulting data.
Add a Condition action
- Open the workflow in the workflow designer.
- From the Actions palette, add a Condition action.
- Connect it to the previous action.
- Select the Condition action to open the node editor.
- Enter a clear Name so the canvas is easy to understand later.
For example: Validate job profile
- Configure the branches the workflow can take:
- Add or edit a named branch for each rule you need, such as Executive profile or Eligible.
- For each non-default branch, enter an expression that evaluates to true when that branch should run. Type @ to open the variable picker and insert workflow data, then complete the comparison.
For example:
$.inputs.employeeType = 'Manager'
- Keep the Default branch for cases that don't match an earlier branch. Connect the Default path to the actions that should run when no other branch matches. You can leave it intentionally empty if that outcome is valid for your design.
- On the canvas, connect each branch exit to the next actions for that path.
Changes save automatically.
How branches work
| Element | Purpose |
| Named branch | A path that runs when its expression is true |
| Expression | A JSONata comparison or Boolean expression over workflow data |
| Default | The path used when no named branch matches |
Expressions are evaluated at runtime. Only one selected branch continues for a given evaluation.
Example expressions
| Goal | Example expression |
| Match a text value | $.inputs.employeeType = 'Manager' |
| Check a numeric threshold | $.LeaveBalance.daysRemaining >= 1 |
| Check that a value exists | $exists($.ManagerApproval.status) |
For available operators and functions, see Expressions reference.
Next steps
- Connect each branch to the actions that should run on that path, such as Run Tool, Agent, or another Condition.
- If you need to reuse the decision later, store a value with a Set State action on each path.
- Test the workflow with data that reaches every branch, including Default.
- Publish the workflow when the design is ready.