🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

WhatsApp + Google Sheets: leads answered and logged

Lisa Granqvist Partner Workflow Automation Expert

Leads come in, notifications stack up, and suddenly it’s been three hours since someone asked for pricing on WhatsApp. You reply late (or not at all), then try to reconstruct the conversation for follow-ups. It’s messy.

This WhatsApp lead logging problem hits marketing managers first, because speed-to-lead affects campaign ROI. But founders and agency operators feel it too, especially when “we’ll reply in 5 minutes” turns into “tomorrow morning.”

This n8n workflow replies instantly across WhatsApp, Instagram, Facebook, LinkedIn, and website forms, then logs every interaction in Google Sheets so nothing gets lost. You’ll see how it works, what you need, and where teams usually trip up.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: WhatsApp + Google Sheets: leads answered and logged

The Problem: Fast replies are hard to sustain

Replying fast sounds simple until you’re juggling five inboxes and a dozen context switches. A WhatsApp lead wants a quote, an Instagram DM asks for availability, a LinkedIn message comes in from a referral, and your website form quietly drops into email. Now add real life: meetings, delivery work, team handoffs, weekends. You end up replying inconsistently, copying and pasting half-baked templates, and losing track of who got a response. The worst part is the follow-up chaos. If the first reply isn’t logged cleanly, your “pipeline” becomes a memory game.

It adds up fast. Here’s where it breaks down in day-to-day operations.

  • People reply from the wrong place, so your team can’t see what was promised.
  • Manual logging in Google Sheets happens “later,” which usually means it never happens.
  • After-hours leads get either no reply or an awkward response that doesn’t set expectations.
  • When you finally need reporting, you’re stuck piecing together threads across apps.

The Solution: An instant SDR that replies and logs everything

This workflow turns your inbound lead messages into a single, reliable system. It starts by listening for new leads from WhatsApp, Instagram, Facebook, LinkedIn, and website forms through webhooks. Each source has its own messy fields, so the workflow normalizes the data into one clean structure (name, message, channel, timestamp, and any extra context). Then it converts the time to IST, checks working days and hours, and writes an AI prompt that’s aware of both the lead’s request and when they contacted you. The AI generates a short, human-like reply, and the workflow routes it back to the correct channel automatically. Finally, it logs the full interaction, response status, and timing into Google Sheets so you have a proper record for follow-up and reporting.

Incoming lead hits a webhook, then data gets cleaned up and merged into one path. AI drafts the response with timing context, and n8n sends it back through the right channel. After that, Google Sheets gets an updated log entry you can actually trust.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you get 10 inbound leads a day across WhatsApp and Instagram, plus a few from LinkedIn and your website. Manually, even a “quick” first response and logging takes maybe 10 minutes per lead once you include context switching and updating Sheets, so you lose about 2 hours daily. With this workflow, the lead triggers the automation instantly, the AI reply is generated and sent, and the conversation is logged without you touching anything. You might still jump in for high-intent leads, but you’re doing it intentionally, not because the inbox is on fire.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Google Sheets to store your lead + reply log.
  • WhatsApp + social lead sources to receive inbound messages via webhooks.
  • OpenAI API key (get it from your OpenAI API dashboard).

Skill level: Intermediate. You’ll mostly paste credentials and test webhooks, but you should be comfortable mapping fields and doing a few test runs.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A new lead message arrives. A webhook catches the inbound message from WhatsApp, Instagram, Facebook, LinkedIn, or your website form submission and passes it into the workflow.

The workflow standardizes the lead data. Each channel has different fields, so n8n maps them into one clean structure, then merges everything into a single route so downstream steps don’t care where it came from.

Business hours logic + AI response generation. The workflow converts timestamps to IST, checks if it’s a working day and within working hours, then builds a prompt that includes the lead details and timing context. OpenAI generates a short reply that sounds like a human SDR wrote it (not a wall of text).

The reply is sent and the interaction is logged. A switch routes the message back to the right channel (WhatsApp send, HTTP requests for social replies, Gmail for website leads), then a final record is assembled and written to Google Sheets with response status and timing.

You can easily modify the business hours rules to match your timezone and working days based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Webhook Trigger

