Business Rules Engine

What Business Rules Engine is: decision matrices, decision tables and expression sets, how they are invoked, limits, and when to use it over Flow or Apex.

Where do you keep a business rule that changes often, has hundreds of combinations and is used by several processes? In Salesforce, one answer is Business Rules Engine (BRE).

What Business Rules Engine is

Business Rules Engine is a suite of Salesforce services, components and objects. You use it to create business rules that perform complex lookups and calculations. Help proposes it for determining eligibility and automating complex decisions.

A process in another tool passes it the inputs, and BRE returns the outcome. That process can live in:

  • Flow, the Salesforce tool for automating without code. Each automation is a flow, built in Flow Builder.
  • OmniStudio, a set of features included with many Industries products, Salesforce’s industry clouds. Two of its components call it. Omniscripts guide the user through a complex process, without code. Integration Procedures are server-side processes that run several actions in one call.
  • Apex, Salesforce’s programming language, which runs on its servers.
  • Custom or third-party tools, through an API (application programming interface), such as the Salesforce REST (Representational State Transfer) API.

The rule stays separate from the flow: you define it once and use it in every process that needs it.

Components

BRE has two kinds of components: lookup tables and expression sets. Lookup tables come in two types: decision matrices and decision tables.

Decision matrix. It compares input values with the rows of a table. When it finds an exact match, it returns that row’s output values. Each row is a unique combination of inputs. A column can be a numeric range: each value marks the start of a range. It takes and returns JSON, a text format for exchanging data.

Decision table. It can return several results for the same inputs. It reads its rules from records of a standard object, a custom object or a custom metadata type, a type of custom metadata that is deployed and packaged. It allows different operators per column, such as “less than” or “contains”. There are standard tables, for complex rules, and advanced tables, for more volume.

Expression set. It is a series of steps that run in order and use variables, constants, conditions, calculations, lookups in lookup tables and aggregations. An aggregation applies SUM, AVG, MAX or MIN to several runs of the preceding steps.

Need Decision matrix Decision table
Exact match or ranges Yes Yes
Several results for the same inputs No Yes
Different operators per column No Yes
Rules stored in object records No Yes
Versions with a rank Yes Only CSV-based ones
Call from an Omniscript Yes No
Call from a flow Yes Yes

Expression set steps

Steps are chosen in Expression Set Builder, the visual editor:

  • Calculation: applies functions and mathematical operations.
  • Conditional Group: runs a group of steps if its condition is true.
  • Branch: opens up to six paths, each with its own priority. If no entry condition is met, it takes the default path, which has no condition.
  • Lookup Table: finds the matching row in a decision matrix or a decision table and imports its variables.
  • Subexpression: uses another expression set inside the version and receives its result.

Versions and activation

Each version of an expression set has a start date, a rank and, if needed, an end date. The rank is a number that decides between versions: when several active ones overlap in dates, the one with the highest rank wins. Decision matrices follow the same rule. If the call gives no effective date, today’s date is used.

An active version can’t be edited. To change it, you deactivate it or copy it with Save As, which saves it as a new version of the same expression set or of another one. Before activating, Simulate tests the version with test values.

Object-based decision tables have no versions; CSV-based ones can have them, with a rank. When first activated, BRE fills them with a full refresh, which can take several minutes. If the source object’s data changes, they must be refreshed.

How a rule answers

How Business Rules Engine answers a callFlow, OmniStudio, Apex or the REST API call an expression set with JSON inputs. The active version with the highest rank answers. Its steps run in order. A Lookup Table step queries a decision matrix or a decision table and receives the matching row. The expression set returns the result as JSON to the calling process.JSON inputsmatching rowFlow, Omnistudio,Apex or REST APIActive versionwith highest rankSteps in orderLookup Table stepDecision matrixor decision tableJSON resultto the process

Where it is invoked from

Flow. A flow calls BRE with an Action element. The Expression Sets or Decision Matrices category appears only when at least one active version exists. Building the flow needs the Manage Flow permission.

OmniStudio. Omniscripts and Integration Procedures use Expression Set Action and Decision Matrix Action. Building an Omniscript that calls an expression set needs the Omnistudio Admin permission.

Apex and REST API. The classes of the Invocable namespace call expression sets and decision matrices from Apex. Help warns that Apex runs in system context, overriding the user’s permissions. Over REST, each expression set has its own resource, called with POST. Custom or third-party tools invoke expression sets and lookup tables through BRE’s Connect APIs.

Licenses, permissions and editions

BRE runs in Lightning Experience, Salesforce’s current interface. It is available in Enterprise, Unlimited and Developer Editions, in clouds that have BRE enabled. A Salesforce document linked from Help names the Industries clouds, Revenue Cloud, Service Cloud and Salesforce Field Service.

