Validator (VALIDATOR)
Checks the incoming value with a rule, a script or an AI model, and continues on Pass or on Fail. Inside a Loop, Pass ends the loop.
Category: Flow Control · Deployed: yes · Tool-capable: no
Ports
| Port | Kind | Purpose |
|---|---|---|
Input ( |
Input |
The value to check |
Pass ( |
Output |
Runs when the check passes |
Fail ( |
Output |
Runs when the check fails |
The Validator does not change the value. The module after Pass or Fail receives the same value the Validator received. Only one of the two outputs runs. An output with nothing connected simply ends that path.
Properties
Choose the Validation Type first (required). Its own fields appear below it.
| Validation Type | How it checks |
|---|---|
|
Compares one field with a value — fast, exact, and free |
|
Runs your own Python code |
|
An AI model judges the text, for example for harmful content — flexible, but slower, and the result is not always the same |
CONDITION — compare one field
| Field | Required | Meaning |
|---|---|---|
Condition Field ( |
Yes |
The name of the field to check. The previous module must send a JSON object that contains it |
Condition Operator ( |
Yes |
See the table below |
Condition Value ( |
Yes, except for |
The value the field is compared with. For |
| Operator | Passes when |
|---|---|
|
The field’s value is exactly the Condition Value, including upper and lower case |
|
The field’s value is anything else |
|
The Condition Value appears somewhere in the field’s value (upper and lower case must match) |
|
Both are numbers, and the field’s value is greater / smaller. If one is not a number, the check fails |
|
The field is there, whatever its value |
|
The field is not there |
If the incoming value is not a JSON object, every field counts as missing: only NOT_EXISTS passes. An
empty value always fails.
SCRIPT — your own Python code
| Field | Required | Meaning |
|---|---|---|
Script ( |
Yes |
Python code that decides pass or fail. The incoming value is in the variable |
Requirements ( |
No |
Extra Python packages to install before the code runs, for example |
Timeout (s) ( |
No |
How many seconds installing the packages and running the code may take together, 1–300. Default: 30. Higher → slow code can finish. Lower → a stuck script is stopped sooner |
-
pipeline_inputholds the incoming value only when it is a JSON object. For plain text it is empty ({}), so a script cannot read plain text. -
If the script fails, runs too long, or prints anything else, the check fails.
-
The code runs in the same closed-off container as the Python Script module.
LLM — an AI model judges
Use Select AI Server & Model to fill in the model fields at once.
| Field | Required | Meaning |
|---|---|---|
Model Provider ( |
Yes |
|
Model Name ( |
Yes |
For example |
Model URL ( |
Yes |
The address of the model server, for example |
API Key ( |
No |
Needed for |
Model Timeout (min) ( |
No |
How long to wait for the model’s answer, 1–120 minutes. Default: 20. Higher → slow models can finish. Lower → a stuck model stops sooner |
Guardrail Checks ( |
Yes |
What the model checks the text for — the same list as in Guardrails. More checks → more problems are caught, but also more harmless texts fail |
Custom Validation Description ( |
No |
An extra rule in your own words that the model also checks, for example "The answer must not name a price." |
Heuristic Detection Threshold ( |
No |
How strict the check is, from 0.0 to 1.0. Default: 0.5. The model rates how likely the text breaks a rule; a rating below this value passes. Lower → stricter: more texts fail. Higher → more lenient: more texts pass |
|
If the model cannot be reached, times out, or gives an unreadable answer, the value passes. The check is skipped in that case and no error is shown. For a check that must never let something through, make sure the model is reachable, and test the check with a text that should fail. |
-
An empty value passes without a model call.
Use cases
-
The end condition of a Loop — its most important use. Put the Validator into the Loop’s Body and connect Pass to what should happen after success.
-
Branching on data:
CONDITIONwithGREATER_THAN, for example to send a warning only above a limit. -
Quality gate:
LLMwith a Custom Validation Description, for example "The answer must name a source." -
Anything you can compute:
SCRIPTfor checks a single comparison cannot express.
Notes
-
Inside a Loop, Pass is the loop’s real success exit. Fail starts the next round. See Loop.
-
CONDITIONandSCRIPTneed JSON. The previous module must send a JSON object, not plain text. Use Structured Output or Text Format (Word Count) to produce one. -
Different safe direction per type: a broken
SCRIPTfails the check, a brokenLLMcheck passes the value. Keep this in mind for checks that must never let something through. -
Prefer
CONDITIONwhere it is enough — it costs nothing.LLMadds a model call to every check.