---
updatedAt: 2026-08-11T14:04:18.000Z
agentTools:
  projectIndex: https://docs.corefy.com/llms.txt
---

# Rule engine

Discover Routing, Cascading and Triggers.

# What is a Rule engine?

**Rule engine** is a combination of **Routing** and **Trigger rules** that are settled to allow the system distribute the payments via the correct **Routes** based on your business needs. Apparently, the final destination point for your payments should be the most suitable **Provider account**.

You can review how our system addresses and consolidates all the building blocks of the **Rule engine** and take a look at a case study below.

## How does it work?

The **Rule engine** main elements are a **Routing tree**, **Trigger scheme**, **Sections** and **Groups**, **Actions**, and **Cascading**. Those elements are brought together to perform a specific function and bring in one particular result implied by the user. Also, all the elements help you create the conditions for the system to choose what **Routes** to include in the process.

### 1. Routing tree

The **Routing tree** is practically one of the core elements of the **Rule engine**, along with the **Trigger scheme**. It consists of **Rules** and **Actions** that work side-by-side to create the conditions for initiating the **Routing**. Such **Rules** consist of the **Condition property**, **Relational operator** and the **Value**.

<Callout icon="📘" theme="info">
  ### Important!

  The **Routing** functions on the **Transaction** level after the **Payment Commit** is made.
</Callout>

To learn how to create **Routing rules**, go to the [Apply Routing rules](https://docs.corefy.com/docs/apply-routing-rules) guide.

### 2. Trigger scheme

The **Trigger scheme** possesses a mechanism similar to that of the **Routing tree**. It also presupposes creating the **Rules** to fulfil the specific conditions. However, unlike **Routing**, the **Trigger scheme** steps in at the **Payment Commit** level and specifies additional measures and steps to be taken before the system initiates **Routing**.

To learn more about the **Trigger scheme**, go to the [Apply Triggers rules](https://docs.corefy.com/docs/apply-triggers-rules) guide.

### 3. Sections VS Groups

**Sections** and **Groups** are the dividing blocks that help to structure the data and organise the conditions correctly.

* **Sections** work on the higher level and split the data into separate units based on your requirements.
* **Groups** exist both within the means of the same property, adding one more entity to the condition, and within the different properties while functioning as logical parentheses.

### 4. Actions

**Actions** signify the system behavior in case the condition is met or not. As it defines the **Routing strategy**, it greatly influences the payment distribution. You can manually choose the actions and establish the **Cascading** based on your needs.

To learn more about the **Actions** and **Routing strategies**, go to the [Employ Routing actions & Cascading ](https://docs.corefy.com/docs/employ-routing-actions-cascading)guide.

### 5. Cascading

**Cascading** is an important feature that reduces the potential transaction failures and identifies the alternative **Routes** if the main chosen **Route** is unavailable. This feature is presented on the **Routing** and **Triggers** levels to minimise the risks and ensure smooth operation and the ongoing process with minimum delays.

To discover the **Cascading** specifics, go to the [Employ Routing actions & Cascading](https://docs.corefy.com/docs/employ-routing-actions-cascading) guide.

## Case study

The simple case study can help you dive deeper into the **Routing** process and get familiar with **Rules** and **Conditions** establishment in a broader sense. Thus, look at the scheme and its description below to learn the real-life representation of the complex yet well-built payment workflow.

<Image src="https://files.readme.io/30865496a47d1b87c3bd8e56c8679f66e422b8eccae6f493808588ec9b8683c0-Rule_engine_2.jpg" align="center" />

You can see the **Routing rules** and **Conditions** on the left side of the scheme. On the right side, the **Triggers** are visualised. The **Trigger scheme** is initiated at the **Payment Commit** level, and the system is ready to initiate **Routing** only if all the **Trigger conditions** are met.

Let us assume that you need to accept payments on separate **Routes** based on such **Conditions**:

<HTMLBlock>{`
<table class="custom-table">
  <tr>
    <td class="header-main">The Main rule</td>
    <td class="header-main">Positive outcome = The Condition is met</td>
    <td class="header-main">Negative outcome</td>
  </tr>
  <tr>
    <td class="header-sub">The Payment amount should be less than $100 to use particular route.</td>
    <td>Then, the payments should be distributed on the <strong>Route A</strong>.</td>
    <td>If the amount exceeds $100, the system should check the <strong>Card BIN</strong> first. If the <strong>Card</strong> is connected to the <strong>VISA</strong> or <strong>Mastercard</strong> payment network, the payment should be distributed to <strong>Route B</strong>. If not, the <strong>Condition</strong> should be moved to the next section.</td>
  </tr>
  <tr>
    <td class="header-sub">The Card type should be Debit to allow the system to accept payments.</td>
    <td>Then, the payments should be distributed on the <strong>Route C</strong>.</td>
    <td>If the <strong>Card</strong> is not a <strong>Debit</strong>, but a <strong>Credit</strong> or a <strong>Prepaid</strong> one, the system should terminate such payments.</td>
  </tr>
  <tr>
    <td class="header-main">Additional rule (Trigger rule)</td>
    <td class="header-main">Positive outcome = The Condition is met</td>
    <td class="header-main">Negative outcome</td>
  </tr>
  <tr>
     <td class="header-sub">The Payment amount should be over $10 to apply the additional security checking.</td>
    <td>You can set up the <strong>Authentication</strong> measures and rules, namely, make the <strong>3DS Required</strong>. As this special checking is obligatory, you may set <strong>CVV auth</strong> as <strong>Optional</strong> and <strong>OTP auth</strong> as <strong>Disabled</strong>.</td>
    <td>No special checking is needed for payments that are less than $10. Thus, the system should accept such payments at once.</td>
  </tr>
</table>
<style> 

  :root {
    --custom-light-head: 236, 245, 254; 
    --custom-light-sub-head: 247, 250, 252; 
    --custom-light-row: 247, 250, 252; 
    --custom-dark-head: 52, 71, 84;  
    --custom-dark-sub-head: 46, 58, 66; 
    --custom-dark-row: 46, 58, 66; 
  }

  [data-color-mode="light"] .custom-table {
    --table-head: rgba(var(--custom-light-head), 1); 
    --table-sub-head: rgba(var(--custom-light-sub-head), 1); 
    --table-row: rgba(var(--custom-light-row), 0); 
    --table-stripe: rgba(var(--custom-light-row), 0);
  }

  [data-color-mode="dark"] .custom-table {
    --table-head: rgba(var(--custom-dark-head), 1); 
    --table-sub-head: rgba(var(--custom-dark-sub-head), 1); 
    --table-row: rgba(var(--custom-dark-row), 0); 
    --table-stripe: rgba(var(--custom-dark-row), 0); 
  }

  .custom-table {
    width: 100%; 
    border-collapse: collapse; 
    padding: 10px; 
    text-align: left; 
    vertical-align: top; 
    border: 1px solid var(--table-edges, #dfe2e5); 
  }
  
  .custom-table .header-main {
    background: var(--table-head);
    font-weight: bold; 
  }

  .custom-table .header-sub {
    background: var(--table-sub-head);
    font-weight: bold; 
  }
</style> 
`}</HTMLBlock>