Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DevMauricio03/n8n-whatsapp-ai-agent/llms.txt

Use this file to discover all available pages before exploring further.

The n8n WhatsApp AI Agent is a self-hosted automation platform that receives WhatsApp messages, routes them through an AI agent powered by OpenAI, and lets human agents take over from a Chatwoot inbox at any time. The entire stack — n8n, Chatwoot, PostgreSQL, Redis, and Caddy — runs on a single VPS via Docker Compose.

Introduction

Understand the platform scope, goals, and the users it serves.

Quickstart

Deploy the full stack on a VPS and send your first automated reply in minutes.

Architecture

Explore how WhatsApp, Chatwoot, n8n, OpenAI, PostgreSQL, and Redis connect.

Configuration

All environment variables and n8n credentials explained.

What this platform does

When a customer sends a WhatsApp message, the platform:
  1. Receives the message via WhatsApp Cloud API into Chatwoot’s inbox
  2. Checks for human handoff — if a human agent is active, the AI stays silent
  3. Buffers and deduplicates rapid-fire messages using Redis
  4. Transcribes audio via OpenAI Whisper if the message is a voice note
  5. Enforces business hours — sends an informational reply outside working hours
  6. Queries customer data from PostgreSQL using the conversation folio
  7. Generates a reply via OpenAI with conversational memory
  8. Delivers the response back through WhatsApp Cloud API

Core Concepts

Components, workflow logic, human handoff, and the database schema.

Operations

Deployment procedures, day-to-day tasks, backup, and restore.

Security

Secrets management, data privacy, and incident response.

Troubleshooting

Diagnose and fix common failures across every service.

Stack at a glance

ServiceRoleImage
n8nWorkflow automation & AI orchestrationdocker.n8n.io/n8nio/n8n:1
ChatwootAgent inbox & webhook sourcechatwoot/chatwoot:v4.4.0
PostgreSQLCustomer data & conversation memorypgvector/pgvector:pg15
RedisMessage buffer & human handoff stateredis:7-alpine
CaddyHTTPS reverse proxycaddy:2-alpine
OpenAIText generation & audio transcriptionCloud API
WhatsApp Cloud APIMessage channelMeta platform
This repository contains sanitized templates and an example workflow. Before using it in production you must configure credentials, domains, privacy policies, and validate image versions.

Build docs developers (and LLMs) love