Data Validator Node
Validate and structure data using JSON Schema.
Overview
The Data Validator node validates input data against a JSON Schema you define. It ensures data conforms to expected types, formats, and constraints before processing.
Configuration
| Field | Description | Required |
|---|---|---|
Input Data |
The data to validate (supports variables) | Yes |
Root Data Type |
Object, Array, String, Number, or Boolean | Yes |
Output Variable |
Variable name to store validated data | Yes |
Root Data Types
| Type | Description |
|---|---|
Object |
Validate an object with defined properties |
Array |
Validate an array of items |
String |
Validate a string value |
Number |
Validate a numeric value |
Boolean |
Validate a boolean value |
Defining Fields (Object/Array)
For Object and Array types, define the expected fields:
- Click Add Field to create a new field
- Set the field name
- Choose the field type
- Configure settings (click gear icon)
Field Types
| Type | Description |
|---|---|
String |
Text values |
Number |
Numeric values |
Boolean |
True/false values |
Object |
Nested objects |
Array |
Nested arrays |
File |
File references |
Field Settings
Click the settings icon on any field to configure:
String Settings
Min Length- Minimum character countMax Length- Maximum character countPattern- Regex pattern to matchEnum- Allowed values (comma-separated)Required- Field must be present
Number Settings
Minimum- Minimum valueMaximum- Maximum valueEnum- Allowed values (comma-separated)Required- Field must be present
Array Settings
Min Items- Minimum array lengthMax Items- Maximum array lengthItem Type- Type of array items
File Settings
Allowed Extensions- Permitted file typesMax Size- Maximum file size
Array Item Types
When root type is Array, choose the item type:
| Item Type | Description |
|---|---|
Object |
Array of objects with defined fields |
Array |
Array of arrays |
String |
Array of strings |
Number |
Array of numbers |
Boolean |
Array of booleans |
Example Schema
For validating user data:
{
"type": "object",
"properties": {
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "pattern": "^[^@]+@[^@]+$" },
"age": { "type": "number", "minimum": 0, "maximum": 150 }
},
"required": ["name", "email"]
}
Using Variables
Pass data from previous nodes:
{{api_response}}
{{form_submission}}
{{parsed_json}}
Validation Output
If validation passes, the validated data is stored in your output variable. If validation fails, the workflow can handle the error in subsequent nodes.
Best Practices
- Define schemas that match your expected data structure
- Use required fields for critical data
- Add constraints (min/max) to prevent invalid data
- Test with sample data before production use