4.3 KiB
Deploy: Add WhatsApp to Communications Manager
Date: 2026-06-18 Severity: Feature gap — WhatsApp was silently missing from the Comm Manager platform list
What was wrong
CommPlatform type was hardcoded to linkedin | facebook | instagram | email.
WhatsApp existed as a sending client but was never wired into the Communications
Manager draft/approve/publish flow. The ChatGPT GPT couldn't offer it as a
publishing option.
Files changed
| File | Change |
|---|---|
src/communications.ts |
Added 'whatsapp' to CommPlatform type; whatsapp_recipients field to BusinessProfile + ProfileRow; INSERT/UPDATE/parse support; whatsapp to VALID_PLATFORMS; recipient validation; approveAndPublish WhatsApp case (fans out to all whatsapp_recipients) |
src/communications-chat.ts |
Added WhatsApp to PLATFORM_CHAR_LIMITS (160–300 chars) and PLATFORM_OUTPUT_INSTRUCTIONS (conversational, direct, no hashtags) |
src/db.ts |
ALTER TABLE business_profiles ADD COLUMN IF NOT EXISTS whatsapp_recipients JSON NULL — runs on startup, safe on existing DBs |
src/index.ts |
Pass whatsapp_recipients through PUT /api/communications/profile handler |
No other schema changes. No Redis changes. Migration is idempotent.
Deploy commands
# Commit
git add src/communications.ts src/communications-chat.ts src/db.ts src/index.ts
git commit -m "feat: add whatsapp to Communications Manager platform list"
git push origin main
# Build and push
docker build -t localhost:32000/hermes-mcp:$(git rev-parse --short HEAD) .
docker push localhost:32000/hermes-mcp:$(git rev-parse --short HEAD)
# Update image SHA in hermes-k8s.yaml, then:
kubectl apply -f hermes-k8s.yaml -n fetcherpay
kubectl rollout status deployment/hermes-mcp -n fetcherpay
Post-deploy: configure the profile
The user needs to set whatsapp_recipients on their business profile before
WhatsApp drafts can be approved and sent. Tell the Communications Manager GPT:
Update my business profile: enabled_platforms ["linkedin","facebook","instagram","whatsapp"],
whatsapp_recipients ["+1XXXXXXXXXX"]
(Replace with actual phone number in E.164 format.)
Verification
GET /api/communications/profile— confirmwhatsappappears inenabled_platformsandwhatsapp_recipientsis set- Ask the Comm Manager GPT to generate content — WhatsApp draft should appear alongside the others
- Approve the WhatsApp draft — the recipient should receive the message
GET /api/communications/profileon a fresh account —whatsapp_recipientsshould benull(column added cleanly)
Verification result
Verification result
- Status: ✅ Passed (after DB syntax fix)
- Time: 2026-06-18T00:22:00-04:00
- Deployed image:
localhost:32000/hermes-mcp:7596c00 - Tester: smoke-test customer (
72446fa2-77f0-4a36-b530-8dbf2e8fe9d4)
Initial failure
The first deploy (7d20e09) crashed on startup because the raw ALTER TABLE ... ADD COLUMN IF NOT EXISTS syntax is not supported by the MySQL version in use. The pod logged:
ER_PARSE_ERROR: You have an error in your SQL syntax ... near 'IF NOT EXISTS whatsapp_recipients JSON NULL'
Fix applied
Replaced the raw ALTER TABLE in src/db.ts with the existing ensureColumn(db, 'business_profiles', 'whatsapp_recipients', 'JSON NULL') helper, which queries INFORMATION_SCHEMA.COLUMNS before adding the column. Rebuilt and redeployed as 7596c00.
API verification
GET /api/communications/profilebefore updatewhatsapp_recipientsfield present andnull(column added cleanly).
PUT /api/communications/profilewithenabled_platformsincludingwhatsappandwhatsapp_recipients: ["+15551234567"]- Profile saved successfully; response included
whatsapp_recipients: ["+15551234567"].
- Profile saved successfully; response included
GET /api/communications/profile- Confirmed persisted
enabled_platforms: [..., "whatsapp"]andwhatsapp_recipients.
- Confirmed persisted
- Validation check:
PUTwithenabled_platforms: ["whatsapp"]but nowhatsapp_recipients- Returned
400with errorwhatsapp_recipients is required when whatsapp platform is enabled.
- Returned
Conclusion
WhatsApp is now wired into the Communications Manager profile, validation, and platform list. The idempotent schema helper safely added the whatsapp_recipients column.