Data Rules let you encode the data quality checks that matter to your project as expressions Mangrove evaluates automatically. When an event is created, a datapoint is updated, or a batch is calculated, the rule runs in the background and raises an alert if the data matches a condition you’ve defined. Use Data Rules when you want to:Documentation Index
Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt
Use this file to discover all available pages before exploring further.
- Catch out-of-range measurements before they propagate into reports
- Flag missing or implausible values during data ingestion
- Validate that calculated batch outputs stay within expected bounds
- Encode methodology guardrails that your team would otherwise check by eye
Key concepts
Rule
A rule is a single named expression evaluated against either incoming event data or model calculation results. Rules belong to a project and are managed in Project Settings → Data Rules.Target
Each rule has a target that determines what it evaluates:| Target | Evaluates |
|---|---|
| Event Data | Individual datapoints as events are created or updated. Use this to validate raw measurements at ingestion. |
| Batch Calculations | Outputs of a model after a batch is generated. Use this to validate downstream calculation results. |
Rule expression
The expression is the condition that triggers the rule. Expressions are written in a domain-specific language similar to SQL — for example:Effective period
Every rule has an Effective from date and an optional Effective to date. The rule evaluates records whose date falls within this range — anything outside it is left alone.- Set Effective to to a date when the rule should stop applying (for example, when a methodology version retires).
- Leave Effective to blank to mean Ongoing — the rule keeps running on new data indefinitely.
Alert
When a rule’s expression matches a record within the effective period, Mangrove creates an alert. Alerts surface in three places:- Event drawer — alerts appear on the affected event with a link back to the rule
- Batch detail — batches with rule alerts show them on the batch page
- Reports — alerts on records included in a report are propagated to that report
Lifecycle
To stop a rule from running on new data, set or shorten its Effective to date — the rule keeps its history but no longer evaluates records past that date. Rules with evaluation results cannot be deleted; they can only be archived, which stops future evaluation and hides their alerts while preserving history for audit.API access
Accessing rules over the Mangrove API requires your API token to have therule scope enabled. Tokens missing this scope receive a 403 Unauthorized response from any rules endpoint. To add the scope, open Settings → API Tokens, edit the token, and tick Rules Engine in the permissions list.