Makani Tech: Build. Automate. Evolve.

WhatsApp Lead Capture with n8n + Gemini (free workflow)

Reply to every WhatsApp enquiry in seconds in the customer's own language, log the lead in Google Sheets, alert your team and get reminded about leads nobody followed up.

FreeWorkflowBy Kishan Makani · updated 28 October 2026 · 4 min read

WhatsApp Business CloudGeminiGoogle SheetsGmail

Downloads

  • Download the n8n workflow (JSON)

    whatsapp-lead-capture-n8n-gemini.json · n8n workflow · 20 steps · starts with Incoming WhatsApp Message · uses WhatsApp, Google Sheets, Google Gemini, Gmail · 48 KB

    Import into n8n: Create Workflow, then the menu, then Import from File.

How to import it into n8n
  1. In n8n, create a new workflow.
  2. Open the ⋯ menu at the top right and choose Import from File, then pick the downloaded .json. (Or open the file, copy everything and paste it on the canvas.)
  3. Open each node with a warning and connect your own account: the file carries no passwords or keys.
  4. Run it once with Test workflow, check the result, then switch it to Active.

What this workflow does

A new WhatsApp message comes in, even at 11 PM. Gemini reads it, works out the name, what they want, how urgent it is and which language they wrote in, and replies on WhatsApp in that language with your booking link. Outside opening hours it adds a short after-hours note. The lead is saved in Google Sheets and your team gets an email with a one-tap wa.me link. If a returning customer writes again, the message is logged on their row. Every 15 minutes the sheet is checked, and any lead still marked New after your limit triggers one reminder email.

Who it is for

Clinics, real estate, interior design, coaching, agencies and other service businesses that get leads on WhatsApp from ads, Instagram or their website and lose them when replies are slow.

What you need

  • n8n (Cloud or self-hosted on public HTTPS, so Meta can send webhooks)
  • A WhatsApp Business Cloud API number (Meta's free test number is fine for trying it)
  • A Google AI Studio API key for Gemini
  • A Google account for Sheets and Gmail

The workflow, step by step

Step 1 · Receive and route

  • Incoming WhatsApp Message (WhatsApp Trigger) and Every 15 Minutes (Schedule): two starting points.
  • Route by Event Type (Switch): customer messages go one way, the 15-minute check the other. Delivery and read receipts stop here.

Step 2 · New or known contact

  • Extract Message Details (Set): pulls the text from normal, button, list and media-caption messages and checks your opening hours.
  • Find Existing Lead and Is This a New Lead?: looks up the phone number in the sheet.

Step 3 · Read the lead with Gemini

  • Understand Lead with AI (Information Extractor) with Google Gemini Chat Model: name, intent, interest, urgency, language, summary and a reply.
  • Prepare Lead Record and Use Fallback Lead Details: if Gemini fails, the customer still gets a safe reply and the lead is saved as needs review.

Step 4 · Reply, save and alert

  • Send Instant WhatsApp Reply, Save New Lead to Sheet and Alert Team About New Lead run side by side, so one failure never blocks the others.

Step 5 · Known contact

  • Log Message on Existing Lead and Alert Team About Lead Reply: returning customers are never left on read. The AI is not called again.

Step 6 · Follow-up reminders

  • Get Leads Still Marked New, Keep Leads Waiting Too Long, Send Follow-up Reminder and Mark Reminder as Sent: one reminder per lead, so your team is not spammed.

Setup

  1. Download the JSON below and import it in n8n (Create workflow > ⋯ > Import from File).
  2. In Meta for Developers, create an app with the WhatsApp Business Cloud API. In n8n add a WhatsApp OAuth credential for the trigger and a WhatsApp API credential for sending.
  3. Create a Google Sheet with a tab named Leads and these headers: Phone, Name, First Message, Intent, Interest, Urgency, Language, AI Summary, Status, First Contact At, Last Message, Last Message At, Reminder Sent.
  4. Add Google Sheets OAuth2, Gmail OAuth2 and Google Gemini (PaLM) API credentials, and select your spreadsheet in the four sheet nodes.
  5. Fill in Workflow Configuration: business name and description, booking link, alert email, opening hours, working days, follow-up minutes, after-hours message and fallback reply.
  6. Set the workflow timezone in Workflow Settings.
  7. Test it: send "Hi, I saw your Instagram ad. What does a 3 bedroom interior package cost? We move in next month." You should get a reply with your booking link, a new row with urgency hot and Status New, and an alert email. Send a second message from the same number and it is logged on the same row.
  8. Activate.

How to customise

  • The prompt and messages are a starting point. Rewrite them for your business.
  • Understand Lead with AI: which fields to pull out and how the reply sounds.
  • Alert Team About New Lead and Send Follow-up Reminder: the team emails.
  • afterHoursMessage, fallbackReply and followUpMinutes: the fixed replies and the reminder delay.
  • Send alerts to Slack or Telegram instead of Gmail, or keep leads in Airtable or HubSpot instead of Sheets.

Why Gemini

The job is pulling a few fields out of a short chat message and writing a 2 to 3 line reply in the customer's language. Gemini handles Hindi, Hinglish and other languages well, is fast enough for an instant reply and has a free tier.

Guardrails

  • WhatsApp only allows free-text replies within 24 hours of the customer's last message. This flow always replies to the customer's own message, so it stays inside that window. Reminders go to your team by email, so no template is needed.

Troubleshooting

  • Nothing happens: the workflow must be active and n8n reachable over public HTTPS. Check the webhook is subscribed to messages in Meta.
  • Lookup never finds the customer: the Phone column must stay as plain text. The workflow writes it in RAW format, so don't reformat the column as numbers.
  • Times are off: set the timezone in Workflow Settings.

Want the members-only resources too?

A free account unlocks them all, including the ones shared in DMs.

Create a free account