Salesforce Industries
Jitendra's Blog
COMPLETE IMPLEMENTATION GUIDE

Salesforce Business Rules Engine (BRE)

Master no-code decision automation with Expression Sets, Decision Matrices, and Decision Tables for Insurance, Healthcare, and Financial Services

3
Core Components (Expression Sets, Decision Matrices, Decision Tables)
50K
Free BRE Calls/Month with Industry Clouds
1M
Maximum Rows Decision Tables Can Read
No-Code
Visual Designer for Business Users

1 What is Salesforce Business Rules Engine?

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.

History & Evolution of Business Rules Engine

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.

The Three Pillars of Business Rules Engine

Expression Sets

  • Sequential calculation workflows
  • Variables, constants, and formulas
  • Branching and conditional logic
  • Aggregation functions (SUM, AVG, MAX, MIN)
  • Can call Decision Matrices and Tables

Decision Matrices

  • Lookup tables with input/output columns
  • One-to-one row matching
  • CSV import capability
  • Version control for future pricing
  • Standalone or within Expression Sets

Decision Tables

  • Multiple outputs from multiple matches
  • Works with Salesforce objects directly
  • Supports operators (>, <, =, LIKE)
  • Up to 30 input fields, 5 output fields
  • Can read up to 1 million rows
Pro Tip: You can access all three tools from the dedicated Business Rules Engine app in Salesforce. Navigate to App Launcher and search for "Business Rules Engine" to get started.

2 Why is Business Rules Engine Needed?

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.

The Problem: Hard-Coded Business Logic

In traditional Salesforce implementations, complex business rules are often implemented using:

While these tools work, they present significant challenges.

Community Solutions Before BRE: The need for a configurable rule engine was recognized years before Salesforce introduced BRE. In 2017, I created SFDCRules - an open-source rule engine for Salesforce that allowed admins to configure business rules without hardcoding. The GitHub repository is still available for those interested in understanding how custom rule engines work.

Without BRE (Problems)

  • Developer Dependency: Every rule change requires developer involvement
  • Slow Time-to-Market: Changes take weeks due to dev cycles and deployments
  • Code Duplication: Similar logic scattered across triggers, flows, and classes
  • Limited Transparency: Business users can't see or understand the logic
  • Testing Complexity: Unit tests required for every code change
  • Version Control Issues: Hard to track and rollback rule changes

With BRE (Solutions)

  • Business User Empowerment: Admins can create and modify rules directly
  • Rapid Updates: Changes can be tested and deployed in hours
  • Centralized Logic: All business rules in one manageable location
  • Decision Explainer: Built-in auditing shows why rules produced results
  • Built-in Simulation: Test rules before activation without deployments
  • Native Versioning: Create multiple versions for future effective dates

Real-World Example: Insurance Premium Calculation

Consider an insurance company that needs to calculate health insurance premiums. The premium depends on:

Without BRE: You would need to write hundreds of lines of Apex code with nested IF-ELSE statements, maintain separate lookup tables in custom objects, and deploy code changes every time premium rates or factors change (often annually or quarterly). This typically requires a developer, a testing cycle, and a deployment window.
With BRE: The actuarial team creates Decision Matrices for each factor (age bands, location factors, coverage multipliers). An Expression Set combines these lookups and calculates the final premium. When rates change, the team simply updates the matrix values or creates a new version with a future effective date - no code, no deployment, no developer needed.

3 Core Components Deep Dive

Let's explore each component of the Business Rules Engine in detail, understanding their capabilities, use cases, and how they work together.

Expression Sets - The Calculation Engine

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:

JSON Input
Receive input data from Flow, OmniStudio, or API
{age: 35, dependents: 2}
Lookup Tables
Query Decision Matrices for base values
Age Band Rate: $150
Calculate
Apply formulas and business logic
$150 × 1.25 = $187.50
JSON Output
Return results to calling process
{premium: 187.50}
Salesforce Business Rules Engine Expression Set Builder interface showing visual workflow designer with calculation steps, branches, and lookup table connections
Expression Set Builder - Visual workflow designer for creating calculation logic with drag-and-drop steps
Salesforce Expression Set Simulator interface for testing and debugging business rules with sample inputs and step-by-step execution results
Expression Set Simulator - Test your rules with sample data and view step-by-step execution results

