Skip to main content

Documentation Index

Fetch the complete documentation index at: https://hypha-docs.plinqx.app/llms.txt

Use this file to discover all available pages before exploring further.

The VALIDATE node validates data against a JSON Schema, ensuring data meets specified requirements before continuing flow execution.

Overview

VALIDATE nodes enable:
  • Schema Validation: Validate data against JSON Schema
  • Type Checking: Ensure correct data types
  • Required Fields: Enforce required fields
  • Format Validation: Validate formats (email, date, etc.)

How It Works

1

Resolve Data

VALIDATE node resolves data expression.
2

Validate Schema

Validates data against provided JSON Schema.
3

Check Result

If valid, flow continues. If invalid, node fails.
4

Error Details

Validation errors available in output.

Configuration

Data Expression

Expression that resolves to data to validate:
{{START.input}}
{{action.response.data}}
{{transform.output}}

JSON Schema

JSON Schema to validate against:
{
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "minLength": 1
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "age": {
      "type": "number",
      "minimum": 0,
      "maximum": 150
    }
  },
  "required": ["userId", "email"]
}

Validation Options

  • All Errors: Collect all validation errors (default: true)
  • Stop on First: Stop validation on first error

Output

VALIDATE node provides output:
{
  "valid": true,
  "errors": null,
  "errorCount": 0
}
If validation fails:
{
  "valid": false,
  "errors": [
    {
      "path": "/userId",
      "message": "must be string",
      "keyword": "type"
    },
    {
      "path": "/email",
      "message": "must match format \"email\"",
      "keyword": "format"
    }
  ],
  "errorCount": 2
}

Schema Features

Type Validation

Validate data types:
  • String: Text values
  • Number: Numeric values
  • Boolean: True/false values
  • Object: Object structures
  • Array: Array structures

Format Validation

Validate formats:
  • Email: Email addresses
  • Date: Date strings
  • URI: URI strings
  • UUID: UUID strings

Constraints

Apply constraints:
  • Min/Max Length: String length limits
  • Min/Max: Number range limits
  • Pattern: Regex pattern matching
  • Enum: Value must be in enum list

Use Cases

Input Validation

Validate flow inputs:
START: Receive input
VALIDATE: Validate input schema
ACTION: Process if valid

API Response Validation

Validate API responses:
ACTION: Call API
VALIDATE: Validate response schema
TRANSFORM: Use validated data

Data Transformation Validation

Validate transformed data:
TRANSFORM: Transform data
VALIDATE: Validate transformation result
ACTION: Use validated data

Error Handling

When validation fails:
  • Node Fails: VALIDATE node fails with validation errors
  • Error Details: Access error details in error handling
  • TRY Node: Use TRY node to handle validation failures gracefully

Best Practices

Validate Early

Validate data as early as possible

Clear Schemas

Use clear, descriptive schemas

Handle Errors

Use TRY nodes to handle validation failures

Test Schemas

Test schemas with various inputs

Next Steps

TRY Node

Handle validation errors

JSON Builder Node

Build validated JSON structures