A permission set license (PSL) entitles a user to a feature. A permission set is a collection of settings and permissions that extends access without changing the profile. The user needs both. BRE’s PSLs are three: Business Rules Engine Designer, Business Rules Engine Runtime and Business Rules Engine Runtime for Communities.

The permission sets are:

  • Rule Engine Designer: create, edit and delete expression sets and lookup tables.
  • Rule Engine Runtime: run and read them.
  • Community and guest profiles need Run Decision Matrices and Run Expression Sets.

Usage is measured in calls. Each call to an expression set or a lookup table counts as one, even if it processes several tables. The monthly maximum is shown in Setup, the org’s configuration, under Company Information. It is visible only in production.

Limits and considerations

Default values per “Business Rules Engine Default Limits” on 2026-10-09. A CSV (comma-separated values) file holds values separated by commas. The last two rows come, in order, from “Considerations for Preparing a CSV File for Upload” and from “Guidelines for Creating and Editing Decision Matrices”. Extensible limits are raised through Salesforce Customer Support.

Limit Value Extensible
Steps per expression set version 200 Yes
Subexpression levels 2 No
Expression set runs per hour 5,000,000 Yes
Matrices invoked per hour 400,000 No
CSV file per matrix version 100 MB No
Rows in a standard decision table 100,000 Yes
Active standard decision tables 20 Yes
Rows in an advanced decision table 20,000,000 Yes
Active advanced decision tables 100 Yes
Rows per CSV upload to a matrix 50,000 —
Rows visible in the matrix builder 1,000 —

Other considerations:

  • CSV headers have no spaces, because they become variables.
  • In numeric columns, 20 and 20.00 don’t match.
  • If two rows have the same inputs, only the first is saved.
  • The ranges of a numeric range column must be the same in every row.
  • An expression set reads only the first result of an object-based decision table.
  • Limit values are copied from production to each sandbox, the org’s copy for testing.

Example: card tier by age and segment

A bank wants to assign a card tier by the customer’s age and segment. The example is invented.

  1. Permissions. The designer gets Rule Engine Designer; the advisers, Rule Engine Runtime; whoever builds the flow, Manage Flow.
  2. Matrix. In the Business Rules Engine app, a Standard decision matrix is created under Lookup Tables. A CSV is uploaded with the headers Edad, Segmento and Tarjeta. Edad is a numeric-range input, Segmento a text input and Tarjeta the output.
  3. Rows. There are three ranges, starting at 0, 26 and 65, and two segments, Particular and Privada. The ranges are the same in both segments. That gives 3 × 2 = 6 rows. For Particular, the outputs are Joven, Clásica and Sénior; Privada has its own. Version 1 is activated from its actions menu, with Edit | Enabled.
  4. Expression set. One is created with the Default usage type. The usage type is the rule’s business application category; Default is used unless the cloud specifies another. Version V1 is created automatically. A Calculation step gets Edad with the AGE function, which calculates the age from a date, here the birth date. A Lookup Table step queries the matrix and imports its variables. Edad is mapped to the Calculation step’s output.
  5. Simulation. Simulate tests a Particular customer aged 30: the result is Clásica. One aged 26 also gets Clásica, because the range starts at 26. One aged 25 gets Joven. Then the version is activated.
  6. Flow. In Flow Builder, an Action element from the Expression Sets category calls the set with the birth date and the segment.
  7. Cut-off change. To move a cut-off, the bank uses New Version to create a matrix version from version 1, with its rows. It gives it a start date and a higher, unique rank. It changes the cut-off and activates the version with Edit | Enabled. From that date, the Lookup Table step uses the new version, the active one with the highest rank.

That the flow does not change is this page’s inference from that rule.

BRE, the Flow Decision element or custom metadata with Apex

The Flow Decision element evaluates conditions and picks a path, like an “if-then”. According to Help, matching a decision table in Flow takes several decision nodes. Custom metadata types hold deployable configuration; Help suggests combining them with Apex for business rules.

Criterion inferred by this page from those sources: where the rule lives, how many combinations it has and how many processes use it.

Situation Option
Few conditions, in a single flow Flow Decision element
Table of combinations with dated versions, used by several processes Decision matrix
Rules stored in records, with several results or operators Decision table
Multistep calculation that combines tables Expression set
The cloud has no BRE, or the logic needs code Custom metadata type with Apex

Before production

  1. Confirm that the cloud and edition include BRE (see “Licenses, permissions and editions”).
  2. Assign the PSLs and the Designer and Runtime permission sets (see “Licenses, permissions and editions”).
  3. Choose matrix or table with the comparison table (see “Components”).
  4. Check the CSV’s headers, decimals and duplicates (see “Limits and considerations”).
  5. Set the dates and rank of each version (see “Versions and activation”).
  6. Test each version with Simulate before activating it (see “Versions and activation”).
  7. Compare the expected volume with the hourly limits (see “Limits and considerations”).

Official sources

Back to the knowledge base