| Rule kind | How it’s checked | Best for | Cost |
|---|---|---|---|
| AI | A model reads your plain-language description and judges the data | Fuzzy / semantic conditions (“the vendor looks like a real company”, “the two names refer to the same person”) | Billed per rule |
| Deterministic | A structured check runs in plain code — no model | Exact, testable conditions (a number in range, a + b = c, a value in a set, a pattern, a required field) | Free |
Reach for a deterministic rule whenever the condition is something you could check with a calculator or a lookup — it’s instant, free, and never flakes. Use an AI rule when the condition needs judgement or language understanding.
Deterministic checks
Each deterministic rule is built from one check. Fields are referenced by name (the field name from the upstream Extract step).| Check | What it asserts | Example |
|---|---|---|
| Number in range | A numeric field falls within bounds | amount between 0 and 1000000 |
| Date in range | A date field falls within bounds — each an ISO date or today (relative) | expiry_date on or after today (not expired) |
| Arithmetic | A sum / difference / product of fields equals another field, within a tolerance | subtotal + tax = total (±0.01) |
| Comparison | A field compares (=, ≠, >, ≥, <, ≤) to a fixed value or another field | end_date ≥ start_date |
| One of | A field’s value is in an allowed set | currency is one of EUR, USD, GBP |
| Pattern | A field matches a regular expression | iban matches ^[A-Z]{2}\d{2} |
| Required | A field is present and not empty | vendor_name is filled in |
"€1.234,56" and "1,234.56" both parse — and dates accept the common written formats.
Build a rule in Studio
- Add a Validate step after the Extract step whose output you want to check.
- Open the step, go to the Rules tab, and click Add rule.
- Choose AI or Deterministic with the toggle.
- AI — type the rule in plain language; reference a field with the field picker.
- Deterministic — pick a check type, choose the field(s), and enter the values.
- Set a severity (
errororwarning) and save.
Author rules via the API
Validation rules are part of thevalidate node in the typed-graph create body — no separate endpoint. A deterministic rule carries a check; an AI rule carries a description. Reference fields by their name as defined on the upstream extract.
Check payloads
operator defaults to sum; tolerance to 0; case_sensitive to false. Unset date bounds are null.
Author rules with the SDK
The check classes are exported from the workflow package; passValidationRules to .validate().
Rules referencing a field by name require that field to exist on the upstream Extract step. The Studio also lets you reference fields you haven’t saved yet by their persistent id — both forms resolve at run time.
What’s next?
Workflow steps
The five building blocks, including Validate.
How credits work
AI rules bill per rule; deterministic rules are free.
