# 3 - Decision Rules

In this step you can program the logic behind the decisions made for each record.\
The system is basically a list of if-then conditions based of how many records or object are found in the destination data after searching for a specific property/column.

{% hint style="info" %}
Let's explore a simple example with just 1 decision rule: [**CLICK HERE!**](/the-operation/3-decision-rules/example-with-1-decision-rule.md)
{% endhint %}

When there are more than one decisions, it's important to set the right "**Decision Algorithm**", this setting let you choose from 2 options:

### Decision Algorithm

* **Funnel**: the decision rule will filter the results already filtered from the decision rule before.
* **Isolate**: the decision rule will always filter the results from the total, discarding every prior filter and evaluating every rule as separated/isolated.

{% hint style="info" %}
Let's explore a simple example with just 2 decision rules and the decision algorithm set on "Funnel": [**CLICK HERE!**](/the-operation/3-decision-rules/example-with-2-decision-rules.md)**Let's do another example**:
{% endhint %}

### The difference between NEXT and STOP

When you have just one decision rule, there is no difference between one and other.

When you have more than one decision rule, the NEXT rule will skip the current decision rule and bring the software to the next decision, so if we say that we are on the first rule of three, the NEXT rule will skip the current decision and jump to the second rule. With the STOP rule the software will skip all the rules for the current record and will go to the next record starting again from the first rule.

{% embed url="<https://www.youtube.com/watch?v=S6QBV1eVon4&t=350s>" %}
Decision Rules
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.erpbridge.io/the-operation/3-decision-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
