How to Build a WhatsApp Sales Agent With n8n and Groq
WhatsApp is the first place a lot of real customers actually try to reach a business, yet most small businesses either leave it fully manual or stop watching it the moment the workday ends. A visitor who messages the test number behind this build gets a reply the same instant, grounded in this business's own real service catalog rather than a generic script. This is not a demo bot: I built a real WhatsApp sales agent that carries a multi-turn order through to completion and alerts a real person the moment a lead is actually ready, tested live on a real phone with a real message, not simulated data.
Does this sound like your business?
- Every answer is grounded in the real service catalog, never invented pricing or capabilities
- The visitor's own WhatsApp number is used as their contact automatically, so the order never needs a separate step just to collect one
- Every completed order is logged to a real Sheet with a real alert email the moment it happens
- Reuses the same proven Groq prompt and QA-lint pattern already tested on a real, live Facebook Messenger agent
- Handles the real WhatsApp Cloud API quirks, number registration and permanent tokens, that most tutorials skip entirely
For a lot of real customers, WhatsApp is the first place they try to reach a business, not the last. Most small businesses either leave it fully manual or stop watching it the moment the workday ends. I built a real WhatsApp sales agent that answers the instant a message arrives, grounded in this business’s own actual service catalog, and carries a multi-turn order through to completion instead of dead-ending in a generic reply. This is exactly how it works, tested live on a real WhatsApp number with a real message, not simulated data. The real, tested workflow file is free to download near the bottom of this page.

Who Is This For
This build is for service businesses, freelancers, and small agencies whose WhatsApp number gets real messages nobody answers fast, or consistently.
It fits anyone who wants a WhatsApp sales agent that actually knows the real service list, never invents a price, and still gets a lead logged and alerted the moment it is real.
What Problem Does This Workflow Solve
- WhatsApp Gets Left Unanswered After Hours: A message that arrives at night or on a weekend just sits there until someone checks the phone.
- Generic Bots Cannot Answer a Real Question: A visitor asking about a specific service gets a scripted menu instead of a grounded, accurate answer.
- A Completed Lead Needs a Human to Actually See It: Without a real alert, a finished order can sit unread in a chat thread for hours.
How to Build a WhatsApp Sales Agent With n8n and Groq
The pipeline reuses the exact pattern already proven on a real, live AI Messenger sales agent build: one webhook answers Meta’s verification handshake on GET and handles real message events on POST, since a Meta app only gets one callback URL. Every real event gets normalized, checked for message type, then grounded against the real service catalog and real conversation history before Groq (openai/gpt-oss-120b) drafts a reply and classifies intent. The same QA-lint and safe-fallback pattern used on every other build here catches a bad draft before a real visitor ever sees it.

