Skip to main content

Route work with conditions

This tutorial builds a simple intake router. Requests with a recognized priority follow the correct branch; unknown values are sent for review.

What you will build

The workflow accepts a text value named priority and produces one of three outcomes:
  • urgent → immediate-review branch
  • standard → normal-processing branch
  • anything else → manual-triage branch

1. Add the input

Add a Flow Input block with a text field named priority.

2. Normalize the value

If values can arrive with inconsistent capitalization or whitespace, normalize them before matching. You can use a Code block or another transformation appropriate to your workflow.

3. Add matching logic

Add a Match block and connect priority to its test input. Define patterns for the supported values: Use anchored patterns so values such as not-urgent do not match accidentally.

4. Handle the fallback

Connect the unmatched output to a manual-triage branch. A production workflow should define what happens when input is missing, unsupported, or ambiguous rather than silently discarding it.

5. Add branch outputs

Add a Text block to each branch:
  • Immediate review: Route to the priority review queue.
  • Normal processing: Continue through the standard process.
  • Manual triage: Request a valid priority or send for human review.
Connect the branches to a Flow Output block.

6. Test every path

Run the workflow with:
  • urgent
  • standard
  • URGENT
  • an empty value
  • an unsupported value
  • a value that contains the expected word but should not match
Confirm that each input follows exactly one intended path.

Matching or a boolean condition?

Use a Match block when routing text against patterns. Use If/Else or Switch when a previous step already produces a boolean value. See Match, If/Else, and Switch for complete field references.
Do not use generated text as the sole basis for high-impact decisions. Add deterministic validation and human approval where the process requires judgment or authorization.