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 namedpriority and produces one of three outcomes:
urgent→ immediate-review branchstandard→ normal-processing branch- anything else → manual-triage branch
1. Add the input
Add a Flow Input block with a text field namedpriority.
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 connectpriority 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.
6. Test every path
Run the workflow with:urgentstandardURGENT- an empty value
- an unsupported value
- a value that contains the expected word but should not match