The idea is:
Add advanced field validation options to the Form Trigger and Form nodes for Text, Textarea, Number, and Date fields.
Text and Textarea fields:
- Configurable
Maximum Lengthproperty. - Optional live character counter (e.g., 245 / 500).
- Prevent typing or pasting content beyond the configured limit.
Number fields: - Configurable
Minimum DigitsandMaximum Digitsproperties. - Optional live digit counter.
- Support exact-length validation (e.g., exactly 10 digits).
- Handle decimal separators and negative numbers consistently.
Date fields: - Configurable
Minimum DateandMaximum Dateproperties. - Support static dates and dynamic n8n expressions or variables.
- Examples:
- Today:
{{ $now.toFormat('yyyy-MM-dd') }} - Tomorrow:
{{ $now.plus({ days: 1 }).toFormat('yyyy-MM-dd') }} - Workflow variable:
{{ $vars.minimumDate }}
- Today:
- Disable dates outside the allowed range in the date picker.
- Validate manually entered dates as well.
- Respect the workflow timezone.
Additional validation: - Optional regex validation for Text fields.
- Optional custom validation error messages.
- Client-side and server-side validation.
- All new properties should remain optional to preserve backward compatibility.
My use case:
I use self-hosted n8n forms for internal business processes, including approval workflows, requests, data collection, and automated operations.
I regularly encounter situations where input validation is necessary:
- Text fields: Restrict titles, names, references, or short descriptions to a maximum number of characters.
- Textarea fields: Limit comments, justifications, or detailed descriptions to a predefined length.
- Number fields: Require a specific number of digits for identifiers or other structured numeric values.
- Date fields: Prevent users from selecting dates in the past, or restrict selections to a dynamically calculated date range.
For example, in an internal request form, I may need to: - Limit the request title to 100 characters.
- Limit the description to 500 characters.
- Validate a numeric identifier with exactly 10 digits.
- Prevent selecting a requested execution date earlier than today.
Ideally, these restrictions should be configured directly within the Form node, without requiring additional workflow nodes or custom HTML forms.
I think it would be beneficial to add this because:
Currently, implementing these validations requires additional workflow logic, custom forms, or validation after submission.
This creates several limitations:
- Users can submit invalid data before discovering that their input does not meet the requirements.
- Additional IF or Code nodes are needed to validate values.
- Invalid submissions require custom error handling or additional form steps.
- Users receive no immediate visual feedback about character limits or allowed dates.
- Maintaining consistent validation across multiple forms becomes unnecessarily complex.
Adding native validation would: - Improve the user experience with immediate feedback.
- Reduce invalid submissions and unnecessary workflow executions.
- Simplify workflow design and maintenance.
- Improve data quality before information reaches downstream systems.
- Make n8n Forms more suitable for professional internal business applications.
These are standard input validation capabilities commonly available in form-building solutions and HTML forms.
Any resources to support this?
These features could leverage existing HTML validation capabilities:
- HTML
maxlengthattribute for Text and Textarea fields. - HTML
minandmaxattributes for Date fields. - HTML
patternattribute for Text fields. - Custom digit-count validation for Number fields, since HTML Number inputs do not support
maxlength.
References: - MDN — maxlength: maxlength HTML attribute - HTML | MDN
- MDN — min: min HTML attribute - HTML | MDN
- MDN — max: max HTML attribute - HTML | MDN
- MDN — pattern: pattern HTML attribute - HTML | MDN
- n8n Form node documentation: n8n Form | Nodes | n8n Docs
The existing form rendering components could potentially be extended to support these optional validation properties.
Are you willing to work on this?
I’m happy to help test this feature, provide real-world use cases, and validate the implementation in a self-hosted n8n environment.
I’m not currently planning to contribute the implementation directly, but I would be glad to provide feedback during development or testing.