This workflow starts from multiple inbound lead sources. You will set up each webhook endpoint so external platforms can post lead data into n8n.

  1. Open Webhook WhatsApp Lead and set Path to incoming-leads-whatsapp with HTTP Method set to POST.
  2. Open Webhook Facebook Lead and set Path to incoming-leads-facebook with HTTP Method set to POST.
  3. Open Webhook Instagram Lead and set Path to incoming-leads-instagram with HTTP Method set to POST.
  4. Open Webhook LinkedIn Lead and set Path to incoming-leads-linkdin with HTTP Method set to POST.
  5. Open Webhook Website Lead and set Path to incoming-leads-website with HTTP Method set to POST.

Keep the webhook URLs handy for each platform integration so you can paste them into WhatsApp, Facebook, Instagram, LinkedIn, and your website form handler.

Step 2: Normalize Incoming Lead Data

The five mapping nodes standardize fields so the rest of the workflow can work with a consistent schema.

  1. In Map WhatsApp Fields, set assignments such as body.lead_name to {{ $json.body.ProfileName }}, body.contact_phone to {{ $json.body.From }}, and body.message_text to {{ $json.body.Body }}.
  2. In Map Facebook Fields and Map Instagram Fields, mirror the same assignments and set body.source_channel to facebook and instagram respectively.
  3. In Map LinkedIn Fields, map name, phone, and message the same way and set body.source_channel to linkdin.
  4. In Map Web Lead Fields, map body.lead_name to {{ $json.body.lead_name }}, body.contact_phone to {{ $json.body.contact_phone }}, body.message_text to {{ $json.body.message_text }}, body.source_channel to {{ $json.body.source_channel }}, and body.contact_email to {{ $json.body.contact_email }}.

⚠️ Common Pitfall: Route Source Channel expects LinkedIn but Map LinkedIn Fields sets linkdin. Make the values consistent to avoid missed routing.

Step 3: Route Leads and Check Business Hours

This section directs all normalized leads into a single processing path and determines if the lead arrived during working hours.

  1. In Route Source Channel, ensure each rule compares leftValue to {{ $json.body.source_channel }} and routes for whatsapp, Instagram, Facebook, LinkedIn, and website.
  2. Confirm that Route Source Channel outputs to Compute Day Hour Info for every rule (centralized processing).
  3. Keep the Compute Day Hour Info code as provided to calculate IST values and is_working_hours from $json.body.submitted_at.
  4. In Validate Business Hours, keep the conditions using {{ $json.ist_dayOfWeek }}, {{ $json.isWorkingDay }}, and {{ $json.is_working_hours }}.

Both outputs from Validate Business Hours lead to Compose AI Prompt, so the prompt is generated regardless of working hours. This is intentional so the message can mention office hours when needed.

Step 4: Set Up AI Response Generation

The workflow composes a prompt, calls Groq’s chat completion endpoint, and merges the AI response with lead data.

  1. In Compose AI Prompt, keep the model and rules as defined, especially the user prompt containing ${$input.item.json.body.source_channel} and ${$input.item.json.is_working_hours}.
  2. In Request AI Completion, set URL to https://api.groq.com/openai/v1/chat/completions, Method to POST, and JSON Body to {{ $json.requestBody }}.
  3. In Request AI Completion, set the headers to Authorization with [CONFIGURE_YOUR_TOKEN] and Content-Type with application/json.
  4. In Merge AI Result, keep the code that reads $input.item.json.choices[0].message.content and merges it with Compose AI Prompt data.

⚠️ Common Pitfall: If the AI API returns a different response structure, Merge AI Result will fail. Confirm the response includes choices[0].message.content.

Step 5: Configure Channel Replies and Logging

AI responses are dispatched based on the source channel, then consolidated into a single log record.

  1. In Dispatch Channel Reply, confirm each rule checks leftValue {{ $json.body.source_channel }} for whatsapp, Instagram, Facebook, LinkedIn, and website.
  2. In Send WhatsApp Reply, set Operation to send, Text Body to {{ $json.ai_response }}, Recipient Phone Number to {{ $json.body.contact_phone }}, and fill Phone Number ID with your value.
  3. In Post Instagram Reply, set URL to your-instagram-api-endpoint. Do the same for Post Facebook Reply with your-facebook-api-endpoint and Post LinkedIn Reply with your-linkdin-api-endpoint.
  4. In Send Email Reply, set Send To to {{ $json.body.contact_email }}, Message to {{ $json.ai_response }}, and Subject to Website developement Pricing Inquiry.
  5. Keep Assemble Log Record code as-is to capture send status, lead metadata, and timestamps, then pass to the spreadsheet log.

