WhatsApp Automation
AI-assisted WhatsApp support that answers from a knowledge base and hands off to a person when it should.
- Discipline
- Automation
- Status
- MVP

Overview
A support automation backend on the WhatsApp Cloud API. A customer sends a message and gets an answer grounded in the company's own FAQ knowledge base. When the AI decides a person is needed, it escalates to the support team and marks the conversation.
- Role
- Backend architecture and engineering
- Services
- Backend architecture, Messaging automation, AI integration, Queues and workers
- Platform
- API and background workers
Context
Support questions arrive on WhatsApp at all hours. Many are repeat questions with known answers. Some need a person, quickly.
Challenge
Meta expects the webhook to respond immediately, while an AI reply takes seconds. Answers must come from approved content, not from the model's imagination, and escalation has to be reliable. The webhook is public by necessity, so every request has to be verified.
Strategy
The decisionsthat shaped it.
- 01
Acknowledge now, answer in the background
Inbound messages are queued in BullMQ on Redis. The webhook returns instantly and a worker writes the reply.
- 02
Grounded answers
Replies draw on a pgvector knowledge base of approved FAQs, matched with embeddings.
- 03
Escalation is a state
When a person is needed, the conversation is marked escalated and the support number is pinged on WhatsApp.

Experience
Who does what,in what order.
Customer
- Send message
- Get a grounded answer
- Reach a person if needed
System
- Verify signature
- Queue message
- Retrieve FAQs
- Generate reply
- Send or escalate

Interfacedecisions.
01
The interface is the conversation itself: short answers, a clear handoff, no dead ends.
02
Admin tools for tickets and meetings are planned on the same data, behind JWT and role guards.
Engineering
What powers it.
01Channel
- WhatsApp Cloud API
02Services
- NestJS
- BullMQ workers
- OpenAI
03Data
- PostgreSQL
- pgvector
- Prisma
04Infrastructure
- Redis
- Docker
Signature verification
Requests must carry Meta's X-Hub-Signature-256 before anything is processed.
Background workers
AI calls never block the webhook. Slow providers delay a reply, not the channel.
Typed data layer
Prisma with an explicit Postgres driver adapter and migrations under version control.
Outcome
Support conversations get an immediate, grounded answer, and the ones that need a person reach one. The backend is structured to grow into tickets and meetings on the same NestJS foundation.