Overview
This node validates various types of input data including strings, numbers, booleans, dates, enums, and phone numbers. It supports multiple validation modes such as outputting detailed validation results, passing through valid items while erroring on invalid ones, or rewriting/formatting phone numbers using a phone number parsing library.
Common scenarios include:
- Ensuring incoming data meets expected formats before further processing.
- Validating user inputs like emails, URLs, dates, or custom patterns.
- Formatting phone numbers into standardized forms for consistency.
- Filtering out invalid data items in workflows to prevent errors downstream.
Practical examples:
- Validate a list of email addresses and output which are invalid.
- Check if numeric inputs fall within specified ranges.
- Format customer phone numbers into E.164 format for CRM integration.
- Validate postal codes or VAT numbers according to country-specific rules.
Properties
| Name | Meaning |
|---|---|
| Node Mode | Determines the node's behavior: • Output Validation Results — outputs validation status and errors. • Output Items — passes valid items, errors on invalid. • Rewrite/Format Phone Numbers — reformats phone inputs. |
| Inputs | Collection of input fields to validate. Each field includes: • Validation Name — identifier for the validation. • Validation Type — boolean, date, enum, number, string. • Various type-specific options (formats, rules). |
| Include Phone Details | When enabled (only in "Output Validation Results" mode), adds detailed phone info such as E.164, national/international formats, detected type, and region. |
Selected Input Field Options (for each input field)
| Name | Meaning |
|---|---|
| Validation Name | Name identifying the validation field. |
| Validation Type | Type of validation: boolean, date, enum, number, string. |
| String Format | For string validations, specifies the format to validate against (e.g., email, URL, UUID, credit card, phone number, etc.). |
| Email Options | Configuration for email validation behavior (allow display name, require TLD, allow IP domain, etc.). |
| Phone Region | ISO 3166-1 alpha-2 code used for parsing phone numbers without country code. |
| Phone Validation Mode | Level of phone number validation (strict valid, possible lenient, valid for region, etc.). |
| Phone Allowed Types | Allowed phone number types (mobile, fixed line, toll free, etc.). |
| Phone Rewrite Format | Target format when rewriting phone numbers (E.164, international, national, RFC3966). |
| Phone Rewrite On Invalid | Action when phone number cannot be parsed/formatted (leave as is, empty string, null, or throw error). |
| Required | Whether the input field must be present and non-empty. |
| Use Custom Error Message | Enable custom error message on validation failure. |
| Custom Error Message Text | The custom error message text. |
| Custom Message Placement | How to combine custom message with standard message (append, prepend, replace). |
| Number Validation Type | For number validations, specify min, max, range, or one-of values. |
| Min Value / Max Value | Minimum and maximum values for number validation. |
| One Of Values | Comma-separated list of allowed number values. |
| Enum Values | Comma-separated list of valid enum values. |
| Date Data | Date string to validate. |
| Boolean Data | Boolean value to validate. |
| Regex Pattern | Custom regex pattern for string validation. |
| Postal Code Locale | Country code for postal code validation. |
| VAT Country Code | Country code for VAT number validation. |
| Tax ID Locale | Locale for tax ID validation. |
| Hash Algorithm | Hash algorithm to validate hash strings (SHA256, MD5, etc.). |
| Strong Password Settings | Parameters for strong password validation (min length, min uppercase, min numbers, etc.). |
Output
The node outputs an array of items corresponding to the input items, with the following variations depending on the selected Node Mode:
Output Validation Results:
Each item’sjsoncontains:isValid: boolean indicating overall validation success.errors: array of validation error objects (field name and message) if any.phoneDetails(optional): detailed phone number info for phone fields if enabled, including E.164 format, national/international formats, detected type, region, validity, and parsing errors.
Output Items:
Passes through original items only if all validations pass; otherwise throws an error describing failed validations.Rewrite/Format Phone Numbers:
Original items with phone number fields rewritten/formatted according to configuration. Adds aphoneRewritesproperty listing details about each rewritten phone number (original, formatted value, format, region, type, validity, errors).
If binary data is present, it is passed through unchanged (not explicitly modified by this node).
Dependencies
- Uses the
google-libphonenumberlibrary internally for phone number parsing, validation, and formatting. - No external API calls or credentials are required.
- All validation logic is performed locally within the node.
Troubleshooting
Validation Failures:
If input data does not meet configured validation rules, errors will be reported per field. Users should check the error messages for guidance on what failed (e.g., invalid email format, number out of range).Phone Rewrite Errors:
If phone number rewriting fails and the "On Invalid" option is set to throw error, the node will error with a message indicating which field failed. To avoid workflow interruption, configure this option to leave the original value or return empty/null instead.Custom Regex Issues:
Invalid regex patterns may cause unexpected validation failures. Ensure regex syntax is correct.Required Fields:
Marked required fields must be present and non-empty; missing required fields cause validation errors.Performance Considerations:
Enabling detailed phone information adds minimal overhead but may slightly increase execution time.
Links and References
- google-libphonenumber GitHub — Library used for phone number validation and formatting.
- Validator.js — Underlying validation rules for many string formats.
- Regular Expressions Tutorial — For crafting custom regex patterns.
- ISO 3166-1 alpha-2 Codes — For specifying country codes in phone and postal code validations.