The WhatsApp Number Itself Is Already a Valid Contact
Unlike a website chat widget or a Facebook Page, a WhatsApp conversation always comes with a real, working phone number attached to it. That means this WhatsApp sales agent never needs a separate step asking a visitor how to reach them back. The moment Groq marks an order complete, the sender’s own WhatsApp number is filled in automatically as the contact, which shortens the whole qualification conversation by one full exchange compared to the Messenger version of this build.
Real Failure Modes Behind Getting WhatsApp Cloud API Actually Live
Three genuine, undocumented-until-you-hit-them problems showed up getting this running for real, none of them hypothetical. A first access token resolved fine for basic account checks but failed with a confusing “does not exist” error on the real phone number and business account IDs, which turned out to be a stale, scope-limited token rather than wrong IDs. A working token still could not send a message until the phone number was explicitly registered for Cloud API use through a one-time API call with a verification PIN. And the token itself, generated from the quick developer-dashboard flow, silently expired after about 24 hours in the middle of testing. The permanent fix for that last one is a Meta System User access token set to never expire, which I wrote up in full in how to fix the WhatsApp access token expired error permanently.
Setup Guide
Prerequisites
- A free Groq API key (the openai/gpt-oss-120b model, an OpenAI-compatible API)
- A Meta Developer App with the WhatsApp product added, and a WhatsApp Business Account
- A Meta System User permanent access token (see the failure-modes section above for why a temporary one will not hold up)
- A Google account with Sheets access, connected through OAuth or a service account
- A hosted instance of n8n, cloud or self-hosted
Setup Steps
- Download the workflow file near the bottom of this page and import it into your n8n instance.
- Connect your credentials for Groq, the Facebook Graph API (WhatsApp), and Google Sheets.
- Create the Sheet tabs the workflow reads and writes: WhatsApp conversations and completed orders, plus your own real product/service catalog tab if you do not already have one from another build.
- Register your WhatsApp phone number for Cloud API use with a verification PIN, if it is not registered already.
- Set a webhook verify token and subscribe your app’s WhatsApp webhook, pointed at this workflow’s real URL.
- Activate the workflow so the production webhook goes live.
- Send a real message from your own phone to your own WhatsApp number, and confirm the reply actually arrives grounded in your real services.
- Walk through a full order yourself, end to end, and confirm the completed order actually lands in the Sheet with a real alert email.
How to Customize This Workflow
- Swap the AI provider if your own provider’s latency turns out unpredictable, the prompt and JSON parsing barely need to change.
- Point the Sheets log at a CRM or Airtable instead, the same append pattern works against either one.
- Add a fixed onboarding sequence the way the Messenger version of this build does, if open-ended qualification questions ever start drifting on your own traffic.
- Add voice-note transcription for the one case this version does not handle yet, downloading the audio attachment and running it through Groq Whisper before the same reply path.
Need Help Customizing?
Connect with me on LinkedIn, or find more real builds on YouTube, Facebook, and Instagram. See Meta’s own WhatsApp Cloud API documentation for the platform details this build sits on top of.
Read the nine steps in full below, or download the real, tested workflow file to import directly into your own n8n and add a WhatsApp sales agent to your own number.
-
1
Handle Meta’s Webhook Verification and Real Events on One Path
One Webhook node answers Meta's GET verification handshake, echoing back hub.challenge only if hub.verify_token matches a real secret, and receives real POST message events on the same path, since a Meta app only gets one callback URL.
-
2
Normalize the Incoming WhatsApp Event
A Code node pulls the sender's WhatsApp number, profile name, and message text straight out of Meta's real webhook payload. Unlike Messenger, WhatsApp includes the sender's real profile name directly in the payload, so no separate profile-lookup call is needed.
-
3
Skip Non-Text Messages and Delivery Status Updates
Meta sends delivery and read status updates through the same webhook for every message this workflow itself sends, and can in principle send non-text message types. Both get acknowledged with a plain 200 OK and skipped, not replied to, a documented v1 simplification.
-
4
Ground Every Reply in the Real Service Catalog and Conversation History
Real conversation history is read back from a new WhatsApp Conversations Sheet tab every turn. The real product catalog is read from the same Messenger Products tab an earlier build already created, reused as-is rather than duplicated, since it is the same real service list regardless of which channel a visitor messages on.
-
5
Draft the Reply With Groq and Detect Intent
One Groq call drafts the actual reply and classifies intent as plain Q&A, wanting a human, an order in progress, or a completed order, the same technique already proven on the Messenger and chat-widget builds.
-
6
QA-Lint Every Reply Before It Reaches a Real Visitor
Every draft gets checked for banned filler words and a stray em dash before it ever reaches a real visitor, with a safe fallback reply ready if a draft ever fails the check.
-
7
Auto-Fill the Contact From the Sender’s Own WhatsApp Number
A WhatsApp conversation always comes with a real, working number attached to it. The moment an order is marked complete, that number is filled in automatically as the contact, so this build never needs a separate step asking how to reach the visitor back.
-
8
Log Every Turn, Complete Orders, and Alert on a Real Lead
Every turn gets logged to a real Sheet. The moment a service and a name are both actually present, the order gets logged to its own tab and a real internal alert email goes out immediately.
-
9
Send the Reply and Handle the Real WhatsApp Cloud API Quirks
The drafted reply is sent through Meta's Graph API using a permanent Meta System User access token, not a 24-hour developer token, and against a phone number already registered for Cloud API use with a verification PIN, the two real, undocumented-until-you-hit-them blockers this build actually ran into.
This is the real, tested n8n workflow from this tutorial, not a mockup. Tell me where to send it and it'll land in your inbox as a ready-to-import .json file.
Does this sound like your business?