Flow Studio
Outcome-Based Routing
Connecting rule outcomes to workflow paths — defining outcome ports in outcomePortMap and drawing edges to separate approval, rejection, and review paths.
outcomePortMap Configuration
Define a port name per expected rule outcome. The executor fires the matching port key, and the canvas routes to the edge connected to that port:
{
"outcomePortMap": {
"approved": "approved",
"rejected": "rejected",
"manual-review": "review",
"escalated": "escalate"
}
}
Canvas Layout
RuleEvalNode (checkInvoicePolicy)
│
├── [approved] ──→ UpdateEntity (status=approved) → SendEmail (approved notification)
│
├── [rejected] ──→ UpdateEntity (status=rejected) → SendEmail (rejection + explanation)
│
├── [review] ──→ ApprovalNode (manual review queue)
│
└── [escalate] ──→ SendSlackMessage (#finance-escalation) → ApprovalNode (finance director)
Unmatched Outcomes
If the rule engine returns an outcome that is not in outcomePortMap, the executor routes to the main port. Connect the main port to a catch-all handler (e.g., an error notification or a manual review path) to handle unexpected outcomes gracefully.
Design tip: Keep the
outcomePortMap in sync with the rule set's declared possible outcomes. When the rules team adds a new outcome (e.g., "conditional-approval"), update the node config and connect a new edge on the canvas. Unhandled outcomes silently route to main — review your rule set documentation after any rule set update.