n8n node for JSON Schema validation with Ajv
npm install n8n-nodes-deeptech-data-validationA powerful n8n node to validate, clean, and route your data using the JSON Schema standard. Ideal for securing your workflows and ensuring data quality before processing.
Developed by DeepTech IA.
---
* Robust Validation: Uses the standard Ajv engine (supports JSON Schema Draft 7+).
* Data Cleaning (Coercion): Can automatically convert types (e.g., "123" string becomes 123 number) using "Lenient" mode.
* Smart Routing: Automatically separates data:
* ā
Output 1: Valid Items.
* ā Output 2: Invalid Items (with full error details).
* Advanced Formats: Natively validates emails, dates, URLs, IPs, etc.
---
n8n-nodes-deeptech-data-validation.Dockerfile or install it in the ~/.n8n volume:``bash`
npm install n8n-nodes-deeptech-data-validation
---
1. Add the Data Validation node to your workflow.
2. Connect your data source (e.g., Webhook, Typeform, Google Sheets).
3. Configure your validation rules in the node panel.
| Parameter | Option | Description |
| :--- | :--- | :--- |
| JSON Schema | JSON | The schema defining the expected structure of your data. |
| Validation Mode | Strict | Data must match exactly (e.g., a number must be a number). |Lenient
| Validation Mode | | Attempts to coerce types (e.g., "true" string becomes boolean true). |Route
| On Error | | Sends invalid items to the "Invalid" output (does not stop the workflow). |Stop
| On Error | | Stops the workflow immediately if an error is detected. |
---
Copy and paste these schemas directly into the node.
`json`
{
"type": "object",
"properties": {
"name": { "type": "string", "minLength": 2 },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 18 }
},
"required": ["name", "email"]
}
`json`
{
"type": "object",
"properties": {
"sku": { "type": "string", "pattern": "^[A-Z]{3}-\\d{3}$" },
"price": { "type": "number", "exclusiveMinimum": 0 },
"tags": {
"type": "array",
"items": { "type": "string" },
"minItems": 1
},
"inStock": { "type": "boolean" }
},
"required": ["sku", "price"]
}
`json`
{
"type": "object",
"properties": {
"username": { "type": "string" },
"contact": {
"type": "object",
"properties": {
"phone": { "type": "string" },
"address": {
"type": "object",
"properties": {
"city": { "type": "string" },
"zip": { "type": "string", "pattern": "^\\d{5}$" }
},
"required": ["city"]
}
}
}
}
}
---
field explaining exactly why:
`json
{
"name": "Bob",
"email": "bob-at-gmail.com",
"_validationErrors": [
{
"path": "/email",
"message": "must match format \"email\""
}
]
}
``---
Generated with ā¤ļø by DeepTech IA for the n8n community.