Skip to main content

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​

NameTypeRequiredDescription
datajsonYesInput data to evaluate routing rules against

Output ports​

NameTypeRequiredDescription
routetextNoThe matched route name
resultjsonNoRouting metadata: matched_rule index and rule_name
passthroughjsonNoOriginal input data — always present regardless of which route matched
successbooleanNoWhether routing completed without error

Settings​

Basic​

SettingNameTypeRequiredDefaultAllowed valuesDescription
RulesrulesarrayYesOrdered array of routing rules; each rule has field, operator, value, and route
Default Routedefault_routestringNodefaultRoute used when no rules match

Errors​

CodeDescription
INVALID_RULESRules configuration is missing or not an array
UNSUPPORTED_OPERATORA 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.

Something unclear? Send documentation feedback by email.