Externalize complex branching logic — pricing tiers, eligibility rules, routing decisions — into a readable table that business users can maintain without a developer in the loop.
Rendering diagram…
Use a decision table whenever:
Classic examples: pricing tiers, shipping cost rules, fraud scoring thresholds, approval routing, lead scoring, eligibility checks, plan benefits.
If your if/else tree in code is getting commits from multiple people every week, that's a decision table screaming to be born.
A decision table has:
The DMN standard formalises this with a FEEL expression language. You don't need a DMN engine to use the pattern — a versioned CSV and a tiny evaluator will get you 80% of the value.
Picking the wrong hit policy is the most common bug. Start with Unique — it screams the moment you have overlapping rules.
List every variable that could influence the decision. Be generous up front — it's easier to delete a column than to add one later when you have 200 rows.
Don't start in code. Put the table in a sheet where the business owner can see it and poke at it. Iterate until they agree the rules match reality.
For each decision, pick the one that matches your intent. "Unique, fail loudly if multiple match" is a reasonable default.
If you're not using a DMN engine, a 50-line evaluator will do. Inputs in, rows checked in order, matching rows' outputs returned per the hit policy. Write thorough tests; this is business-critical logic.
Every change to the table is a diff. Treat the table like code: PRs, review, deploy pipeline. If a non-engineer edits it, the PR should explain why in plain language.
Record inputs, matched row(s), and output for each call. When a customer asks "why was I charged this?", the log answers. When the rules change, the log lets you replay the old rules against today's data.
Periodically review who has access to what, confirm it's still needed, and revoke what isn't. Kills the slow-drip accumulation of stale permissions that turn into audit findings.
Record every significant action to an append-only log that can be inspected but not altered. Essential for compliance, incident response, and answering 'who changed this and when?'
Enforce mandatory review and documentation at specific points in a process to meet regulatory, legal, or internal policy requirements. Non-negotiable gates that cannot be bypassed.