Input Validator icon

Input Validator

Validate strings, numbers, booleans, dates, enums, and phone numbers

Input Validator

AI-generated

Summary

Validates input fields per item and outputs items with validation results, supporting string, number, boolean, date, enum, and phone number validation with configurable error handling and phone formatting.

Inputs

  • main (required) — Primary n8n item flow containing data to validate.
  • inputs.inputFields — Fixed collection of validation field configurations. Each entry specifies a unique name, validation type, and format-specific options. Multiple values allowed; shown when nodeMode is 'output-items'.

Output shape

Each output item contains the original JSON data modified according to validation results, with an added 'isValid' boolean and optional 'errors' array.

Failed fields are handled per the global 'onInvalid' setting (default: 'skip-field', which removes the field but preserves the item). When 'outputOnlyIsValid' is enabled, only '{isValid, errors}' are output. Phone rewrite results appear as a 'phoneRewrites' array when 'enablePhoneRewrite' is true.

Examples

Example 1: Validate an email string and a mobile phone number, output items with isValid included, and format the phone number to E164.

Set nodeMode to 'output-items', add two input fields: validationName 'emailAddress' with validationType 'string' and stringFormat 'email'; validationName 'mobilePhone' with validationType 'string', stringFormat 'mobilePhone', enablePhoneRewrite true, phoneRegion 'US'. Set onInvalid to 'skip-field'. Enable outputOnlyIsValid false (default). Run item with json {'email': 'test@example.com', 'phone': '415-222-3333'}. Output item will have isValid true, email validated, phoneRewrites containing the formatted E164 number '+14152223333'.

Discussion