---
updatedAt: 2026-11-02T20:49:09.000Z
agentTools:
  projectIndex: https://docs.getmontecarlo.com/llms.txt
---

# Validation Monitor

Row-level data quality assertions that flag invalid rows.

## Overview

Define row-level data quality rules and get alerted when rows break them. You write an `alert_condition` — a predicate tree — that describes what **invalid** data looks like. Rows that match are breaches; if any exist (or exceed a percentage threshold), an incident is created.

> 📘 **Reference scope**
>
> This page covers MaC YAML configuration. For available predicates and UI setup, see [Validation Monitors](https://docs.getmontecarlo.com/docs/validation-monitors) and [Available Conditions](https://docs.getmontecarlo.com/docs/available-conditions).

> 🚧 **Conditions define INVALID data.**
>
> The single most common mistake: writing conditions that match *valid* rows. A validation condition describes what's *wrong* — rows that match are flagged as breaches.

Predicate types: UNARY (single-field checks like `null`), BINARY (field-to-value comparisons like `greater_than`), SQL (free-form boolean expressions), and GROUP (AND/OR combinators). Any predicate can be inverted with `negated: true`.

For aggregate metrics, use a [Metric Monitor](https://docs.getmontecarlo.com/docs/metric). For arbitrary SQL returning a single number, use a [Custom SQL Monitor](https://docs.getmontecarlo.com/docs/custom-sql).

## Quick Start

```yaml
montecarlo:
  validation:
    - name: orders_user_id_not_null
      description: "Alert when user_id is null in orders table"
      schedule:
        type: fixed
        interval_minutes: 720
      data_source:
        table: "my_database:my_schema.orders"
      alert_condition:
        type: GROUP
        operator: AND
        conditions:
          - type: UNARY
            predicate:
              name: "null"
            value:
              - field: user_id
      domains:
        - my-domain
```

Create interactively with `create_or_update_validation_monitor(dry_run=True)` via the [Monte Carlo MCP server](https://docs.getmontecarlo.com/docs/agent-toolkit). Use `get_validation_predicates(warehouse=<uuid>)` to discover available predicates for your warehouse.

## Configuration

<Cards columns={1}>

<Card title="schedule — when and how often to run">

`object` · required

Supported modes: `fixed`, `dynamic`, `manual`. Crontab (`interval_crontab`) is supported.

**Properties**

---

**`type`** — schedule type

`enum` · optional · default: `fixed`

**Accepted values:** `fixed` · `dynamic` · `manual`

```yaml
schedule:
  type: fixed
```

---

**`interval_minutes`** — run interval for fixed schedules

`integer` · optional

Required when `type` is `fixed`.

```yaml
schedule:
  type: fixed
  interval_minutes: 720
```

---

**`interval_crontab`** — cron expressions

`array of strings` · optional

5-field cron format.

```yaml
schedule:
  type: fixed
  interval_crontab:
    - "0 8 * * *"
```

---

**`interval_crontab_day_operator`** — day-of-week/day-of-month combination

`enum` · optional

**Accepted values:** `AND` · `OR`

```yaml
schedule:
  interval_crontab_day_operator: AND
```

---

**`start_time`** — ISO 8601 start time

`string` · optional

```yaml
schedule:
  start_time: "2024-01-01T08:00:00Z"
```

---

**`timezone`** — IANA timezone

`string` · optional

```yaml
schedule:
  timezone: America/Los_Angeles
```

---

**`dynamic_schedule_tables`** — tables that trigger the monitor

`array of strings` · optional (required when `type` is `dynamic`)

```yaml
schedule:
  type: dynamic
  dynamic_schedule_tables:
    - analytics:public.orders
```

---

**`dynamic_schedule_jobs`** — jobs that trigger the monitor

`array of objects` · optional

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `job_type` | enum | yes | `AirflowDag` · `DatabricksJob` · `AdfJob` · `DbtJob` |
| `job_name` | string | yes | Name of the job |
| `project_name` | string | yes | Project or resource name |
| `task_name` | string | no | Task within the job |
| `mcon` | string | no | MCON identifier |

<br />

```yaml
schedule:
  type: dynamic
  dynamic_schedule_jobs:
    - job_type: AirflowDag
      job_name: etl_orders
      project_name: my-airflow
```

---

**`min_interval_minutes`** — minimum interval for dynamic schedules

`integer` · optional

```yaml
schedule:
  type: dynamic
  min_interval_minutes: 30
```

```yaml
schedule:
  type: fixed
  interval_minutes: 720
```

</Card>

<Card title="data_source — the table or SQL query to validate">

`object` · required

Provide either `table` or `sql`, not both.

**Properties**

---

**`table`** — fully qualified table name

`string` · required (if `sql` is not provided)

Format: `database:schema.table`.

```yaml
data_source:
  table: "analytics_db:public.orders"
```

---

**`sql`** — SQL query returning rows to validate

`string` · required (if `table` is not provided)

```yaml
data_source:
  sql: |
    SELECT * FROM orders
    WHERE created_at >= CURRENT_DATE - 1
```

---

**`transforms`** — AI-powered field transforms

`array of objects` · optional

See [data_source.transforms in the Metric Monitor reference](https://docs.getmontecarlo.com/docs/metric#data_sourcetransforms).

```yaml
data_source:
  table: "analytics_db:public.orders"
  transforms:
    - field: status
      transform: normalize
```

```yaml
data_source:
  table: "analytics_db:public.orders"
```

</Card>

<Card title="alert_condition — predicate tree defining invalid rows">

`object` · required

A predicate tree. The root node must be a GROUP. Each node is one of four types: GROUP, UNARY, BINARY, or SQL. Conditions match **invalid** data — a row that matches is a breach. Validation monitors do not use operators or threshold types — alerting is determined by the predicate tree and optional `percentage_threshold`/`percentage_operator` fields.

**Noise reduction:** Set `event_rollup_count` (min 2), `event_rollup_until_changed`, or `alert_grouping` at the monitor level to suppress notifications for subsequent breaches. These fields are mutually exclusive — only one can be set at a time.

> 🚧 **`alert_condition` is singular.**
>
> Other monitor types use `alert_conditions` (plural, an array). Validation monitors use `alert_condition` (singular, a single object). The plural form causes a validation error.

**Properties**

---

**GROUP node** — combine conditions with AND/OR logic

The root `alert_condition` must be a GROUP. Groups can be nested for complex logic.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | string | yes | `GROUP` |
| `operator` | string | no | `AND` (default) or `OR` |
| `conditions` | array | yes | Child nodes (GROUP, UNARY, BINARY, or SQL) |

<br />

```yaml
alert_condition:
  type: GROUP
  operator: AND
  conditions:
    - type: UNARY
      predicate:
        name: "null"
      value:
        - field: user_id
```

---

**UNARY predicate** — single-field check with no comparison value

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | string | yes | `UNARY` |
| `predicate` | object | yes | `name` (string) and optional `negated` (boolean) |
| `value` | array | yes | Field references: `- field: <column_name>` |

<br />

**Available UNARY predicates by field type:**

| Field Type | Predicates |
|-----------|------------|
| Numeric | `null`, `is_zero`, `is_negative`, `is_between_0_and_1`, `is_between_0_and_100`, `is_nan` |
| String | `null`, `empty_string`, `all_space`, `containing_spaces`, `null_string`, `is_uuid`, `email`, `true_string`, `false_string`, `timestamp_iso_8601`, `timestamp_mm-dd-yyyy`, `timestamp_dd-mm-yyyy`, `timestamp_mm/dd/yyyy`, `timestamp_dd/mm/yyyy`, `us_zip_code`, `us_ssn`, `us_state_code`, `us_phone_number`, `can_sin`, `ca_postal_code`, `fr_insee_code`, `fr_postal_code`, `de_postal_code`, `de_tax_id`, `ie_ppsn`, `ie_postal_code`, `it_postal_code`, `it_fiscal_code`, `es_dni`, `es_postal_code`, `uk_postal_code`, `uk_nino`, `nl_postal_code`, `nl_bsn`, `tr_postal_code`, `tr_id_no`, `ch_oasi`, `ch_postal_code`, `pl_postal_code`, `pl_pesel`, `aus_postal_code`, `aus_state_code` |
| Boolean | `null` |
| Date | `null`, `in_past`, `in_future`, `today`, `yesterday`, `in_past_7_days`, `in_past_30_days`, `in_past_365_days`, `in_past_calendar_month`, `in_past_calendar_week`, `weekday`, `sunday` through `saturday` |
| Timestamp | `null`, `in_past`, `in_future`, `in_past_60_minutes`, `in_past_24_hours`, `in_past_7_days`, `in_past_30_days`, `in_past_365_days`, `in_past_calendar_month`, `in_past_calendar_week`, `today`, `yesterday`, `weekday`, `sunday` through `saturday` |

<br />

> 📘 **Predicate availability varies by warehouse**
>
> Run `get_validation_predicates` to get the current list for your warehouse.

```yaml
- type: UNARY
  predicate:
    name: "null"
  value:
    - field: email
```

---

**BINARY predicate** — field-to-value comparison

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | string | yes | `BINARY` |
| `predicate` | object | yes | `name` (string) and optional `negated` (boolean) |
| `left` | array | yes | Field references: `- field: <column_name>` |
| `right` | array | yes | One of: `literal`, `field`, or `sql`. See right-side value types below. |

<br />

**Available BINARY predicates by field type:**

| Field Type | Predicates |
|-----------|------------|
| Numeric | `equal`, `greater_than`, `greater_than_or_equal`, `less_than`, `less_than_or_equal`, `in_set` |
| String | `equal`, `contains`, `starts_with`, `ends_with`, `matches_regex`, `in_set` |
| Boolean | `equal` |
| Date / Timestamp | `equal`, `greater_than`, `greater_than_or_equal`, `less_than`, `less_than_or_equal` |

<br />

**Right-side value types:**

| Value Type | Syntax | Description |
|-----------|--------|-------------|
| `literal` | `- literal: "value"` | A static value. **Always pass as a string, even for numbers** (e.g., `- literal: "150"`, not `- literal: 150`). |
| `field` | `- field: column_name` | Reference to another column. Only with date/timestamp left fields or `in_set`. |
| `sql` | `- sql: "expression"` | A scalar SQL expression or subquery (must not start with `SELECT` — use parentheses). |

<br />

> 🚧 **Left side must always be a field reference.**
>
> You cannot put a `literal`, `sql`, or aggregate on the left side.

```yaml
- type: BINARY
  predicate:
    name: greater_than
  left:
    - field: age
  right:
    - literal: "150"
```

---

**SQL predicate** — free-form SQL boolean expression

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | string | yes | `SQL` |
| `sql` | string | yes | A SQL boolean expression (e.g. `amount > 0 AND amount < 10000`). Not a query — no `SELECT`. |

<br />

```yaml
- type: SQL
  sql: "status = 'failed' AND amount < 0"
```

---

**Negation** — invert any UNARY or BINARY predicate

Any UNARY or BINARY predicate can be inverted with `negated: true` in the `predicate` object.

```yaml
# Alert when status is NOT in the allowed set
- type: BINARY
  predicate:
    name: in_set
    negated: true
  left:
    - field: status
  right:
    - literal: "active"
    - literal: "inactive"
    - literal: "pending"
```

```yaml
alert_condition:
  type: GROUP
  operator: AND
  conditions:
    - type: UNARY
      predicate:
        name: "null"
      value:
        - field: user_id
```

</Card>

<Card title="description — what this monitor checks">

`string` · required

Displayed in the Monte Carlo UI and in incident notifications. Max 512 characters.

```yaml
description: "Alert when user_id is null in orders table"
```

</Card>

<Card title="domains — domain for this monitor">

`array of strings (exactly one entry)` · required when creating a monitor

Required on all accounts, regardless of when the account was created. Monitors that already exist without a domain can still be updated without adding one.

Set `default_domain` in `montecarlo.yml` to avoid repeating it on every monitor.

```yaml
domains:
  - my-domain
```

</Card>

<Card title="percentage_threshold — invalid row percentage before alerting">

`number` · optional

Alert only when the percentage of invalid rows exceeds this value. Minimum: 0. When omitted, the monitor alerts on any matching row. **Must be paired with `percentage_operator`** — setting one without the other causes a validation error.

```yaml
percentage_threshold: 5
percentage_operator: GT
```

</Card>

<Card title="percentage_operator — operator for percentage threshold">

`enum` · optional

**Accepted values:** `EQ` · `GT` · `GTE` · `LT` · `LTE`

**Must be paired with `percentage_threshold`** — setting one without the other causes a validation error.

```yaml
percentage_threshold: 1.0
percentage_operator: GT
```

</Card>

<Card title="warehouse — which warehouse to use">

`string` · optional (yes if multiple warehouses)

Warehouse UUID or name. Overrides `default_resource` from `montecarlo.yml`.

```yaml
warehouse: my-snowflake
```

</Card>

<Card title="name — unique identifier within the namespace">

`string` · required

Required for monitors created after Jan 29, 2024 (existing monitors keep working). Changing the name creates a new monitor and deletes the old one — incident history does not transfer.

```yaml
name: null_user_id_check
```

</Card>

<Card title="connection_name — named connection">

`string` · optional

Overrides the default connection for this warehouse.

```yaml
connection_name: analytics-readonly
```

</Card>

<Card title="event_rollup_count — consecutive breaches before alerting">
`integer` · optional

Minimum `2`. Mutually exclusive with `event_rollup_until_changed` and `alert_grouping`.

```yaml
event_rollup_count: 3
```
</Card>

<Card title="event_rollup_until_changed — suppress repeat notifications">
`boolean` · optional · default: `false`

Notifies only on status transitions. Mutually exclusive with `event_rollup_count` and `alert_grouping`.

```yaml
event_rollup_until_changed: true
```
</Card>

<Card title="alert_grouping — group subsequent breaches into the currently open alert">
`object` · optional · default: no grouping

Groups subsequent breaches into the currently open alert rather than creating a new one, for as long as the alert remains open and unresolved. Mutually exclusive with `event_rollup_count` and `event_rollup_until_changed`.

**`mode`**
**Accepted values:** `group_into_open_alert`

<br />

```yaml
alert_grouping:
  mode: group_into_open_alert
```
</Card>

<Card title="exception_primary_key_column — column for exception tracking">

`string` · optional

Track specific invalid rows across runs — see whether the same rows keep failing or new ones appear.

```yaml
exception_primary_key_column: order_id
```

</Card>

<Card title="severity — incident severity level">

`enum` · optional

**Accepted values:** `SEV-0` · `SEV-1` · `SEV-2` · `SEV-3` · `SEV-4`

```yaml
severity: SEV-2
```

</Card>

<Card title="priority — incident priority level">

`enum` · optional

**Accepted values:** `P1` · `P2` · `P3` · `P4` · `P5`

```yaml
priority: P2
```

</Card>

<Card title="audiences — notification channels">

`array of strings or mappings` · optional · default: `[]`

Audience names linking this monitor to channels defined in Notifications as Code. In exported/rendered YAML, appears as `labels`.

An entry can instead be a mapping that narrows an audience to specific triage priorities, so it is only notified about alerts scored at those priorities. Some audience must cover `NOT_TRIAGED`. See [Routing alerts by triage priority](https://docs.getmontecarlo.com/docs/notifications-v2#routing-alerts-by-triage-priority).

```yaml
audiences:
  - data-eng-oncall
  - platform-alerts
  - audience: oncall
    triage_priority: [HIGH]
```

</Card>

<Card title="failure_audiences — notification channels for run failures">

`array of strings` · optional

Separate audience for run failures. Defaults to `audiences` when omitted.

```yaml
failure_audiences:
  - data-eng-oncall
```

</Card>

<Card title="notify_run_failure — notify on run failures">

`boolean` · optional

```yaml
notify_run_failure: true
```

</Card>

<Card title="timeout — query timeout in seconds">

`integer` · optional

```yaml
timeout: 300
```

</Card>

<Card title="tags — key-value pairs for organizing monitors">

`array of objects` · optional · default: `[]`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | string | yes | Tag key |
| `value` | string | no | Tag value |

<br />

```yaml
tags:
  - name: team
    value: analytics
  - name: environment
    value: production
```

</Card>

<Card title="data_quality_dimension — data quality category">

`enum` · optional

**Accepted values:** `ACCURACY` · `COMPLETENESS` · `CONSISTENCY` · `TIMELINESS` · `UNIQUENESS` · `VALIDITY`

```yaml
data_quality_dimension: VALIDITY
```

</Card>

<Card title="notes — internal notes">

`string` · optional

Visible in the Monte Carlo UI. Not included in notifications.

```yaml
notes: Owned by the analytics team. Reviewed quarterly.
```

</Card>

<Card title="is_draft — create as draft without activating">

`boolean` · optional · default: `false`

Creates the monitor in a paused state. Omitting this on a later update resets to `false` (active) due to PUT semantics — always include it if you want the monitor to stay in draft.

```yaml
is_draft: true
```

</Card>

<Card title="uuid — update an existing monitor">

`string` · optional

Include the UUID of an existing monitor to update it instead of creating a new one.

```yaml
uuid: 0dae7702-0950-45c7-909c-7e183bddca19
```

</Card>

<Card title="auto_tuning — override auto-apply tuning for this monitor">

`boolean` · optional

Force auto-apply tuning on (`true`) or off (`false`) for this monitor, overriding the account or domain default. Omit to inherit. See [Bayes monitor tuning](https://docs.getmontecarlo.com/docs/tuning-agent#per-monitor-auto-apply-override).

```yaml
auto_tuning: false
```

</Card>

<Card title="auto_triage — override auto-triage for this monitor">

`boolean` · optional

Force auto-triage on (`true`) or off (`false`) for this monitor, overriding the account or domain default. Omit to inherit. See [Bayes triage](https://docs.getmontecarlo.com/docs/triage-agent#per-monitor-override).

```yaml
auto_triage: false
```

</Card>

</Cards>

<Accordion title="Deprecated fields">

| Field | Use instead |
|-------|-------------|
| `resource` | `warehouse` |
| `domain` | `domains` |
| `domain_uuids` | `domains` |
| `labels` | `audiences` |
| `notify_rule_run_failure` | `notify_run_failure` |

</Accordion>

> 📘 **API-only fields**
>
> Some fields visible in the API or JSON Schema (`metadata`) are present in the schema but silently stripped during MaC YAML processing. They have no effect and should not be included.

## Examples

### Null check — alert when required field is null

```yaml
montecarlo:
  validation:
    - name: orders_user_id_not_null
      description: "Alert when user_id is null in orders table"
      schedule:
        type: fixed
        interval_minutes: 720
      data_source:
        table: "analytics_db:public.orders"
      alert_condition:
        type: GROUP
        operator: AND
        conditions:
          - type: UNARY
            predicate:
              name: "null"
            value:
              - field: user_id
      domains:
        - my-domain
```

### Range validation — alert when age is out of bounds

```yaml
montecarlo:
  validation:
    - name: users_age_range
      description: "age must be between 0 and 150"
      schedule:
        type: fixed
        interval_minutes: 720
      data_source:
        table: "analytics_db:public.users"
      alert_condition:
        type: GROUP
        operator: OR
        conditions:
          - type: UNARY
            id: age_negative
            predicate:
              name: is_negative
            value:
              - field: age
          - type: BINARY
            id: age_too_high
            predicate:
              name: greater_than
            left:
              - field: age
            right:
              - literal: "150"
      domains:
        - my-domain
```

### Percentage threshold — tolerate small violation rates

```yaml
montecarlo:
  validation:
    - name: orders_failed_amount_check
      description: "Custom business logic check"
      schedule:
        type: fixed
        interval_minutes: 720
      data_source:
        table: "analytics_db:public.orders"
      alert_condition:
        type: GROUP
        operator: AND
        conditions:
          - type: SQL
            id: custom_check
            sql: "status = 'failed' AND amount < 0"
      percentage_threshold: 5
      percentage_operator: GT
      priority: P3
      audiences:
        - data-eng-oncall
      domains:
        - my-domain
```

## Troubleshooting

### Conditions and predicates

**Conditions match INVALID data.** The most common mistake is writing conditions that match valid rows. A row that matches the predicate is a breach.

| Intent                  | Wrong                              | Correct                                  |
| ----------------------- | ---------------------------------- | ---------------------------------------- |
| Email must not be null  | `null` with `negated: true`        | `null` (no negation)                     |
| Status must be "active" | `equal` to "active"                | `equal` to "active" with `negated: true` |
| Amount must be positive | `is_negative` with `negated: true` | `is_negative` (no negation)              |

<br />

**Wrong predicate names.** Use the exact names from the predicates list.

| Wrong      | Correct                                                          |
| ---------- | ---------------------------------------------------------------- |
| `not_null` | `null` with `negated: true`                                      |
| `is_null`  | `null`                                                           |
| `gt`, `>`  | `greater_than`                                                   |
| `eq`, `==` | `equal`                                                          |
| `regex`    | `matches_regex`                                                  |
| `between`  | Two conditions: `greater_than_or_equal` AND `less_than_or_equal` |

<br />

### Schema and syntax errors

* `alert_conditions`**&#x20;(plural) vs&#x20;**`alert_condition`**&#x20;(singular).** Validation uses the singular form. The plural form causes a validation error.
* `percentage_threshold`**&#x20;and&#x20;**`percentage_operator`**&#x20;must be paired.** Setting one without the other causes a validation error. Both must be present or both must be omitted.
* **Literal on left side of BINARY.** Left side must always be a field reference — you cannot put a `literal`, `sql`, or aggregate on the left side.
* **SELECT in a SQL node.** SQL nodes must be boolean expressions, not queries. No `SELECT` keyword.
* `alert_condition`**&#x20;as a JSON string.** Must be a YAML/JSON object, not a serialized string.
* **Size limit.** The serialized condition tree must be under 200,000 characters.

### Noise reduction and updates

* `event_rollup_count`**&#x20;,&#x20;**`event_rollup_until_changed`**&#x20;**, an&#x64;**&#x20;**`alert grouping`**&#x20;are mutually exclusive.** Setting more than one causes a validation error. Choose one strategy.

- **Forgetting PUT semantics on updates.** When providing `uuid`, omitted fields revert to defaults. Always include every field you want to preserve.

<br />