When to use validation
- You want to catch bad extractions before delivery: missing required fields, malformed totals, wrong currency.
- You want to gate runs that should go to review when something looks off. Pair validation
Warnwith a downstream review node. - You need to enforce a strict contract with an external system. Use Schema mode with a JSON Schema document.
- You want a programmable check (regex, cross-field math). Use Script mode for deterministic logic, AI mode when the check is genuinely judgment-based.
- Skip validation when the criteria are simple presence checks already covered by the schema’s
requiredfield on extract.
Failure actions
Every validation mode uses a failure action to control what happens when validation errors are found. To send failures to a person, choose Warn and route an If on{{metadata.validationFailures}} is not empty into a downstream Review node.
Modes
Rules
Define field-level validation rules using a visual rule editor. Each rule specifies a field path (supports dot notation and array indexing, e.g.items[0].name), an operator, and an optional value. You can also set a custom error message per rule.
Operators
Expression rules
Theexpression operator runs a small arithmetic expression against the upstream payload, so you can enforce cross-field invariants that no single-field operator can express. The Field input is hidden in the editor; the whole rule is just one expression.
Supported syntax:
sum, avg, min, and max require a list of numbers: if their argument plucks a field whose element type is text or yes/no from an array, the workflow editor flags it as a validation error on the node at save time. count accepts a list of any element type, and length accepts a list or text.
Numeric values come from JSON numbers directly. Currency-formatted strings like "$1,234.50" are also accepted; the evaluator strips common currency markers and thousand separators. If the rule violates, every field referenced by the expression is treated as the affected field (used by the Warn action to populate {{metadata.validationFailures}}, which a downstream Review node consumes).
The expression syntax is independent of the
{{ ... }} template syntax used elsewhere. Inside an expression rule, write subtotal + tax = total, not {{subtotal}} + {{tax}} = {{total}}. The braces are only required around aggregate-function arguments (sum({{items[*].amount}})).Schema
Validate data against a JSON Schema document. Paste or write your schema in the editor and the node validates the incoming data against it. Useful when you need to enforce a strict contract on the data shape.Endpoint
Call an external HTTP endpoint to validate data. The node sends the data to your URL and interprets the response to determine pass or fail.
By default, the node looks for
valid or isValid (boolean) and errors (string array) at the root of the response body. Use response mapping to point to different paths if your endpoint returns a different shape.
The endpoint request uses a fixed 45-second server timeout; it is not configurable per node. Transient errors (HTTP 429, 502, 503, 504) are retried automatically.
Script
Write JavaScript validation logic that runs in a sandboxed runtime. Each upstream node is exposed as a JS global with the same shape as{{nodeName}} in templates (success, payload, metadata, error). Reference upstream values by node name, for example extract.payload.email or vars.payload.amountLimit.
Runtime limits:
The editor provides syntax highlighting, autocomplete, and inline error reporting.
Return values:
The script must contain a
return statement. Object return values are not supported.AI
Write plain-language checks and the AI confirms each one against the data. A check is one sentence; give it an optional field so a failure points a reviewer at that field.
A node holds up to 20 checks, each up to 500 characters; all of them are asked in one call per document. A check passes when the AI is at least 70% confident it holds; a failing check reports its sentence and that percentage, for example “The invoice total equals the sum of the line items (41% confident)”. Every check’s result is written to
metadata.validation.checks.
The AI reads up to 24,000 characters of the upstream data. Long text values are shortened first and marked with an ellipsis, and the step reports a “Data was trimmed” warning when that happens. Data that still does not fit is never judged in part: every check fails with a message naming the size, and the failure action decides what happens next. Narrow the payload with a Transform node before this node in that case.
The AI check costs one flat rate per step whatever the page count (see credits). If the AI check cannot be reached, the step retries and then fails; it never passes silently.
Output format
The validation node passes the upstream data through unchanged as its payload, and the validation diagnostics live in metadata undermetadata.validation. Downstream nodes reference the data fields directly (no data wrapper), for example {{node.payload.total}}, and read the diagnostics as {{node.metadata.validation.isValid}}.
checks, one entry per check:
Inputs and outputs
Allowed inputs: every action node, including another validation, the connector nodes (Business Central and QuickBooks in any operation, and callback), and the sub-workflow trigger (validate the caller-supplied data before acting on it). Output: The original data as the payload, with validation diagnostics inmetadata.validation. When failure action is fail and validation errors exist, the step fails and downstream nodes do not execute.
Common pitfalls
Failure action set to Fail when you wanted a soft check
Failure action set to Fail when you wanted a soft check
Fail halts the workflow and downstream nodes never run. If you wanted the run to continue but to flag the issue, switch to Warn and consume the metadata.validation.warnings array downstream.Endpoint mode without response mapping for a non-standard API
Endpoint mode without response mapping for a non-standard API
By default, the endpoint mode looks for
valid (or isValid) and errors at the response root. If your service returns a different shape, set Response mapping to point at the correct paths or every response will be treated as invalid.Script that doesn't return
Script that doesn't return
The script must contain a
return statement. A script that finishes without returning is treated as undefined (which passes validation), so a missing return silently disables the check.AI mode used for a check that's actually deterministic
AI mode used for a check that's actually deterministic
AI validation costs LLM credits per run. If the check is “amount must be a positive number” or “currency must be USD or EUR,” use Rules or Script mode for free, deterministic results. Reserve AI mode for genuinely judgment-based checks; it costs one flat rate per step.
Validation duplicating the extract schema's required list
Validation duplicating the extract schema's required list
A
required field marked on the extract schema already gates the field’s presence. Don’t repeat the same check in validation; use validation for the harder constraints (formats, ranges, cross-field rules).Routing validation failures to a human
Routing validation failures to a human
Set the failure action to Warn and route an If on
{{metadata.validationFailures}} is not empty into a Review node. Rules failures and AI checks with a field name the field; a fieldless AI check still routes, it just highlights nothing. Schema and Endpoint failures produce warnings but no entries, so route those on {{metadata.validation.isValid}} instead.Expression rule using template braces
Expression rule using template braces
Inside an expression rule, write
subtotal + tax = total, not {{subtotal}} + {{tax}} = {{total}}. The workflow editor flags template-style expressions at save time.The workflow editor checks rule operators and expression types against the upstream schema at save time. A rule that applies
gt to a non-number, sum() to a scalar, or references a field that doesn’t exist surfaces as a validation error on the node before you can save. Applying sum(), avg(), min(), or max() to a list of non-numbers (a plucked text or yes/no field) is likewise flagged before save, whereas count() over the same list is allowed.Related
Extract action
Extract structured data before validating
Review action
Add human review for failed validations
Transform action
Transform validated data to a delivery format
Filter action
Narrow a document to the pages you validate