Decision Matrices - The Lookup Tables

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 - Object-Based Rules

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

4 Key Objects & Architecture

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.

Key BRE Objects

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

Architecture Overview

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:

Visual Architecture Flow

Flow OmniStudio REST API Apex
Business Rules Engine
Expression Sets Decision Matrices Decision Tables
Integration Options: BRE can be invoked from Salesforce Flow, OmniStudio, Connect REST API, and Apex. See Section 8: Integration Methods for detailed implementation guides and code examples.

5 Decision Matrix vs Decision Table: Selection Guide

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.

Quick Decision Flowchart

Is your data stored in a Salesforce object?
YES
Do you need range operators
(>, <, >=, LIKE)?
YES
Decision Table
NO
Either Works
NO
Is it static lookup data
(rates, tiers, mappings)?
YES
Decision Matrix
NO
Use Apex/Flow

Key Differentiators at a Glance

Decision Matrix

  • Data Source: Built-in table or CSV import
  • Matching: Exact match only
  • Output: Single row returned
  • Versioning: Built-in with effective dates
  • Best For: Business users managing rate tables

Decision Table

  • Data Source: Salesforce objects (up to 1M rows)
  • Matching: Supports >, <, >=, <=, LIKE
  • Output: Multiple rows can match
  • Versioning: Managed via object records
  • Best For: Dynamic rules with existing data

Common Use Case Examples

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

6 Real-World Use Cases by Industry

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.

Healthcare & Health Insurance

Prior Authorization

  • Determine if PA is required for services
  • Check coverage against policy terms
  • Validate provider network status
  • Calculate patient responsibility

Premium Calculation

  • Age band rating factors
  • Geographic location adjustments
  • Coverage tier multipliers
  • Subsidy calculations

Insurance (P&C, Life)

Underwriting Rules

  • Evaluate risk factors dynamically
  • Auto-approve low-risk applications
  • Flag high-risk cases for review
  • Calculate risk scores

Claims Processing

  • Validate claim eligibility
  • Calculate settlement amounts
  • Apply deductibles and limits
  • Fraud pattern detection

Financial Services

Loan Origination

  • Credit score evaluation
  • Debt-to-income ratio checks
  • Auto-approval thresholds
  • Interest rate determination

Compliance Monitoring

  • Real-time regulatory checks
  • KYC/AML rule enforcement
  • Transaction monitoring
  • Fee reversal eligibility

Communications & Utilities

Product Bundling

  • Eligibility based on location
  • Compatible product validation
  • Dynamic pricing rules
  • Promotional discounts

Energy Rating

  • Usage-based tier pricing
  • Time-of-use rate calculations
  • Demand charge computation
  • Rebate eligibility

7 Implementation Video Tutorial

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.

Video Credit: Special thanks to Dip Tech for creating this comprehensive tutorial.
Salesforce Business Rules Engine Tutorial by Dip Tech
Click to Watch on YouTube
Salesforce Business Rules Engine - Complete Tutorial
Practice Tip: For the best learning experience, open a Salesforce org with Business Rules Engine enabled alongside the video. Follow along step-by-step to build your first Expression Set. You can get a free Developer Edition org with BRE from the Trailhead Business Rules Engine module.

8 Integration Methods

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.

Integration with Salesforce Flow

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.

Integration with OmniStudio

OmniStudio provides native integration with BRE through OmniScript and Integration Procedures:

OmniScript Integration

  • Use Expression Set Action element
  • Map DataRaptor output to BRE input
  • Display results in OmniScript UI
  • Real-time calculations during user input

Integration Procedure

  • Call BRE from backend processes
  • Batch processing capabilities
  • Combine with other IP actions
  • Error handling and retries

API Integration (Connect REST API)

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"
        }
    ]
}

Apex Integration

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.

Method 1: Using Invocable.Action Class

