WhatsApp + Google Sheets: leads answered and logged
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
flowchart LR
subgraph sg0["Flow 1"]
direction LR
n0@{ icon: "mdi:database", form: "rounded", label: "google-sheet-name", pos: "b", h: 48 }
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Normalize Lead Data5", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Switch2", pos: "b", h: 48 }
n3@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Switch3", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send Instagram Message1"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send Facebook Messages1"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send Linkdin Messages1"]
n7@{ icon: "mdi:message-outline", form: "rounded", label: "Send a message1", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Extract Day and Hours1"]
n9@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Is Working Day and Working H..", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code in JavaScript3"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code in JavaScript4"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code in JavaScript5"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incomming Lead whatsapp1"]
n14["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incomming Lead facebook1"]
n15["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incomming Lead instagram1"]
n16["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incomming Lead linkdin1"]
n17["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incomming Lead Website1"]
n18@{ icon: "mdi:swap-vertical", form: "rounded", label: "Normalize Lead Data6", pos: "b", h: 48 }
n19@{ icon: "mdi:swap-vertical", form: "rounded", label: "Normalize Lead Data7", pos: "b", h: 48 }
n20@{ icon: "mdi:swap-vertical", form: "rounded", label: "Normalize Lead Data8", pos: "b", h: 48 }
n21@{ icon: "mdi:swap-vertical", form: "rounded", label: "Normalize Lead Data9", pos: "b", h: 48 }
n22["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Ai Response1"]
n23["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/whatsapp.svg' width='40' height='40' /></div><br/>Send message"]
n2 --> n8
n3 --> n23
n3 --> n4
n3 --> n5
n3 --> n6
n3 --> n7
n23 --> n12
n7 --> n12
n22 --> n11
n10 --> n22
n11 --> n3
n12 --> n0
n1 --> n2
n18 --> n2
n19 --> n2
n20 --> n2
n21 --> n2
n8 --> n9
n6 --> n12
n17 --> n1
n16 --> n21
n5 --> n12
n4 --> n12
n14 --> n19
n13 --> n18
n15 --> n20
n9 --> n10
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n2,n3,n9 decision
class n0 database
class n4,n5,n6,n13,n14,n15,n16,n17,n22 api
class n8,n10,n11,n12 code
classDef customIcon fill:none,stroke:none
class n4,n5,n6,n8,n10,n11,n12,n13,n14,n15,n16,n17,n22,n23 customIcon
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
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
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.
- Open Webhook WhatsApp Lead and set Path to
incoming-leads-whatsappwith HTTP Method set to POST. - Open Webhook Facebook Lead and set Path to
incoming-leads-facebookwith HTTP Method set to POST. - Open Webhook Instagram Lead and set Path to
incoming-leads-instagramwith HTTP Method set to POST. - Open Webhook LinkedIn Lead and set Path to
incoming-leads-linkdinwith HTTP Method set to POST. - Open Webhook Website Lead and set Path to
incoming-leads-websitewith HTTP Method set to POST.
Step 2: Normalize Incoming Lead Data
The five mapping nodes standardize fields so the rest of the workflow can work with a consistent schema.
- 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 }}. - In Map Facebook Fields and Map Instagram Fields, mirror the same assignments and set body.source_channel to
facebookandinstagramrespectively. - In Map LinkedIn Fields, map name, phone, and message the same way and set body.source_channel to
linkdin. - 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 }}.
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.
- In Route Source Channel, ensure each rule compares leftValue to
{{ $json.body.source_channel }}and routes forwhatsapp,Instagram,Facebook,LinkedIn, andwebsite. - Confirm that Route Source Channel outputs to Compute Day Hour Info for every rule (centralized processing).
- Keep the Compute Day Hour Info code as provided to calculate IST values and is_working_hours from
$json.body.submitted_at. - In Validate Business Hours, keep the conditions using
{{ $json.ist_dayOfWeek }},{{ $json.isWorkingDay }}, and{{ $json.is_working_hours }}.
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.
- 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}. - In Request AI Completion, set URL to
https://api.groq.com/openai/v1/chat/completions, Method to POST, and JSON Body to{{ $json.requestBody }}. - In Request AI Completion, set the headers to Authorization with
[CONFIGURE_YOUR_TOKEN]and Content-Type withapplication/json. - In Merge AI Result, keep the code that reads
$input.item.json.choices[0].message.contentand merges it with Compose AI Prompt data.
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.
- In Dispatch Channel Reply, confirm each rule checks leftValue
{{ $json.body.source_channel }}forwhatsapp,Instagram,Facebook,LinkedIn, andwebsite. - 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. - In Post Instagram Reply, set URL to
your-instagram-api-endpoint. Do the same for Post Facebook Reply withyour-facebook-api-endpointand Post LinkedIn Reply withyour-linkdin-api-endpoint. - In Send Email Reply, set Send To to
{{ $json.body.contact_email }}, Message to{{ $json.ai_response }}, and Subject toWebsite developement Pricing Inquiry. - Keep Assemble Log Record code as-is to capture send status, lead metadata, and timestamps, then pass to the spreadsheet log.
Step 6: Connect Google Sheets Logging
The final log record is appended or updated in your spreadsheet for reporting and follow-up.
- Open Update Lead Spreadsheet and set Operation to appendOrUpdate.
- Set Document to your spreadsheet ID (currently
[YOUR_ID]) and Sheet Name to the target sheet (currentlygid=0). - 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 }}.
Step 7: Test and Activate Your Workflow
Run controlled tests to verify channel routing, AI responses, and logging.
- Use the Execute Workflow button and send a sample payload to each webhook URL for WhatsApp, Facebook, Instagram, LinkedIn, and Website.
- Confirm each payload flows from Route Source Channel → Compute Day Hour Info → Validate Business Hours → Compose AI Prompt → Request AI Completion → Merge AI Result.
- Verify the correct outbound node fires from Dispatch Channel Reply and that Assemble Log Record captures a status like
Sent Successfully. - Check Update Lead Spreadsheet to ensure a row is appended or updated with the AI response and timestamps.
- When satisfied, toggle the workflow to Active so the webhooks receive live traffic.
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
About 45 minutes if your channel webhooks are ready.
No. You will mostly connect accounts and map a few fields. The JavaScript nodes are already built into the 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.
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.
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.
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.
For most small teams, hundreds of leads a day is fine if your APIs allow it.
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.