DEV Community

Bilal Saleh
Bilal Saleh

Posted on

How to auto-alert yourself about every new lead with n8n

If a lead fills your form at 9pm and you only see the email at 11am, they've often already booked someone else.

Email alerts are easy to ignore. A WhatsApp ping on your phone isn't. This tutorial walks through a free n8n workflow that:

  1. Receives a website form submission via webhook
  2. Validates it (real email or a phone with 8+ digits)
  3. Saves the lead to Google Sheets
  4. Alerts you by email and WhatsApp within seconds
  5. Auto-replies to the lead if they left an email
  6. Returns a clean JSON response the form can show as success/error

No custom code. Built-in n8n nodes only. Works on n8n Cloud and the free self-hosted Community Edition.

What you'll need

  • An n8n account (Cloud or self-hosted)
  • A Google account (for Sheets + Gmail)
  • Optional: a Twilio account if you want WhatsApp/SMS alerts (email-only works without it)
  • A website form you can point at a webhook URL (WordPress, Webflow, Framer, or plain HTML)

Step 1 β€” Get the workflow JSON

Download the free "Lead Capture Lite" pack (workflow JSON + HTML form example + sheet headers):

πŸ‘‰ https://pebble71.gumroad.com/l/free-n8n-lead-capture

Or grab the JSON straight from the public gist: https://gist.github.com/konvff/74439ec1f076fbc509c91b3b79e59dd5

Step 2 β€” Import into n8n

  1. Open n8n β†’ New workflow
  2. Click β‹― β†’ Import from File…
  3. Choose 02-website-lead-capture-alerts.json
  4. You should see about a dozen nodes, including sticky notes that explain the setup on the canvas itself

Step 3 β€” Connect credentials

Click each of these nodes and connect (or create) credentials:

Node Credential
Save Lead to Sheet Google Sheets OAuth
Email Alert to You Gmail OAuth
Auto-Reply to Lead Gmail OAuth (same account is fine)
WhatsApp Alert to You Twilio API (optional)

If you're skipping WhatsApp for now, disable the Twilio node or set it to Continue On Fail so a missing credential doesn't stop the rest of the run.

Step 4 β€” Edit the Settings box

Open βš™οΈ Settings + Clean Lead. This is the only place you should need to type your business details:

  • Business name (used in the auto-reply)
  • Your alert email
  • Your WhatsApp number in international format, e.g. +923001234567
  • Twilio WhatsApp sender (if using Twilio)

The same node also normalises the incoming payload. It accepts name or full_name, phone or whatsapp, lowercases the email, and strips junk characters from the phone. That means one workflow works with slightly different forms without rewriting expressions everywhere.

Step 5 β€” Create the Google Sheet

Make a sheet with a tab named Leads and this header row:

date,name,email,phone,service,message,source
Enter fullscreen mode Exit fullscreen mode

Copy the sheet URL into the Save Lead to Sheet node (document field). Map columns to the cleaned fields from the Settings node β€” not from the webhook directly, because the Sheets node output replaces your original fields later in the flow.

Step 6 β€” Activate and wire the form

  1. Activate the workflow
  2. Open the Lead Form Webhook node and copy the Production URL
  3. Point your form at that URL

For a plain HTML site, the free pack includes lead-form-example.html that posts JSON with fetch(). Two gotchas:

  • Set allowedOrigins on the webhook if the form lives on a different domain, or the browser will block the request (CORS).
  • Use the Production URL after activating. The Test URL only works while you're listening in the editor.

Step 7 β€” Test the unhappy paths

Don't only test a perfect submission.

  1. Submit with neither email nor phone β†’ you should get a 400-style JSON error and nothing written to the sheet
  2. Submit with email only β†’ sheet row + email alert + auto-reply (WhatsApp alert may no-op if disabled)
  3. Submit with phone only β†’ sheet row + alerts, no auto-reply email

If WhatsApp isn't arriving: Twilio's sandbox only delivers to numbers that have already texted the join code. Test with your own phone first.

Why validate before you save

A lot of "form β†’ sheet" templates happily log empty or spam submissions. That pollutes your CRM-ish sheet and trains you to ignore it. The Valid Lead? IF node in this workflow requires a plausible email or a long-enough phone before anything is written. Invalid hits get a Respond Invalid JSON payload so your form UI can show an error instead of a fake success.

Where this fits in a bigger stack

Lead alerts alone won't run a business. The same pattern β€” webhook or trigger β†’ validate β†’ log β†’ notify β†’ optional customer message β€” is what you reuse for appointment reminders, review requests, and invoice chasers.

If you want those next five as ready-made templates (plus an 11-page setup guide), they're in the Small Business Automation Pack:

πŸ‘‰ https://pebble71.gumroad.com/l/small-business-n8n-pack

($19+ PWYW; code LAUNCH50 takes 50% off for the first 50 buyers)

Recap

  • Import the free JSON
  • Connect Google (and Twilio if you want WhatsApp)
  • Fill one Settings node
  • Create a Leads sheet
  • Activate, paste the Production webhook into your form
  • Test valid and invalid submissions

You should feel the first ping on your phone the next time someone fills the form β€” including after hours. That's the whole point.

Questions about CORS, Twilio sandbox, or mapping a WordPress / Webflow form? Drop a comment and I'll help.


Workflow by FlowMind Agency. n8n, Google, OpenAI, Twilio and WhatsApp are trademarks of their respective owners; this is an independent guide.

Top comments (0)

⌂ 捒网址