n8n · Data Sync
Webhook form validation API
- n8n
- beginner
- 3 nodes
- ~3 min setup
Tested on n8n 2.25.7 · Last verified 2026-06-21 · v1.0
- Trigger Webhook POST /webhook/validate Receives the form / JSON submission
- AI Code Validate fields & email Builds an errors list; sets 200 or 400
- Action Respond to Webhook Return result + status code 200 { ok, data } or 400 { ok:false, errors }
What it does
A no-code form/API validation endpoint: a Webhook receives a POST, a Code node checks required fields and email format, and Respond to Webhook returns 200 with the data or 400 with a list of errors — zero credentials.
- Webhook
- Code
- Respond to Webhook
How to import it into n8n
- Copy the workflow JSON Use the Copy JSON button above (or download the .json file).
- Open your n8n canvas In n8n, open Workflows and create a new, empty workflow.
- Paste to import Press Ctrl/Cmd+V on the canvas, or use the ⋯ menu → Import from File / Import from URL. n8n recreates every node.
- Connect your credentials Open each node flagged with a credential placeholder and select your own account — see the credentials table below.
- Test, then activate Run once with test data to confirm the path end-to-end, then toggle the workflow Active.
Notes for this template
- After importing, open the Webhook node and copy its Production URL — that is your validation endpoint.
- Edit the Code node to change the rules (required fields, formats, allowed values).
- The node returns HTTP 200 for valid input and 400 with an errors array for invalid input.
- Point your form or front-end at the webhook URL and read ok / errors from the response.
Credentials you’ll connect
No external credentials required.
Live end-to-end test on n8n 2.25.7
Request
POST /webhook/validate
Content-Type: application/json
{ "email": "bad" } Response
400 → { "ok": false, "errors": ["name is required", "a valid email is required"] }
A valid body returns 200 → { "ok": true, "data": { ... } } Frequently asked questions
Do I need any credentials?
No. It uses only built-in nodes (Webhook, Code, Respond to Webhook) — no API keys or accounts.
What does it validate?
Out of the box: a required name and a well-formed email. Edit the Code node to add any rules you need.
Has this really been tested?
Yes. On a real n8n 2.25.7 instance, a valid POST returns 200 and an invalid one returns 400 with the exact errors shown above.
How do I use the response?
Your form or app reads the JSON: on 200 use data; on 400 show the errors array to the user.
Is it free?
Yes — free to download and use, no signup and no email required.