---
title: Rule Execution
description: "## Execution Modes Extension Kit Core rules can be executed in these modes: - **EventHandler** - **Background** - **BackgroundTransaction** These modes determine **when the rule runs, how users experience the execution, and how errors are handled**. In most modules, the…"
url: "https://extensionkit.unitfly.com/documentation/rule-execution/"
updated: "2026-03-12"
category: Essentials
---

# Rule Execution

## Execution Modes

Extension Kit Core rules can be executed in these modes:

- **EventHandler**
- **Background**
- **BackgroundTransaction**

These modes determine **when the rule runs, how users experience the execution, and how errors are handled**.

In most modules, the **execution mode can be configured**in the advanced rule configuration. However, in some modules, such as Property Calculations and Validation, the execution mode is set to an appropriate version by default and cannot be changed.

### EventHandler Mode

**EventHandler** rules are executed during the event that triggered them, specifically in the **BeforeCheckInChangesFinalize**event handler.

This occurs **before an object is checked in**, but**after state transitions and signatures have been finalized.**

**Workflow changes are not allowed** in this event handler. If a rule is configured to modify the object's state, the change will be executed in the background after the event handler has finished.

Rules executed in this mode take advantage of **M-Files event handlers' transactionality**, meaning any changes they make to the vault are rolled back if an error occurs. However, they are subject to all event handler constraints, most notable being the **90-seconds timeout.**

### Background Mode

**Background** rules are executed in the background, **after the triggering event has finished.**

In this mode, rules are not transactional. This means that these tasks run independently of any transaction and do not roll back changes if a failure occurs during execution.

### BackgroundTransaction Mode

To have transactional behavior in the background, the **BackgroundTransaction** execution mode should be selected in the configuration. This mode ensures that tasks run **within the context of a transaction**, allowing any changes made by the task to be**rolled back**if the transaction fails.

## Execution Mode Overview by Modules

| Module | Event handler | Background | Background Transaction | Note |
| --- | --- | --- | --- | --- |
| Orchestrator | 🗸 | 🗸 | 🗸 | Configurable. |
| Property Operations | 🗸 | 🗸 | 🗸 | Rules that modify trigger source object are by default executed in event handler. Rules that modify objects other than trigger source are executed in background by default. This behavior can be changed. |
| Property Calculations | 🗸 |  | 🗸 | Rules that modify trigger source object are executed in event handler. Rules that modify objects other than trigger source are executed in background. |
| Extended Auto Properties | 🗸 | × | × |  |
| Auto Numbering Properties | 🗸 | 🗸 | × | Configurable. |
| Versioning | 🗸 | × | × |  |
| Extended Permissions | 🗸 | 🗸 | 🗸 | Configurable. |
| Extension Methods | 🗸 | × | × |  |
| Document Processing | × | 🗸 | 🗸 | Configurable. |
| Object Operations | 🗸 | 🗸 | 🗸 | Configurable. |
| Validation | 🗸 | × | × |  |
| Property Builder | 🗸 | × | × |  |
| SQL Integration | 🗸 | 🗸 | 🗸 | Configurable. |
| HTTP Integration | 🗸 | 🗸 | 🗸 | Configurable. |
| Reporting | × | 🗸 | 🗸 | Configurable. |
| E-mail Notifications | × | × | 🗸 |  |
| Vault to Vault | 🗸 | 🗸 | 🗸 | Configurable. |
| Data Transfer | × | × | 🗸 |  |
| Excel Reader | 🗸 | 🗸 | 🗸 | Configurable. |
| Word Reader | 🗸 | 🗸 | 🗸 | Configurable. |
| Excel Writer | × | 🗸 | × |  |
| Word Writer | × | 🗸 | 🗸 | Configurable. |
| Archiving | 🗸 | 🗸 | 🗸 | Configurable. |
| Document AI | 🗸 | × | × |  |
| XML Processing | × | 🗸 | 🗸 | Configurable. |
| Extended Assignments | 🗸 |  |  |  |
| Object Templates | 🗸 |  |  |  |
| Auto State Transition |  |  |  |  |

Execution Mode Overview by Modules

## Execution Order

When execution mode is event handler, rules are executed by module and in order they are specified in configuration. Modules execution order is as follows:

1. [Orchestrator](https://extensionkit.unitfly.com/documentation/about-orchestrator/)
2. [Property Operations](https://extensionkit.unitfly.com/documentation/about-property-operations/)
3. [Property Calculations](https://extensionkit.unitfly.com/documentation/about-property-calculations/)
4. [Extended Auto Properties](https://extensionkit.unitfly.com/documentation/about-extended-auto-properties/)
5. [Auto Numbering Properties](https://extensionkit.unitfly.com/documentation/about-the-module-2/)
6. [Versioning](https://extensionkit.unitfly.com/documentation/about-versioning/)
7. [Extended Permissions](https://extensionkit.unitfly.com/documentation/documentation-extension-kit-for-m-files/extended-permissions/)
8. [Extension Methods](https://extensionkit.unitfly.com/documentation/about-extension-methods/)
9. [Document Processing](https://extensionkit.unitfly.com/documentation/about-document-processing/)
10. [Object Creation](https://extensionkit.unitfly.com/documentation/object-operations-introduction/)
11. [Validation](https://extensionkit.unitfly.com/documentation/about-validation/)
12. [Property Builder](https://extensionkit.unitfly.com/documentation/about-property-builder/)
13. [SQL Integration](https://extensionkit.unitfly.com/documentation/about-sql-integration/)
14. [HTTP Integration](https://extensionkit.unitfly.com/documentation/about-http-integration/)
15. [Reporting](https://extensionkit.unitfly.com/documentation/about-reporting/)
16. [E-mail Notifications](https://extensionkit.unitfly.com/documentation/about-notifications/)
17. [Vault to Vault](https://extensionkit.unitfly.com/documentation/about-vault-to-vault/)
18. [Data Transfer](https://extensionkit.unitfly.com/documentation/data-transfer-configuration/)
19. [Excel Reader](https://extensionkit.unitfly.com/documentation/about-excel-reader/)
20. [Word Reader](https://extensionkit.unitfly.com/documentation/about-word-reader/)
21. [Excel Writer](https://extensionkit.unitfly.com/documentation/about-excel-writer/)
22. [Word Writer](https://extensionkit.unitfly.com/documentation/about-word-writer/)
23. [Archiving](https://extensionkit.unitfly.com/documentation/archiving-introduction/)
24. [Document AI](https://extensionkit.unitfly.com/documentation/document-ai-introduction/)
25. [XML Processing](https://extensionkit.unitfly.com/documentation/xml-processing-introduction/)
26. [Extended Assignments](https://extensionkit.unitfly.com/documentation/about-extended-assignments/)
27. [Object Templates](https://extensionkit.unitfly.com/documentation/about-object-templates/)
28. [Auto State Transition](https://extensionkit.unitfly.com/documentation/about-auto-state-transition/)
