Validate Data
Validates the input payload against a JSON Schema (Draft-07).
Validates the incoming payload against a JSON Schema with Ajv 8 and routes the unchanged payload to valid or invalid.
Ensures data quality and integrity by strictly enforcing structure, types, and constraints before proceeding in the workflow. If validation fails, execution is routed to the 'invalid' port with detailed error metadata.
Features:
- Uses AJV (Another JSON Validator) under the hood.
- Supports full JSON Schema specification.
- Provides detailed error reports in the metadata.
Use Cases:
- Verifying API request bodies.
- Ensuring mandatory fields exist before database insertion.
- Validating configuration parameters.
How it works
- Resolves the config.
schemacan be an object or a JSON string (as the code editor saves it); a string is parsed. - Fails when the schema is missing or not an object.
- Compiles the schema on every run with Ajv (
allErrors: true, strict mode on, draft-07 by default). - Valid: the payload leaves through
valid. - Invalid: the payload leaves through
invalidand every Ajv error is listed inmeta.validation_errors.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-validate-payment",
"label": "Validate payment",
"operator_slug": "data.validate",
"operator_version": "1.0.0",
"config": {
"schema": {
"type": "object",
"required": [
"id",
"amount"
],
"properties": {
"id": {
"type": "string"
},
"amount": {
"type": "number",
"minimum": 0
}
}
}
}
}{
"ok": true,
"data": {
"id": "pay_88",
"amount": 120.5
},
"port": "valid"
}Configuration
-
schemaobject Required -
The schema object to validate against.
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
schema - String values inside the schema containing
{{ }}are resolved by the Expression Engine before compiling.
Output ports
valid default The payload matches the schema.
{
"id": "pay_88",
"amount": 120.5
}invalid The payload violates the schema. data is the unchanged payload.
{
"id": "pay_88",
"amount": "120.5"
}error The schema is missing, is not valid JSON or does not compile.
{
"ok": false,
"errors": [
"Validation Error: strict mode: unknown keyword: \"required_fields\""
],
"port": "error"
}In expressions
What a later node can read from this node's output with $("Validate Data").item.json.<path> (write your node's label instead of Validate Data). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through valid, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Validate Data").item.json.payload | — | |
$("Validate Data").item.json.id | — | |
$("Validate Data").item.json.amount | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
Schema is not valid JSON: <message> | error | schema is a string that is not valid JSON. |
Schema definition is required and must be an object | error | schema is missing or resolved to a non-object. |
Validation Error: strict mode: unknown keyword: "<keyword>" | error | The schema uses a keyword Ajv does not know. Strict mode rejects it at compile time. |
Validation Error: unknown format "<format>" ignored in schema at path "<path>" | error | format (email, date-time, uri...) needs ajv-formats, which is not loaded, so any format fails compilation. Use pattern instead. |
Input contract
-
payloadobject Optional
Output contract
-
payloadobject Optional
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "data.validate",
"name": "Validate Data",
"category": "data",
"version": "1.0.0",
"description": "Validates the input payload against a JSON Schema (Draft-07).\n\n Ensures data quality and integrity by strictly enforcing structure, types, and constraints before proceeding in the workflow. If validation fails, execution is routed to the 'invalid' port with detailed error metadata.\n\n **Features:**\n - Uses AJV (Another JSON Validator) under the hood.\n - Supports full JSON Schema specification.\n - Provides detailed error reports in the metadata.\n\n **Use Cases:**\n - Verifying API request bodies.\n - Ensuring mandatory fields exist before database insertion.\n - Validating configuration parameters.",
"capabilities": [
"validation",
"schema",
"json",
"quality"
],
"config_schema": {
"type": "object",
"required": [
"schema"
],
"properties": {
"schema": {
"type": "object",
"title": "JSON Schema",
"description": "The schema object to validate against.",
"ui_widget": "code_editor",
"ui_options": {
"language": "json"
}
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"description": "The payload to validate.",
"properties": {
"payload": {
"type": "object"
}
}
},
"output_contract_schema": {
"type": "object",
"description": "The original payload (if valid).",
"properties": {
"payload": {
"type": "object"
}
}
},
"ports": [
{
"port_id": "valid",
"label": "Valid",
"is_default": true,
"description": "Data conforms to schema."
},
{
"port_id": "invalid",
"label": "Invalid",
"description": "Data violates matches schema."
},
{
"port_id": "error",
"label": "Error",
"description": "Schema compilation or system error."
}
],
"execution_mode": "sync",
"tags": [
"validation",
"quality",
"schema"
],
"is_stateful": false,
"publisher": {
"identity": "org_link_loom",
"profile": {
"name": "Link Loom",
"verified": true,
"url": "https://me.veripass.com/link-loom",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"schema"
],
"properties": {
"schema": {
"type": "object",
"title": "JSON Schema",
"description": "The schema object to validate against.",
"ui_widget": "code_editor",
"ui_options": {
"language": "json"
}
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"description": "The payload to validate.",
"properties": {
"payload": {
"type": "object"
}
}
}{
"type": "object",
"description": "The original payload (if valid).",
"properties": {
"payload": {
"type": "object"
}
}
}[
{
"port_id": "valid",
"label": "Valid",
"is_default": true,
"description": "Data conforms to schema."
},
{
"port_id": "invalid",
"label": "Invalid",
"description": "Data violates matches schema."
},
{
"port_id": "error",
"label": "Error",
"description": "Schema compilation or system error."
}
]Execution
- Execution
sync- Stateful
- No
- Retries (
retryOnFail) - No
- Capabilities
validationschemajsonquality- Tags
validationqualityschema
Notes and limits
metais recorded in the run steps only: downstream nodes receivedataas their payload and cannot readmetathrough$jsonor$("Node").invalidis not an error: the envelope hasok: true. Connectinvalidto the branch that handles rejected data.- When the envelope has no
data(ordatais falsy), the engine stores the whole envelope as the node output: onerrorthe next node receives{ ok: false, errors: [...], port: "error" }as its payload.
Reviewed against the orchestrator code · 31e874b · 2026-11-26