Lead intake automation in n8n
Every website form lead is cleaned, checked, scored and saved, and a ready-to-send notification is written, with no manual copying.
Demo project, fictional business · n8n workflow

The problem
A small business gets leads from a website form by email. Typos, repeated submissions and half-empty forms pile up, and someone has to decide which lead to call first. This workflow does that work the moment a form is sent.
What each step does
- Webhook: receives the form as a POST request and waits to answer it.
- Clean and Validate: trims spaces, lower-cases the email, turns phone numbers into one format, turns “$1,200” into a number, and lists every problem it finds.
- Valid? A bad lead gets an HTTP 422 answer with the reason, and nothing is stored.
- Read Leads CSV, Dedupe and Score: looks the email up in the saved file. A repeat gets an HTTP 409 answer that names the first lead. A new lead gets a score from 0 to 100 and a hot, warm or cold tier.
- Build CSV Row, Write Lead to CSV: appends one row. Text that starts with = + - or @ gets a leading apostrophe so a spreadsheet cannot run it as a formula.
- Format Notification, Write Notification: writes a short text a person can read in chat or email, saves it to a file, and the form gets an HTTP 201 answer with the same text.
- Error branch: both write steps retry 3 times, 500 ms apart. If they still fail, the form gets an HTTP 500 answer instead of a silent loss.
How it was tested
- n8n 1.123.92 really ran on this machine: the workflow was imported, activated, and 5 test payloads were posted to its webhook. 29 of 29 checks passed.
- 3 leads were accepted (scores 95, 50 and 30 for hot, warm and cold), 1 with a bad email was rejected with the reason, and 1 repeat of the first lead was caught as a duplicate. The saved file holds the header and 3 rows.
- The error branch was forced by making the file read-only: the form got HTTP 500 and the file stayed unchanged. 4 of 4 checks passed.
- A second test needs no n8n at all: it runs the Code-node JavaScript from the exported file against the same 5 payloads. 31 of 31 checks passed.
- The expected scores were worked out by hand before the workflow was written.
Download
The export is inactive by default and uses no credentials. It stores data in a local data folder, so point the three file paths at your own folder or swap them for a Google Sheets or database node.
Built with: n8n 1.123.92 (Webhook, Code, IF, Read/Write File, Respond to Webhook), JavaScript, Node 22 for the offline test
Send me one repetitive task and I will build it as a workflow you can test before it goes live.Contact me