Skip to main content
Validation commands enable you to validate data quality, structure, and content to ensure data meets expected criteria before processing. These commands are essential for data quality assurance and error prevention.

Overview

Validation commands provide functionality for:
  • Validating data structure and format
  • Checking data types and values
  • Verifying data completeness
  • Validating data against schemas
  • Ensuring data quality standards

Common Use Cases

  • Data Quality Assurance: Ensure data meets quality standards
  • Schema Validation: Validate data against expected schemas
  • Type Checking: Verify data types match expectations
  • Completeness Checks: Ensure required fields are present
  • Error Prevention: Catch data issues before processing

Command Parameters

Validation commands typically support the following parameters:
ParameterTypeDescriptionRequired
dataobjectData to validateYes
schemaobjectValidation schemaYes
rulesarrayValidation rules to applyYes
onErrorstringAction to take on validation errorNo

Validation Types

Structure Validation

Validate data structure:
{
  "command": "validate",
  "params": {
    "data": "${input}",
    "schema": {
      "type": "object",
      "required": ["id", "name"],
      "properties": {
        "id": {"type": "string"},
        "name": {"type": "string"}
      }
    }
  }
}

Type Validation

Validate data types:
{
  "command": "validate-type",
  "params": {
    "data": "${value}",
    "expectedType": "string"
  }
}

Value Validation

Validate data values:
{
  "command": "validate-value",
  "params": {
    "data": "${value}",
    "rules": [
      {"type": "minLength", "value": 5},
      {"type": "maxLength", "value": 100}
    ]
  }
}

Validation Rules

Common validation rules include:
  • Required Fields: Ensure required fields are present
  • Type Checking: Verify data types match expectations
  • Range Validation: Check numeric values are within ranges
  • Format Validation: Validate string formats (email, URL, etc.)
  • Length Validation: Check string lengths

Best Practices

  • Validate Early: Validate data as early as possible in workflows
  • Clear Error Messages: Provide clear, actionable error messages
  • Handle Validation Errors: Implement proper error handling
  • Use Schemas: Define validation schemas for consistency
  • Test Validation: Test validation rules with various data scenarios