Overview
The Rules Engine lets you define conditions and actions that fire automatically β no code required. Rules can trigger on document events, case status changes, or a recurring schedule. Navigate to Rules Engine in the sidebar to manage your rules.Trigger Types
π₯ Document Event
Fires immediately after a document is processed and reaches Ready status. Available events:document_readyβ fires after every successful AI extraction
π Case Event
Fires when a case changes to a specific status. Available events:| Event | When it fires |
|---|---|
case_resolved | Case marked as Resolved |
case_closed | Case marked as Closed |
case_ready | Case marked as Ready |
case_in_progress | Case marked as In Progress |
case_new | New case created |
case_backlog | Case moved to Backlog |
β° Schedule (Heartbeat)
Scans all documents on a recurring timer. Configure the interval in minutes (e.g. every 60 minutes). The rule evaluates every document that matches its conditions on each scan. Use case: Alert on documents stalled in Needs Review for more than 3 days. Weekly compliance checks.Conditions
Each rule supports up to 5 conditions combined with AND logic.| Field | Available Operators |
|---|---|
confidence_score | greater than, less than, equal to |
total_amount | greater than, less than, equal to |
status | equals, contains |
doc_type | equals, contains |
vendor_name | is empty, is not empty, contains |
days_in_status | greater than (heartbeat only) |
| Any custom field | equals, contains, is empty |
Actions
| Action | What it does |
|---|---|
set_status | Changes the document status |
create_case | Creates a new case linked to the document |
move_folder | Moves the document to a specified folder |
notify | Creates an in-app notification |
webhook | POSTs a payload to an external URL |
flag_review | Sets status to Needs Review |
Multi-Step Approval Workflows
Case-event rules enable chained automation across documents and cases. Example: Low confidence β human review β auto-approveLoop Protection
The Rules Engine includes automatic loop detection. If a rule chain triggers itself recursively, execution stops after 5 levels of depth. Example of a loop that would be caught:Default Rules
Every fresh RecordEngine deployment seeds 3 default rules:| Rule | Condition | Action |
|---|---|---|
| Low Confidence Extraction | confidence_score < 70 | create_case (High) |
| Invoice Missing Vendor Name | doc_type contains invoice AND vendor_name is empty | create_case (Medium) |
| Large Invoice Requires Approval | total_amount > 10000 | create_case (High) |
Execution Log
Every rule firing is recorded in the Rule Execution Log at the bottom of the Rules Engine page. Each entry shows:- π₯ Document event / π Case event / β° Heartbeat icon
- Rule name and document/case it fired on
- Action taken and whether it succeeded
- Timestamp