A step-by-step guide to building a self-hosted WhatsApp bot using WAHA (WhatsApp HTTP API) and n8n, both running in Docker. Covers setting up WAHA as a WhatsApp Web gateway, connecting it to n8n via webhooks, building a keyword-based auto-reply bot, and sending proactive outbound messages (e.g., booking confirmations from a database). Also covers production hardening: HTTPS with Caddy, API key rotation, rate limiting, n8n Queue Mode with Redis, session monitoring, backup strategies, live-agent handoff with Chatwoot, and common pitfalls like duplicate messages, session disconnects, and account bans.
Table of contents
Table of contentsWhat You'll LearnPrerequisitesA Note on Which WhatsApp Account to UseWAHA vs the official WhatsApp Business Cloud APIPart 1: Understanding WAHAPart 2: Running WAHA with DockerPart 3: Starting a WhatsApp sessionPart 4: Running n8nPart 5: Creating the Webhook Trigger in n8nPart 6: Wiring WAHA to n8nPart 7: Building the first auto-replyPart 8: A Second Example — Proactive Booking ConfirmationsPart 9: Going to ProductionCommon PitfallsWhere to Go Next735 Impressions