The Problem
Small businesses sell on WhatsApp but run it manually: forwarding product photos, confirming prices by hand, losing track of who ordered what, and overselling items whose stock they forgot to update — every order costs the owner attention.
The Solution
A full storefront living inside a WhatsApp thread, on the official Cloud API. One n8n webhook answers Meta's verification handshake and receives all events; messages route by type into interactive replies, native cart orders, or text. Customers browse via Multi-Product Templates and pay-checkout-style cart flows; each placed order is staged in a data table keyed by phone and unique order ID, validated against live inventory in Google Sheets with per-order limits, and confirmed instantly — or bounced with an out-of-stock reply. Welcome flows, an FAQ responder, and a cancellation handler cover the rest, while a compliance branch pushes business and grievance-officer details for India-market requirements.
How the workflow runs
01 · Verify
The webhook completes Meta's subscription handshake itself and filters inbound noise before any logic.
02 · Route
Every event is classified as interactive reply, native cart order, or plain text and sent down its own branch.
03 · Browse
A Multi-Product Template renders the store inside chat — scroll, inspect, add to cart natively.
04 · Stage
Placed carts land in an orders data table with phone, name, and a unique order id for fulfilment tooling.
05 · Validate
Each line item checks against live stock in Google Sheets under per-order limits; success or out-of-stock replies fire immediately.
06 · Support
Text senders get the welcome menu, FAQ answers, or a cancellation confirmation without human intervention.
AI layer
- Native commerce UX
- WhatsApp's own catalog and cart primitives do the heavy lifting — no links out, no webviews to break.
- Deterministic routing
- Message-type classification drives every branch, keeping bot behaviour predictable at scale.
Automation layer
- Self-verifying webhook
- Verification handshake handled in-flow, eliminating a separate verify endpoint.
- Sheets-backed inventory
- Stock lives where shop owners already update it — the bot reads it live per order.
- Staged order pipeline
- Data-table staging with unique IDs makes every order addressable by downstream fulfilment automation.
- Compliance automation
- Business entity and grievance-officer details push to the API programmatically for Indian market rules.
Technical challenges
WhatsApp commerce breaks when stock lives in a spreadsheet nobody syncs — customers order items that are gone.
Per-item availability checks against Sheets at order time, with explicit limits and instant out-of-stock messaging.
Meta's webhook requires a verification handshake plus strict payload filtering before any business logic can run safely.
A single self-answering webhook node handles GET verification, while a filter gate drops malformed events early.
Orders arriving as chat messages are ephemeral — nothing downstream can reference them reliably.
Every order is staged with a phone-keyed unique ID in a data table, turning chat events into addressable records.
Outcome
- A complete shopping experience inside WhatsApp: browse, cart, order, confirmation — zero human handling.
- Overselling eliminated: stock validation runs on every order before any confirmation is sent.
- Owners keep managing inventory in Sheets; the bot does everything else.
Lessons learned
- “Use platform-native commerce primitives (catalogs, carts) instead of rebuilding shopping UX in text.”
- “Treat chat events as records: staging with unique IDs turns conversations into systems.”
- “Compliance endpoints belong in automation too — one workflow node beats a manual portal form.”