Validator Nodes
Last updated
Last updated
Validator nodes are essential components within Dynamiq's platform that perform data validation within your workflows. These nodes act as quality control checkpoints, ensuring that data meets specific criteria before proceeding through the workflow.
Flexible validation rules
Configurable error handling behavior
Support for multiple data formats
Built-in error messaging
Validates that the input content follows the correct Python syntax.
Example Usage:
Ensures input content is properly formatted JSON. Handles both string and dictionary inputs.
Example Usage:
Verifies that the input content matches one of the predefined acceptable values.
Example Configuration:
Validates the input content against a specified regular expression pattern.
Match Types:
fullmatch
: Entire string must match the pattern
search
: Pattern can match anywhere in the string
Example Configuration:
Each validator node shares these common configuration options:
Setting | Description | Options |
---|---|---|
Name | Node identifier in the workflow | Text input |
Behavior | Action on validation failure |
|
Valid Choices
Choices: List of acceptable values
Strip whitespace: Automatically applied to string inputs
Regex Match
Regex: Regular expression pattern
Match_type: FULL_MATCH
or SEARCH
When behavior
is set to RETURN
, validators output:
When behavior
is set to RAISE
, validators:
Return the input content if validation passes
Raise a ValueError
with detailed error message if validation fails
Error Handling
Use RAISE
behavior for critical validation points
Use RETURN
behavior when you need to handle invalid data gracefully
Input Sanitization
Consider using RegexMatch for input sanitization
Valid Choices for enforcing controlled vocabularies
Performance
Place validators early in workflows to fail fast
Use appropriate match types in RegexMatch to optimize performance
Form Validation
Configuration Validation
Code Quality Checks
Common validation errors and solutions:
Error | Possible Cause | Solution |
---|---|---|
"Value is not valid JSON" | Malformed JSON string | Check JSON syntax and structure |
"Value is not in valid choices" | Input not in choices list | Verify input against allowed values |
"Value does not match pattern" | Regex pattern mismatch | Test pattern with regex debugger |
"Value is not valid python code" | Python syntax error | Check code formatting |