Router
Category: Control
Node id: router
Routes data to different outputs based on configurable rules with multiple operator support
What it does
- 20+ comparison operators including regex matching
- Ordered rule evaluation with first-match semantics
- Default route fallback when no rules match
- Data passthrough to preserve original input
- Named rules for debugging and audit trails
Use cases
- Route HL7 messages to different processors by message type
- Direct FHIR resources to type-specific handlers
- Implement content-based routing in integration pipelines
Runtime
- Performance tier:
fast
Input ports
| Name | Type | Required | Description |
|---|---|---|---|
data | json | Yes | Input data to evaluate routing rules against |
Output ports
| Name | Type | Required | Description |
|---|---|---|---|
route | text | No | The matched route name |
result | json | No | Routing metadata: matched_rule index and rule_name |
passthrough | json | No | Original input data — always present regardless of which route matched |
success | boolean | No | Whether routing completed without error |
Settings
Basic
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| Rules | rules | array | Yes | Ordered array of routing rules; each rule has field, operator, value, and route | ||
| Default Route | default_route | string | No | default | Route used when no rules match |
Errors
| Code | Description |
|---|---|
INVALID_RULES | Rules configuration is missing or not an array |
UNSUPPORTED_OPERATOR | A rule uses an unrecognized comparison operator |
Runtime notes
- DYNAMIC PORTS: Each rule's 'route' value becomes an output handle at runtime. The frontend derives these handles from config.rules[*].route.
- Rules are evaluated in order; the first match wins. The matched route port carries the original input data.
- The executor reads _hydra_active_ports to skip all downstream nodes NOT on the matched route.
- When no rules match, the default_route port is activated. Configure default_route to control the fallback path.
- Static ports (route, result, passthrough, success) are always emitted regardless of which rule matched.
See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.
Quelque chose n'est pas clair ? Envoyez vos commentaires sur la documentation par courriel.