Master no-code decision automation with Expression Sets, Decision Matrices, and Decision Tables for Insurance, Healthcare, and Financial Services
According to the official Salesforce documentation, Business Rules Engine is a suite of services, components, and objects that apply advanced logic and automate complex decision-making. The engine powers guided interactions and workflows for virtually any industry process, operating at true business-to-consumer scale capable of maintaining thousands of rules and automating millions of interactions.
What makes BRE unique is its ability to put decision-making power directly into the hands of business users. Instead of waiting for developers to write and deploy Apex code every time a business rule changes, administrators and business analysts can create, test, and modify rules using intuitive visual tools.
Business Rules Engine has its roots in Salesforce's acquisition of Vlocity. The deal was announced on February 25, 2020 and closed on June 1, 2020 for $1.33 billion. Vlocity, founded in 2014 by former Siebel Systems executives, was a pioneer in industry-specific cloud solutions built natively on the Salesforce platform. The acquisition brought technologies like OmniStudio, DataRaptors, and process engines that eventually evolved into what we now know as Business Rules Engine.
Business Rules Engine was officially introduced in the Spring '22 release along with the Decision Explainer feature for audit trails. Initially available only to Salesforce Industries customers (Communications Cloud, Health Cloud, Financial Services Cloud), BRE was a subscription add-on. In the Summer '22 release, Salesforce began including 50,000 BRE calls per month with Unlimited Editions of Industry Clouds.
Today, BRE continues to evolve with each Salesforce release, gaining new features like enhanced Flow integration, improved Decision Table performance, and expanded support across more Salesforce products.
Before we dive into the technical details, it's crucial to understand why Salesforce created Business Rules Engine and what problems it solves. This understanding will help you evaluate whether BRE is the right tool for your organization.
In traditional Salesforce implementations, complex business rules are often implemented using:
While these tools work, they present significant challenges.
Consider an insurance company that needs to calculate health insurance premiums. The premium depends on:
Let's explore each component of the Business Rules Engine in detail, understanding their capabilities, use cases, and how they work together.
According to the Trailhead Expression Sets module, Expression Sets are the calculation engine of business rules. They're made up of variables, constants, and logic connected in a meaningful flow that takes JSON inputs, performs calculations, and returns JSON outputs.
Key Elements of Expression Sets:
Decision Matrices are powerful lookup tables with user-defined input and output columns. When called, the engine locates the row matching the input values and returns the corresponding output values. According to the Salesforce Help documentation on Decision Matrices, each matrix can have multiple versions for managing future pricing changes.
Example: SLA-Based Retention Costs
| Input: SLA Level | Output: Retention Cost | Output: Retention Rate |
|---|---|---|
| Bronze | $5,000 | 70% |
| Silver | $8,500 | 85% |
| Gold | $11,000 | 90% |
| Platinum | $12,500 | 95% |
Decision Tables are advanced lookup tables that work directly with Salesforce objects (standard, custom, or custom metadata types). Unlike Decision Matrices, they can return multiple outputs from multiple matching rows and support operators like greater-than, less-than, and LIKE. According to the Salesforce Help documentation on Decision Tables, they can read up to 1 million rows and support up to 30 input fields with 5 output fields.
When to Use Decision Tables vs. Decision Matrices:
| Feature | Decision Matrix | Decision Table |
|---|---|---|
| Data Source | Built-in matrix table or CSV import | Salesforce objects (standard, custom, metadata) |
| Matching | One row per input combination | Multiple rows can match |
| Operators | Exact match only | Supports >, <, >=, <=, =, LIKE |
| Best For | Static rate tables, simple lookups | Dynamic rules, range-based logic |
| Max Rows | No documented limit | 1,000,000 rows |
Understanding the underlying data model helps you design better solutions and troubleshoot issues. According to the Salesforce Developer Documentation, BRE uses several standard objects to store configuration and metadata.
| Object | API Name | Purpose |
|---|---|---|
| Expression Set | ExpressionSet | Parent container for rule definitions |
| Expression Set Version | ExpressionSetVersion | Versioned instance with effective dates |
| Expression Set Element | ExpressionSetStep | Individual step (calculation, lookup, branch) |
| Decision Matrix | DecisionMatrix | Lookup table definition |
| Decision Matrix Version | DecisionMatrixVersion | Versioned matrix with effective dates |
| Decision Table | DecisionTable | Object-based rule table definition |
Business Rules Engine is tightly integrated with Salesforce Industry Clouds (Communications, Financial Services, Healthcare, Energy) and works alongside OmniStudio for guided experiences. The diagram below shows the high-level architecture:
One of the most common questions when implementing Business Rules Engine is: "Should I use a Decision Matrix or a Decision Table?" This section provides a clear decision framework to help you choose the right component for your use case.
| Use Case | Recommended | Reason |
|---|---|---|
| Insurance premium rate tables | Matrix | Static rates with exact age band/tier matching |
| Product eligibility by credit score range | Table | Needs range operators (score >= 650 AND < 750) |
| Tax rate lookup by state/category | Matrix | Simple key-value lookup, easy CSV import |
| Find all applicable discounts for customer | Table | Multiple matching rows needed (stacking discounts) |
| Currency conversion rates | Matrix | Built-in versioning for rate changes with dates |
| Product recommendations from catalog | Table | Query existing Product2 records dynamically |
Business Rules Engine shines in industries with complex, frequently-changing business logic. Here are detailed use cases based on the Trailhead Business Rules Engine module.
Rather than reading through lengthy text-based instructions, watch this excellent video tutorial that walks you through implementing Business Rules Engine step-by-step. This hands-on demonstration is one of the best resources available for learning BRE implementation.
According to the Salesforce Help documentation on BRE Integrations, Business Rules Engine components can be invoked from multiple platforms including Salesforce Flow, OmniStudio, Connect REST API, and Apex code.
To invoke BRE from Flow Builder: Navigate to Setup → Process Automation → Flows → New Flow, then add an Action element and search for "Evaluate Expression Set" or "Evaluate Decision Table". Configure the action by selecting your Expression Set, mapping input variables from Flow variables, and configuring output variable storage. The output JSON is automatically parsed into Flow variables that you can display on screens or use in subsequent elements.
OmniStudio provides native integration with BRE through OmniScript and Integration Procedures:
For custom integrations or external systems, use the Connect REST API:
# Evaluate Expression Set via REST API
curl -X POST
'https://yourinstance.salesforce.com/services/data/v59.0/connect/expression-set/YOUR_EXPRESSION_SET_ID'
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
-H 'Content-Type: application/json'
-d '{
"inputs": [
{
"Age_Band": "36-45",
"Dependents": "2",
"Annual_Income": 45000
}
]
}'
// API Response
{
"outputs": [
{
"Monthly_Premium": 556.87,
"Subsidy_Amount": 185.63,
"Calculated_Premium": 742.50
}
],
"explanations": [
{
"stepName": "Age_Lookup",
"result": "Matched row: 36-45"
}
]
}
Starting with Winter '23, Salesforce introduced the Invocable.Action class which allows Apex code to call invocable actions—including BRE components. This is useful for triggers, batch jobs, and custom controllers.
/**
* Calling an Expression Set from Apex using Invocable.Action
* Available since Winter '23 (API v56.0+)
*/
public class BREApexIntegration {
public static Map<String, Object> evaluateExpressionSet(
String expressionSetName,
Map<String, Object> inputVariables
) {
Invocable.Action action = Invocable.Action.createStandardAction(
'evaluateExpressionSet'
);
action.setInvocationParameter('expressionSetName', expressionSetName);
action.setInvocationParameter('inputVariablesJSON', JSON.serialize(inputVariables));
List<Invocable.Action.Result> results = action.invoke();
if (results != null && !results.isEmpty() && results[0].isSuccess()) {
return (Map<String, Object>) results[0].getOutputParameters();
}
throw new BREException('Expression Set evaluation failed');
}
public class BREException extends Exception {}
}
/**
* Calling Expression Set via Connect REST API from Apex
*/
public class BRERestIntegration {
public static String evaluateExpressionSet(
String expressionSetId,
Integer versionNumber,
Map<String, Object> inputData
) {
String baseUrl = URL.getOrgDomainUrl().toExternalForm();
String endpoint = baseUrl + '/services/data/v59.0/connect/' +
'business-rules/expression-set/' + expressionSetId +
'/versions/' + versionNumber + '/actions/evaluate';
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
req.setBody(JSON.serialize(new Map<String, Object>{ 'inputData' => inputData }));
HttpResponse res = new Http().send(req);
if (res.getStatusCode() == 200) {
return res.getBody();
}
throw new CalloutException('BRE API Error: ' + res.getStatusCode());
}
}
While powerful, Business Rules Engine has specific limitations you must consider during solution design. According to the official BRE limits documentation, understanding these constraints helps avoid implementation issues.
| Limitation | Value | Workaround |
|---|---|---|
| Nesting Depth | Maximum 3 levels | Chain multiple Expression Sets |
| Aggregate Steps | Must be last in sequence | Use second Expression Set for post-aggregate logic |
| Version Limit | Multiple versions supported | Archive old versions regularly |
| Limitation | Value | Impact |
|---|---|---|
| Input Fields | Maximum 30 | Complex rules may need multiple tables |
| Output Fields | Maximum 5 | Return key values, calculate derived values in Expression Set |
| Row Capacity | Up to 1,000,000 | Performance may degrade with high row counts |
| Source Object | Must have CreatedDate and IsDeleted fields | Some objects not compatible |
Based on real-world implementations and the Trailhead Business Rules Engine module, here are key best practices for successful BRE implementations.
Based on discussions in the Salesforce Trailblazer Community and Salesforce Known Issues, here are the most frequently reported problems and questions from developers and administrators implementing Business Rules Engine.
Problem: Expression Set executes without errors but returns null or unexpected empty values.
Common Causes:
Solution: Use the Simulation tool to trace each step. Check that all input variables have values before the Expression Set runs. Add defensive null checks in your calling Flow or OmniScript.
Problem: Decision Matrix returns empty results even when data should match.
Common Causes:
Problem: Users receive "Insufficient Privileges" or cannot access BRE components.
Common Causes:
Solution: Assign the appropriate permission sets from Setup. According to the BRE Permission Sets documentation, users need specific permissions for runtime execution vs. design-time editing.
Problem: Complex business logic requires more than 3 levels of nesting, which BRE doesn't support.
Workaround:
Problem: Custom object cannot be used as Decision Table source.
Cause: Decision Tables require source objects to have CreatedDate and IsDeleted fields. Some custom objects or certain standard objects may not have these fields.
Solution: Use Custom Metadata Types instead of custom objects for Decision Table rules. Metadata types are fully compatible and offer additional benefits like deployability.
Problem: "Evaluate Expression Set" action in Flow fails or returns unexpected results.
Common Causes:
Problem: Changes to Expression Sets or Decision Matrices don't take effect, or wrong version executes.
Common Causes:
Solution: Always verify which version is active. Use distinct Start and End dates for versions. After activation, wait 5-10 seconds before testing.
Problem: BRE execution becomes slow as rule complexity increases.
Optimization Tips:
Understanding BRE licensing is crucial for budgeting and capacity planning. According to the Salesforce Add-on Pricing documentation, here's what you need to know.
Business Rules Engine is included with these Salesforce Industry Cloud licenses:
| Add-On | Capacity | Price (USD) |
|---|---|---|
| Business Rules Engine - Additional Calls | 100,000 BRE calls/month | $10,000/unit/month ($120,000/year) |
Salesforce Business Rules Engine (BRE) is a no-code/low-code framework within Salesforce Industries that enables business users to create, manage, and execute complex business logic using visual designers. It includes three core tools: Expression Sets for calculations and workflows, Decision Matrices for lookup tables, and Decision Tables for object-based rules with multiple outputs.
Expression Sets are sequential calculation workflows that can include variables, formulas, branching, and aggregation functions. Decision Matrices are lookup tables that match inputs to a single row and return corresponding outputs (exact match only). Decision Tables work with Salesforce objects, can return multiple outputs from multiple matching rows, and support operators like greater-than and less-than.
Business Rules Engine is included with Financial Services Cloud, Health Cloud, Manufacturing Cloud, Automotive Cloud, and Communications Cloud. Each license includes 50,000 BRE calls per org per month. Additional capacity can be purchased at $10,000/unit/month for 100,000 additional calls.
Key limitations include: Expression Sets are limited to 3 levels of nesting depth; Decision Tables support a maximum of 30 input fields and 5 output fields; Decision Tables can read up to 1 million rows; and source objects for Decision Tables must have CreatedDate and IsDeleted fields. Performance may also be impacted with complex rules or high row counts.
BRE can replace Apex for many business logic scenarios including calculations, eligibility checks, pricing rules, and decision-making workflows. However, it's not suitable for complex integrations requiring callouts, real-time high-frequency processing, or scenarios requiring logic nesting deeper than 3 levels. Use BRE for maintainable, business-user-editable rules and Apex for complex system-level logic.
Reference guide for technical terms and abbreviations used throughout this article.
any idea, what happens after BRElimit 50,000 exhausted in org? does it get billed? appreciate your response
Business Rules Engine (BRE) operates on a consumption-based pricing model. When the standard monthly limit of 50,000 calls is exceeded in editions like Unlimited or Agentforce 1, users are typically billed for additional usage in the form of overages