WhatsApp is where your customers already are. For most small e-commerce businesses in Germany and across the EU, it's the primary support channel — customers expect fast replies, and a 2-hour response gap costs you the sale. This project automates that gap completely.

I built a WhatsApp Business chatbot in n8n that handles order lookups, return requests, and FAQs automatically. Routine queries — 80% of the inbox — are resolved without any human involvement. Complex cases get escalated to a human via Slack with full context attached.

What you'll need A WhatsApp Business API account (via Meta or a BSP like 360dialog), a self-hosted n8n instance, an OpenRouter account, and a Google Sheet or database with your order data.

The Problem It Solves

A small online retailer typically gets the same 5 questions over and over: Where is my order? How do I return something? Do you ship to X? What's your return policy? I got the wrong item. A support person manually answering these is wasting their day. The bot handles all of them.

How the Workflow Works

The entire system is built around a single webhook that WhatsApp fires every time a message arrives. n8n catches it, figures out what the customer wants, and routes the message to the right handler.

WhatsApp Webhook → Extract Message → AI Intent Classifier → Route by Intent
Order Status → Sheets Lookup → Reply
Return Request → Log to Sheet → Confirm Reply
FAQ → OpenRouter + Policy Docs → Reply
Unknown → Slack Escalation → Human Reply

Step 1 — Receiving the Message

The WhatsApp Business API sends a POST request to your webhook every time a customer messages you. In n8n, set up a Webhook node on a public URL (your self-hosted n8n instance handles this automatically). Extract entry[0].changes[0].value.messages[0] to get the message body, sender ID, and timestamp.

Sending replies back

Replies go through the WhatsApp Cloud API. Use an HTTP Request node with a POST to https://graph.facebook.com/v18.0/{phone_number_id}/messages, passing your access token in the header and the recipient's number plus your message text in the body.

Step 2 — Intent Classification

This is where OpenRouter earns its place. Pass the customer's message to a lightweight model (I use mistralai/mistral-7b-instruct via OpenRouter — fast, cheap, accurate enough for this use case) with a prompt that returns one of five labels: order_status, return_request, faq, complaint, or other.

Keep the classifier prompt strict — give it exactly the labels and tell it to return only the label, nothing else. This makes the downstream routing in n8n trivial: a Switch node on the returned label.

Step 3 — Order Status Lookup

When the intent is order_status, extract the order number from the message (another small AI call or a regex — depends on how your customers phrase it) and query Google Sheets using the Google Sheets node. Return the status, estimated delivery date, and tracking link in a conversational reply.

Watch out Customers phrase order numbers inconsistently — "Order 1234", "#1234", "my order from Tuesday". Use a short extraction prompt rather than relying on regex alone. A two-step approach (AI extract → Sheets lookup) is more robust.

Step 4 — FAQ Handling with Context

For FAQ queries, I preloaded the shop's return policy, shipping zones, and product FAQs into a Google Sheet. The n8n workflow fetches the relevant rows and passes them as context to OpenRouter. This keeps answers accurate and grounded — the AI can't hallucinate a return policy it doesn't have.

For a busier shop, this is worth replacing with a Pinecone-backed RAG pipeline (similar to my RAG chatbot writeup) — but for most small shops, a Sheets-based context lookup is simpler and sufficient.

Step 5 — Escalation to Slack

Anything the bot can't handle with confidence goes to Slack. The escalation message includes the customer's WhatsApp number, the full message, and the classified intent so the human knows exactly what they're dealing with. The customer gets an immediate reply: "Our team will get back to you within 2 hours." — which is still faster than most shops manage manually.

Results

In a real deployment for a small German online clothing retailer, this bot handled 78% of incoming messages fully automatically within the first week. Response time dropped from an average of 3.5 hours to under 10 seconds for automated replies. The support workload shifted from answering messages to reviewing the Slack escalation queue once a day.

The bot paid for itself in the first month — the owner was spending 2+ hours a day on WhatsApp. Now it's 15 minutes.

What This Costs to Run

The WhatsApp Business API has a per-conversation pricing model (Meta charges per 24-hour conversation window, not per message). For a shop handling 200 customer conversations a month, you're looking at roughly €8–15/month in API costs. OpenRouter inference is a few cents per day at this volume. n8n is self-hosted — no per-message cost.

What to Build Next

Natural extensions to this bot: proactive order status notifications (trigger on shipping label creation), abandoned cart recovery messages, and post-delivery review requests. All of these are additional n8n workflows that hook into the same WhatsApp API connection.