AI Automation
How to Automate Website Leads With n8n: A Practical Workflow
Most websites send form submissions to a single inbox and hope someone notices. A small automated workflow can make sure every enquiry is validated, stored, routed and acknowledged within seconds. This article outlines a practical design using n8n, an open-source workflow automation tool.
What the workflow should do
- Receive the form submission.
- Validate the data and filter obvious spam.
- Check whether the contact already exists.
- Create or update the record in your CRM.
- Notify the right person.
- Send an acknowledgement email.
- Schedule a follow-up check.
- Log the outcome and alert on errors.
Step 1: Trigger with a webhook
Use n8n’s Webhook node to receive a POST request from your website’s form handler. Send JSON, and protect the endpoint — for example with a secret header that your server includes and the workflow checks. Never expose that secret in browser JavaScript; send the request from your server.
Step 2: Validate and filter
Use an IF or Code node to check required fields (name, email, message), validate the email format and reject submissions that fail spam checks. Validation should also happen on your website’s server — the workflow is a second line of defence, not the first.
Step 3: Check for duplicates
Search your CRM for an existing contact with the same email address. If one exists, update it and add the new enquiry as an activity or note; otherwise create a new contact. This avoids the duplicate records that make CRMs untrustworthy.
Step 4: Store the lead
Create or update the contact and deal using your CRM’s node (HubSpot, Pipedrive and others have built-in nodes) or an HTTP Request node for any API. Store the lead source, page and any campaign parameters so you can measure which channels produce qualified leads.
Step 5: Route and notify
Use a Switch node to route by service or region, then notify the owner via email, Slack or Microsoft Teams with a short summary and a link to the CRM record.
Step 6: Acknowledge the enquiry
Send a short, plain acknowledgement email that confirms receipt and explains what happens next. Keep it factual — no marketing material the person did not ask for.
Step 7: Follow-up check
A Wait node (or a scheduled workflow) can check after an agreed period whether the lead has been contacted, and remind the owner if not. Automated follow-ups to the lead should only be sent where it is lawful and expected.
Step 8: Handle errors
Configure an Error Workflow in n8n so that any failed execution sends an alert with the execution ID. Use retries for temporary API failures. Without this, a single expired credential can silently lose leads for weeks.
Where AI can help — carefully
An AI step can classify the enquiry by service, summarise long messages or flag likely spam. Treat its output as a suggestion: keep a human decision for anything important, and only send personal data to AI providers your privacy policy covers.
Testing before going live
Test with valid submissions, missing fields, duplicates, spam-like messages and a deliberately broken credential. Check every branch produces the expected result.
Want a workflow like this built and documented for your business? See my AI automation services or get in touch.