sourcePort.
An edge with no sourcePort receives every port except error. A message on a port with no listening edge is dropped, so wire every port you care about.
Steps
1
Branch on a value
BRANCH in its default mode SELECT_KEY evaluates selector and looks the result up in cases; each case names an output port. defaultPort catches the rest. Save as router.json:router.json
cases, plus defaultPort. A case that routes to a port with no outgoing edge fails validation.2
Branch on a condition instead
With The syntax is in the Expressions reference. With
mode: EXPRESSION, each case key is a predicate and the first one that is true names the port:strictMode on (the default) a message that matches nothing and has no defaultPort fails the node; allowMultipleMatches emits on every matching case.3
Route on how a command or request went
PROCESS_EXECUTOR with "failureMode": "CONTINUE", "routeByExitCode": true leaves on success or failure; HTTP_REQUEST does the same with "routeByStatus": true. Wire "sourcePort": "success" and "failure".4
Filter, validate, fan out
FILTERpasses messages that matchconditionand drops the rest.VALIDATEsends messages that fail to itsinvalidport.RECIPIENT_LISTsends one message to several recipients, each recipient a port, optionally in parallel.- To send the same message to several nodes without choosing, give the node several edges without
sourcePort: every child receives every message.
5
Route failures and rejoin branches
With
"onError": "ROUTE" in a node’s engine object, a message that fails all its attempts leaves on the error port: { "source": "classify", "target": "dead-letter", "sourcePort": "error" }. See Handle failures. Several branches may lead into one node; when it has several parents its engine.trigger join rule decides what a failed branch means.Verify it worked
RESULT event comes from node bugs. Start again with "kind":"idea" and it comes from other. To check the wiring before running, validate the workflow: the answer lists each node’s output ports (Validate and roll back).
Variations
- Exact options for every routing plugin. Routing and flow reference.
- Route on an AI decision.
CLASSIFYwrites its choice to a port: Classify, gate and score.
Related
- How Yukta works for nodes, edges and ports.
- Failure model for join rules and error routes.