Documentation is being updated. Some sections may not reflect the latest features.
Looking for step-by-step guides? Explore Tutorials →

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:

  1. Click Add Field to create a new field
  2. Set the field name
  3. Choose the field type
  4. 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 count
  • Max Length - Maximum character count
  • Pattern - Regex pattern to match
  • Enum - Allowed values (comma-separated)
  • Required - Field must be present

Number Settings

  • Minimum - Minimum value
  • Maximum - Maximum value
  • Enum - Allowed values (comma-separated)
  • Required - Field must be present

Array Settings

  • Min Items - Minimum array length
  • Max Items - Maximum array length
  • Item Type - Type of array items

File Settings

  • Allowed Extensions - Permitted file types
  • Max 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
AI AssistantPowered by Ubex
Beta
Ask me anything about Ubex workflows, nodes, or the API.