Parameter validation in Declarative Custom Node

Describe the question

I am developing a custom node in a declarative way. One of the input properties is an email, so it’s declared as a ‘string’ type. I’d like to validate this as a valid email format in the UI, but I can’t figure out how to do this from the documentation.

Here is my property declaration:


      {
        displayName: 'Email Query',
        description: 'Query to search collaborators by exact email',
        name: 'email',
        type: 'string',
				placeholder: '[email protected]',
        default: undefined,
        required: true,
        routing: {
          request: {
            qs: {
              email: '={{ $value }}',
            },
          },
        },
      },
  • n8n version: 1.65.2
  • Database (default: SQLite): SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: MacOS

Hi @david.cabrera,

I don’t think there’s a way to add validation in the node editor UI at the moment (only possible if it’s a resource locator option) but this would be a good feature request :star2: so I’ll move this to the feature request section of the forum, hope that’s alright! Don’t forget to upvote :slight_smile:

2 Likes

This would also be super useful in programmatic node so that values can be checked before executing the node.

1 Like