Appearance
Validate
The Validate node checks input fields against a list of validation rules. If any rule fails, it returns an error object with _valid: false and a list of error messages. If all rules pass, the input flows through unchanged.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
rules | array | [] | Required. An array of validation rule objects. |
Each rule object has:
| Property | Type | Description |
|---|---|---|
field | string | The field name to validate. |
rule | string | The validation rule type. |
value | string | The rule parameter (used by some rule types). |
Validation Rule Types
| Rule | Value | Description |
|---|---|---|
required | -- | Field must not be null, empty string, or empty array. |
min_length | number | String must be at least this many characters. |
max_length | number | String must be at most this many characters. |
email | -- | Must be a valid email address (uses FILTER_VALIDATE_EMAIL). |
numeric | -- | Must be a numeric value. |
min | number | Numeric value must be at least this amount. |
max | number | Numeric value must be at most this amount. |
regex | pattern | Must match the given regular expression pattern (without delimiters). |
Input
Accepts a single object or an array of rows. When an array is provided, only the first row is validated.
Output
Validation passes
Returns the input data unchanged.
Validation fails
Returns an error object:
json
{
"_valid": false,
"_errors": [
{ "field": "email", "message": "email must be a valid email" },
{ "field": "name", "message": "name is required" }
]
}The frontend form system automatically displays these errors next to the corresponding form fields.
Example Rule Configurations
Contact form validation
json
[
{ "field": "name", "rule": "required" },
{ "field": "name", "rule": "min_length", "value": "2" },
{ "field": "email", "rule": "required" },
{ "field": "email", "rule": "email" },
{ "field": "message", "rule": "required" },
{ "field": "message", "rule": "min_length", "value": "10" }
]Numeric range validation
json
[
{ "field": "quantity", "rule": "required" },
{ "field": "quantity", "rule": "numeric" },
{ "field": "quantity", "rule": "min", "value": "1" },
{ "field": "quantity", "rule": "max", "value": "100" }
]Pattern-based validation
json
[
{ "field": "phone", "rule": "regex", "value": "^\\+?[0-9\\s\\-]{7,15}$" },
{ "field": "username", "rule": "regex", "value": "^[a-zA-Z0-9_]{3,20}$" }
]Example Use Case
Form submission pipeline
Context --> Validate --> Sanitize --> Save Row --> Send Email --> OutputIf validation fails, the pipeline returns the _valid: false response immediately. The form displays errors, and no data is saved or emailed.
TIP
Always pair Validate with Sanitize in form submission pipelines. Validate checks correctness; Sanitize cleans the data before storage.
WARNING
Validation runs server-side and cannot be bypassed by manipulating the frontend. This is a security feature -- always validate user input in the pipeline, even if you also validate on the client.