Act on outside data

Business rules engine: what it is, and when you need one

16 Oct 20266 min readAll insights
Business rules engine: what it is, and when you need one
The short answer

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

Infographic · Changing one rule

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.

The rule is the same. Who can change it, and how fast, is not.

Try a rule

A live margin ruleInteractive · Example data

Move the slider to change the rule. See which orders get sent for approval.

WHEN landed cost changes IF margin falls below THEN send to finance
Order 1041Margin 22%
Order 1042Margin 17%
Order 1043Margin 12%
Order 1044Margin 9%
Order 1045Margin 26%

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

  1. Can a business user read and edit a rule in plain words?
  2. Does every change need a second person to approve it?
  3. Is every change logged, with the version that was live on each day?
  4. Can rules use your real data, such as customers, prices and margins?
  5. Can it run inside your own environment?

Examples of business rules

Infographic · Rules in every department

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.

Every company already has these rules. The question is where they live.

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?

Infographic · Three ways to run rules
Hard-codedWorkflow toolRules engine
Who changes a ruleDevelopersProcess adminsThe business, with approval
Best atRules that never changeMoving tasks between peopleDecisions that change often
History of changesIn code commitsPartialEvery version, by date
Many companies use a rules engine and a workflow tool together: one decides, the other moves the work.

How to move rules out of code

  1. Find the rules. Ask each team which decisions they make the same way every time.
  2. Write each one in plain words, with an example.
  3. Give each rule an owner who approves changes.
  4. Write test cases: for this input, the rule must give this answer.
  5. 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

  1. A duty rate changes overnight through an official notification.
  2. The new rate reaches your systems and updates landed cost for the affected products.
  3. The margin rule runs: any open quote now below the floor is flagged.
  4. The routing rule sends those quotes to the finance owner for one decision.
  5. 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.