Act on outside data
Business rules engine: what it is, and when you need one

A business rules engine keeps your rules (pricing limits, approvals, checks) outside the code, so your own team can change them. Every change is logged, and the rule takes effect without a software release.
Most companies run on rules. "Discounts above 15% need approval." "Orders from new customers wait for a credit check." The trouble is where those rules live: buried in code, or in someone's head.
Rules in code vs rules in an engine
Rule in the code
Raise a ticket. Wait for a developer. Test. Release. Nobody outside IT can read the rule.
Rule in an engine
The owner edits the rule. A second person approves. It is live and logged. Anyone can read it in plain words.
Try a rule
Move the slider to change the rule. See which orders get sent for approval.
When you need one
- Your rules change more often than your software releases.
- Business people know the rule, but only developers can change it.
- The same rule is copied in several systems, and they drift apart.
- Auditors ask which rule was in force on a given day, and nobody can say.
How to choose a business rules engine
- Can a business user read and edit a rule in plain words?
- Does every change need a second person to approve it?
- Is every change logged, with the version that was live on each day?
- Can rules use your real data, such as customers, prices and margins?
- Can it run inside your own environment?
Examples of business rules
Finance
Discounts above a set level need approval. New customers wait for a credit check.
Procurement
Orders above a limit need two approvals. New suppliers need verified bank details.
Pricing
When cost changes, recalculate the price. Never sell below a set margin.
Compliance
Check every new party against sanctions lists. Hold data that fails a quality rule.
Four kinds of rules
- Validation: is this allowed? "A GSTIN must have 15 characters."
- Calculation: what is the value? "Landed cost is cost plus freight plus insurance plus duty."
- Routing: who decides? "Margins under 15% go to finance."
- Eligibility: who qualifies? "Only customers with a clean payment record get credit."
Rules engine, workflow tool or code?
| Hard-coded | Workflow tool | Rules engine | |
|---|---|---|---|
| Who changes a rule | Developers | Process admins | The business, with approval |
| Best at | Rules that never change | Moving tasks between people | Decisions that change often |
| History of changes | In code commits | Partial | Every version, by date |
How to move rules out of code
- Find the rules. Ask each team which decisions they make the same way every time.
- Write each one in plain words, with an example.
- Give each rule an owner who approves changes.
- Write test cases: for this input, the rule must give this answer.
- Move the rules into the engine one area at a time, starting with the one that changes most.
Testing and versions
Every rule change should be tested before it goes live. A good engine lets you run a new rule against past cases to see what would have changed. It keeps every version, so you can answer an auditor's question: "Which rule was live on 3 March?"
Common mistakes
- Too many tiny rules. Hundreds of overlapping rules are as hard to follow as code.
- No owners. Rules nobody owns are never updated.
- No tests. A wrong rule applied instantly can do damage instantly.
- Rules on bad data. A perfect rule on a duplicated customer list still gives wrong answers. Fix the record first.
A worked example: a tariff change, end to end
- A duty rate changes overnight through an official notification.
- The new rate reaches your systems and updates landed cost for the affected products.
- The margin rule runs: any open quote now below the floor is flagged.
- The routing rule sends those quotes to the finance owner for one decision.
- Finance approves new prices. Every step is logged with the rule versions used.
No developer was involved, and nobody had to notice the change first. The rules did the noticing.
Rules as guardrails for AI
As companies let AI agents take actions, rules matter more. An agent can draft a price change, but a rule decides whether it needs approval. Rules give AI clear limits, written in words people can read, and a log of what was allowed and why.
Decision tables, in one minute
Many rules are easiest to read as a small table. For example: rows for customer type, columns for order size, and in each cell who approves. Business people can read and check a table far more easily than code.
Key terms
- Ruleset: a group of related rules, such as all pricing rules.
- Rule version: one saved state of a rule, with the date it went live.
- Effective date: the date a rule starts to apply.
- Decision table: a grid showing which outcome applies for each combination of inputs.
Where Samvrik fits
Assembler is Samvrik's rules and action layer. Your team writes rules in plain terms, changes go through approval, and every action is logged in a full audit trail. Rules run on the one record kept by Smelter, inside your own environment. See how Assembler works.
Common questions
What is a business rules engine?
Software that keeps business rules outside the code, so the business can change them without a developer.
When do you need a business rules engine?
When rules change often, only developers can change them, or auditors ask which rule was live on a given day.
Are rule changes logged?
In a good engine, yes: every change is approved and logged, with the version that was live on each day.
What is the difference between a rules engine and a workflow tool?
A rules engine decides (approve, reject, calculate). A workflow tool moves the work between people. Many companies use both.
How do you test a business rule?
Write test cases that say what answer the rule must give for a given input, and run new versions against past cases before they go live.