Skip to main content

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_category resolver, content-to-text serializer, and an additive campaign_messages key on the custom_agent_allocation webhook. No schema migration (read-time derivation from existing messages/message_broadcasts/message_templates).

PRD

The PRD for this initiative is maintained in Confluence (not mirrored into this repo's prds/):

PRDVersionSource
26Q3 WhatsApp Campaign — Register Campaign Type to CAAv1.1 FINALConfluence (space QON) · Epic QC-22896

RFCs

RFCDescriptionStatus
Register Campaign Type to CAA — BackendEnrich 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 migrationin-review
↳ SummaryReading-aid digest (TL;DR, decisions, key flow, execution plan)in-review
↳ RFC Reviewrfc-reviewer assessment — 9.0/10 Agentic-Ready / PROCEED (rev5)in-review
↳ Task Breakdown7 vertical BE tasks · ~13 man-days (10 BE + 3 QA), medium confidencein-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_messages key. Non-blocking (additive JSON).
  • PM (Evelin Suwantio) — resolve the PRD header/footer serialization contradiction (RFC Open Q#4) before the serializer chunk is implemented.