Build a WhatsApp Bot with n8n
Step-by-step tutorial: use WhatsApp Cloud API with n8n. Templates, media, and webhooks.
Key takeaways
- You will finish this tutorial with a working workflow that can use WhatsApp Cloud API.
- The workflow uses only stock nodes — no custom code required for the happy path.
- The tutorial includes a smoke test and a failure alert path.
- You can clone the workflow for other teams or environments in one click.
This tutorial walks you through use WhatsApp Cloud API with n8n — from a blank canvas to a working workflow you can trust in production. You'll set up credentials, wire the nodes, and cover the guardrails that turn a demo into a shipped system: templates, media, and webhooks.
Step 1 — Set up credentials
Open Credentials in n8n and add the ones you'll need for use WhatsApp Cloud API. Test each with a read-only call before saving. Keep credentials scoped to one environment — never share prod credentials with dev.
If a credential requires OAuth, complete the flow now so the tokens are minted and refreshable.
Step 2 — Build the workflow
Start with the trigger that best fits use WhatsApp Cloud API. Add one node at a time and execute the workflow after each addition to catch shape mismatches early. Use Set nodes to normalize field names between systems.
Wrap external calls in retries and add a dedupe check right after the trigger.
- Pin sample data so you can iterate quickly.
- Rename each node with its business meaning ("Enrich lead", not "HTTP Request4").
- Group nodes by concern using sticky notes.
Step 3 — Test and ship
Run the workflow end-to-end with a realistic payload. Confirm every downstream write. Then turn on the live trigger and monitor the first 20-50 executions closely — that's where all the interesting bugs live.
Set up a Slack alert on failure and a weekly review of execution history. Ship.
Frequently asked questions
- Do I need to code?
- No — the happy path uses only visual nodes. The Code node is optional for edge cases.
- How long does it take?
- 15-45 minutes for the first version, plus another hour to harden it for production.
- Will this scale?
- Yes, up to thousands of executions per day on a single n8n instance. Beyond that, enable queue mode.
- How do I fork this for another team?
- Export the workflow JSON, import into a new project, and swap the credentials. Done.