No Case DML in the engine
The action returns a decision; Flow retains control of the transaction and record updates.
A deterministic Invocable Apex contract for routing requests by type, product, risk and active metadata rules—without hiding orchestration inside code.
Sample build using synthetic data in a Developer Edition org. Created to demonstrate architecture and delivery approach; not presented as client work.
DemoCo routing has enough combinations, fallbacks and tie-breaks that adding branches to Flow makes the decision difficult to test and change safely.
Choose a scenario, play the full path or inspect any decision directly. This is an explainable frontend model, not a live Salesforce connection.
A list of Case IDs enters a bulk-safe invocable method.
Cases, active rules and queue references are loaded once into maps.
Eligible rules are scored and sorted with a deterministic tie-break.
Each input receives ROUTED, FALLBACK, NEEDS_INPUT or ERROR plus safe context.
Non-critical audit events are persisted outside the routing decision.
The action returns a decision; Flow retains control of the transaction and record updates.
The contract preserves order and makes partial input problems explicit instead of failing the batch opaquely.
Metadata makes rules changeable, not automatically safe; missing queues return controlled errors.