Credential Required: The Send Email Reply node requires Gmail credentials even though none are configured in the workflow. Add them before testing.

Credential Required: The Send WhatsApp Reply node requires WhatsApp credentials (and a valid Phone Number ID) even though none are configured in the workflow.

Step 6: Connect Google Sheets Logging

The final log record is appended or updated in your spreadsheet for reporting and follow-up.

  1. Open Update Lead Spreadsheet and set Operation to appendOrUpdate.
  2. Set Document to your spreadsheet ID (currently [YOUR_ID]) and Sheet Name to the target sheet (currently gid=0).
  3. Verify column mappings like Email to {{ $json.email }}, Lead Name to {{ $json.lead_name }}, AI Response to {{ $json.ai_response }}, and Source Channel to {{ $json.source_channel }}.

Credential Required: The Update Lead Spreadsheet node requires Google Sheets credentials even though none are configured in the workflow.

Step 7: Test and Activate Your Workflow

Run controlled tests to verify channel routing, AI responses, and logging.

  1. Use the Execute Workflow button and send a sample payload to each webhook URL for WhatsApp, Facebook, Instagram, LinkedIn, and Website.
  2. Confirm each payload flows from Route Source ChannelCompute Day Hour InfoValidate Business HoursCompose AI PromptRequest AI CompletionMerge AI Result.
  3. Verify the correct outbound node fires from Dispatch Channel Reply and that Assemble Log Record captures a status like Sent Successfully.
  4. Check Update Lead Spreadsheet to ensure a row is appended or updated with the AI response and timestamps.
  5. When satisfied, toggle the workflow to Active so the webhooks receive live traffic.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Google Sheets credentials can expire or need specific permissions. If things break, check the n8n Credentials tab and confirm the spreadsheet is shared with the connected Google account first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this WhatsApp lead logging automation?

About 45 minutes if your channel webhooks are ready.

Do I need coding skills to automate WhatsApp lead logging?

No. You will mostly connect accounts and map a few fields. The JavaScript nodes are already built into the workflow.

Is n8n free to use for this WhatsApp lead logging workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs, which are usually a few cents per day for low lead volume.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this WhatsApp lead logging workflow for after-hours replies?

Yes, and you probably should. The business-hours check happens in the “Validate Business Hours” logic, and the AI prompt is assembled in “Compose AI Prompt,” so you can create one tone for business hours and a different one for nights and weekends. Common tweaks include adding a “We’ll reply at 10am IST” line, routing after-hours leads to a different sheet tab, and tagging high-intent messages so a human gets pinged.

Why is my WhatsApp connection failing in this workflow?

Usually it’s an expired token or the webhook is pointing to an old n8n URL. Check the WhatsApp provider settings, then confirm your n8n webhook URL is reachable from the public internet. Also look for missing permissions on the WhatsApp app, because some providers restrict sending unless your template or session rules are met.

How many leads can this WhatsApp lead logging automation handle?

For most small teams, hundreds of leads a day is fine if your APIs allow it.

Is this WhatsApp lead logging automation better than using Zapier or Make?

It depends on how strict you are about logic and logging. This workflow uses multi-branch routing, business-hour rules, and a clean “normalize everything first” pattern, which is much easier to maintain in n8n once you have more than two channels. You also get a self-hosting option, which matters if you don’t want per-task pricing to creep up as volume grows. Zapier or Make can be faster for a simple two-step “new message → send reply,” but the moment you add AI prompts, status tracking, and multiple sources, things get fiddly. If you want a second opinion on platform fit, Talk to an automation expert.

Once this is running, your team stops scrambling and starts following a system. The workflow handles the repetitive stuff, and you can focus on the leads that actually deserve a human response.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal