WhatsApp Campaign — Register Campaign Type to CAA (Chatbot Autoreply)
When a WhatsApp campaign message is sent to a customer it appears as an outbound message in the inbox room, but it is not registered to CAA (Custom Agent Allocation — the webhook that feeds the chatbot / autoreply). The chatbot receives only the customer's inbound reply and has no visibility into which campaign (template, category, content) preceded it — breaking context for commerce autoreply flows.
This initiative enriches the CAA inbound webhook payload with a campaign_messages array
describing every eligible prior campaign outbound message in the room within a 30-day
look-back window (including campaigns sent before the room existed — UC4, backdated), so
the chatbot can autoreply with awareness of what was sent, with no secondary lookup.
Scope Changes
Engineering surfaces this initiative touches (controlled vocab). Aggregate of all docs below.
- Backend — new read-time enrichment in
hub_core: eligible-campaign lookup repository,message_type/message_categoryresolver, content-to-text serializer, and an additivecampaign_messageskey on thecustom_agent_allocationwebhook. No schema migration (read-time derivation from existingmessages/message_broadcasts/message_templates).
PRD
The PRD for this initiative is maintained in Confluence (not mirrored into this
repo's prds/):
| PRD | Version | Source |
|---|---|---|
| 26Q3 WhatsApp Campaign — Register Campaign Type to CAA | v1.1 FINAL | Confluence (space QON) · Epic QC-22896 |
RFCs
| RFC | Description | Status |
|---|---|---|
| Register Campaign Type to CAA — Backend | Enrich the CAA (chatbot autoreply) webhook with a single consistent campaign_context envelope: case 1 (reply to an interactive quick-reply broadcast) → that button's broadcast; case 2 (any other reply) → all in-room campaigns. Unifies/supersedes the legacy last_campaign. Read-time derivation, no migration | in-review |
| ↳ Summary | Reading-aid digest (TL;DR, decisions, key flow, execution plan) | in-review |
| ↳ RFC Review | rfc-reviewer assessment — 9.0/10 Agentic-Ready / PROCEED (rev5) | in-review |
| ↳ Task Breakdown | 7 vertical BE tasks · ~13 man-days (10 BE + 3 QA), medium confidence | in-review |
Dependencies
- Chatbot / Automation squad — must consume the 5 new fields in the CAA webhook (CAA-S05 / QC-23109). Blocking for product value, not for BE delivery.
- Chat-1 / Inbox backend — owns the CAA webhook contract; must accept the additive
campaign_messageskey. Non-blocking (additive JSON). - PM (Evelin Suwantio) — resolve the PRD header/footer serialization contradiction (RFC Open Q#4) before the serializer chunk is implemented.