Skip to content
ProcessIQ

Designing workflows

How to route requests with conditions and branches

Use a Condition step to send requests down different routes by amount, type or any other form answer.

Last updated

A Condition step reads the request's form answers and picks one route. Typical uses are extra approval above an amount, a different approver by department, or skipping a step for low-risk requests.

Add a condition

  1. In the Add node palette, select Condition and connect the previous step to it.
  2. Draw a connection from the condition to each possible next step. You need at least two.
  3. Select the first connection. In the Condition box, enter a rule such as form.amount > 10000.
  4. Repeat for each other rule-based connection.
  5. Select one connection and tick Default branch (used when no other condition matches). It carries no rule.
  6. Select Validate to confirm every route is complete.

Write the rules

Rules use the same small language everywhere in ProcessIQ. Refer to a form answer as form. followed by its field Key, not its label. Compare select answers with the option's value. Combine tests with && (and), || (or) and ! (not).

form.amount > 10000
form.type == 'travel' && form.days > 5
form.department in ['Finance', 'Legal']
contains(lower(form.reason), 'urgent')

Available comparisons are ==, !=, <, <=, > and >=, plus in for a list. Helper functions are len, contains, lower and isEmpty. The full list is in the expressions reference.

Example: purchase requests

Suppose finance must approve purchases above 10,000, and the finance director must approve those above 50,000. Draw three connections from the condition. The first has the rule form.amount > 50000 and leads to the director's approval. The second has form.amount > 10000 && form.amount <= 50000 and leads to the finance manager's approval. The third is the default and leads straight to the purchasing task. The two rules cannot both be true, so their order never matters.

How a route is chosen

  • Branches with a rule are tested in turn. The first rule that is true wins.
  • If none is true, the Default branch is used, so every request always has a route.
  • Make rules mutually exclusive where you can, so the order never matters.

What the validator checks

A condition needs at least two outgoing branches, exactly one default, and a valid rule on every other branch. A rule that names a field not on the form is an error. Publishing is blocked until these are fixed.

Rules can also hide or require form fields: see conditional and calculated fields. For an overview, read conditions and parallel branches.

Try ProcessIQ yourself

Start a free trial or open the shared demo organisation with a test account for every role.