The context
This project was born to handle four different digital offers from the same WhatsApp number. Each product needs a different conversation, tone, landing page, and security rules. A generalist bot could mix up information, repeat questions, or send a person to the wrong page.
The challenge
The system had to recognize which product a contact was interested in, remember what had been discussed, answer real questions without turning every turn into a rigid script, and keep a clear path for a person to take over. It also had to distinguish contacts coming from ads versus referrals, and handle external failures without leaving the customer in silence.
The solution
I built a central workflow in n8n connected to the WhatsApp Cloud API. A router identifies the product from the customer's selection or the message's origin data and activates the corresponding context. The four journeys work as separate assistants: Sofía, Lucía, Valentina, and Sara — each with its own information, boundaries, conversation style, and landing page.
How the journey works
- WhatsApp receives the message and validates it's a real conversation, not a technical event.
- The system logs the contact and detects whether it came from an ad, a referral, or an unknown source.
- The router selects the product and isolates memory by phone number and context to prevent cross-talk between agents.
- The specialized agent responds in short messages and shares only its authorized landing page.
- Chatwoot keeps a supervision inbox where an operator can observe or take over the conversation.
- If a person intervenes or a critical failure occurs, the automation pauses and preserves context.
The four agents
- Sofía: handles questions about a children's biblical ebook and adapts the conversation to the child's age.
- Lucía: handles a recreational ebook about Jonah and the Great Fish, with a short, family-friendly journey.
- Valentina: presents a recipe program with respectful language and boundaries around medical questions.
- Sara: handles a program for married couples, with reinforced rules for signs of violence, risk, or crisis.
Key features
- Routing across four products from a single channel
- Independent memory per contact and product
- Attribution of Meta ads and referral links
- Landing page, pricing, and business rules isolated per agent
- Human inbox with automatic-message identification
- Controlled pause and reactivation during human intervention
- Fallback and assignment protocol when a critical component fails
Tech stack
n8n · WhatsApp Cloud API · Google Gemini · Chatwoot · Docker · Webhooks · JavaScript
Current status
Routing, memory, the four commercial journeys, source attribution, and human hand-off have passed functional testing. The system is still under active development, with conversation follow-up and closing logic being refined. For privacy, no panel access is published and no real customer conversations are shown.