Metadata decision engine
A metadata-based decision engine supporting task processing and qualification automation.
Problem
Qualification and prioritization rules change often. Encoding them directly in triggers makes every change a code release and makes behaviour hard to reason about.
My contribution
- Built a metadata-based decision engine and configurable decision logic for lead/account qualification automation.
- Worked on qualification automation using Change Data Capture and enhanced task-trigger processing.
- Earlier roles included building Apex decision engines, so this pattern is a recurring one in my work.
Design
A synthetic reconstruction of the general pattern, not employer code.
- Change event captured
- Load ordered rules from metadata
- Evaluate conditions against record context
- Apply first or all matching outcomes
- Write result with reason
- Conditions and outcomes are data, evaluated by one small, well-tested engine.
- Each result records which rule fired, so behaviour can be explained and debugged.
Tradeoffs
| Choice | Benefit | Cost |
|---|---|---|
| Generic rule engine | New rules need no new code | Less expressive than bespoke logic; needs governance |
| Event-driven via CDC | Decouples qualification from the originating transaction | Eventual consistency and replay handling |
| Recorded rule reasons | Explainable outcomes for support and users | Extra storage and fields |
Demonstrated behavior
Planned demo (not yet built)
- Edit a synthetic rule and watch a sample record's outcome change
- See which rule fired and why
Technologies
- Apex
- Custom Metadata
- Change Data Capture
- Platform Events