/**
 * 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 {}
}

Method 2: Using HTTP Callout to Connect REST API

/**
 * 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());
    }
}
Note: The exact invocable action name may vary based on your org configuration. Use the Invocable.Action documentation to discover available actions in your org.

9 Limitations & Constraints

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.

Expression Set Limitations

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

Decision Table Limitations

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
Performance Consideration: Complex BRE logic can impact platform performance. According to industry best practices, monitor execution times and optimize rule structures. Consider caching frequently-used lookups and avoiding deeply nested conditions where possible.

When NOT to Use BRE

10 Best Practices & Lessons Learned

Based on real-world implementations and the Trailhead Business Rules Engine module, here are key best practices for successful BRE implementations.

Design Best Practices

Do This

  • Use descriptive API names for variables and steps
  • Keep Expression Sets focused on single purposes
  • Version matrices before making changes
  • Document business requirements in step descriptions
  • Test with edge cases and boundary values
  • Use Decision Explainer for auditing

Avoid This

  • Creating one massive Expression Set for all rules
  • Hard-coding values that should be in matrices
  • Modifying active matrix versions directly
  • Skipping simulation testing
  • Ignoring version effective dates
  • Exceeding nesting limits with workarounds

Governance Recommendations

Lessons Learned from Enterprise Implementations

11 Common Problems and Solutions

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.

1. Expression Set Returns Null or Empty Results

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.

2. Decision Matrix "No Match Found" Issues

Problem: Decision Matrix returns empty results even when data should match.

Common Causes:

Debugging Tip: Use the Decision Explainer feature to understand why a Decision Matrix returned no results. This was added in recent releases specifically for troubleshooting.

3. Permission and Access Errors

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.

4. Expression Set Nesting Depth Exceeded

Problem: Complex business logic requires more than 3 levels of nesting, which BRE doesn't support.

Workaround:

5. Decision Table Source Object Compatibility

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.

6. Flow Integration Errors

Problem: "Evaluate Expression Set" action in Flow fails or returns unexpected results.

Common Causes:

Known Issue: The Salesforce Known Issues article documents specific errors when using Decision Matrix or Expression Set in Flows. Always check Known Issues when troubleshooting unexpected behavior.

7. Version Management Confusion

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.

8. Performance Degradation with Complex Rules

Problem: BRE execution becomes slow as rule complexity increases.

Optimization Tips:

Community Resources for Troubleshooting

Trailblazer Community

  • BRE Topic Page - Ask questions and see discussions
  • Search for specific error messages
  • Connect with other BRE implementers

Official Resources

12 Licensing & Pricing

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.

Included with Industry Clouds

Business Rules Engine is included with these Salesforce Industry Cloud licenses:

Additional Capacity

Add-On Capacity Price (USD)
Business Rules Engine - Additional Calls 100,000 BRE calls/month $10,000/unit/month ($120,000/year)
Capacity Planning: A "BRE call" is one invocation of an Expression Set or Decision Table. High-volume implementations (e.g., real-time quoting on a website) can consume calls quickly. Monitor usage in Setup → Company Information → Usage-based Entitlements.

What Counts as a BRE Call?

? Frequently Asked Questions

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.

13 Abbreviations & Glossary

Abbreviations & Glossary

Reference guide for technical terms and abbreviations used throughout this article.

BRE - Business Rules Engine
DM - Decision Matrix
DT - Decision Table
ES - Expression Set
FSC - Financial Services Cloud
PA - Prior Authorization
API - Application Programming Interface
JSON - JavaScript Object Notation
CSV - Comma-Separated Values
IP - Integration Procedure
KYC - Know Your Customer
AML - Anti-Money Laundering
P&C - Property and Casualty
SLA - Service Level Agreement
DML - Data Manipulation Language
Link copied to clipboard!
Previous Post
Salesforce B2C Commerce Cloud Complete Guide
Next Post
ServiceNow GlideRecord CRUD Guide | Developer Tutorial
Archives by Year
2026 11 2025 16 2024 2 2023 9 2022 8 2021 4 2020 18 2019 16 2018 21 2017 34 2016 44 2015 54 2014 30 2013 31 2012 46 2011 114 2010 162
Search Blog

2 responses to “Salesforce Business Rules Engine Guide”

  1. 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

Leave a Reply to JitendraCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading