Communication: hbf-broadcast
1-hop view of how this service communicates with its siblings. For the full system view, see service-communication.md.
Calls Out To
| Service | Protocol | Purpose | Key calls / queues |
|---|---|---|---|
| hbf-core | HTTP via hbf-core-api | Broadcast records, bot deployments, subscribers, responses | BroadcastsClient.findAllBy/save(), BotDeploymentClient.findByTenantId(), SubscribersClient.findByHandle/create(), ResponsesClient.findAllBy/createOrUpdate() |
| Facebook Graph API | HTTP | Broadcast messaging | POST /me/message_creatives, /me/broadcast_messages, /me/messages, GET /me/custom_labels, GET /{userId} |
| Microsoft Bot Framework | HTTP | Teams broadcast messaging | POST conversations, activities, GET pagedmembers, POST OAuth token |
| Slack API | HTTP | Slack broadcast messaging | GET conversations.members, users.info, POST chat.postMessage |
| Viber API | HTTP | Viber broadcast messaging | POST broadcast_message, GET get_user_details |
| SMTP | nodemailer | Email delivery for campaigns | Email sending via configured SMTP |
| Elasticsearch | HTTP client | Analytics report data | Query for reporting |
Called By
| Service | Protocol | How |
|---|---|---|
| (none) | -- | Daemon service. Not called by other services. Health check endpoint only. |
Daemon Loop
Polls hbf-core every SCAN_INTERVAL_TIME (60s default) for broadcasts with pending status. Processes each broadcast: fetches subscribers, sends via appropriate channel API, updates status.
Contracts
Inbound
No inbound API (daemon only, health check endpoint).
Outbound
- hbf-core: SDK calls for broadcast CRUD, subscriber management, response tracking
- Facebook: Graph API broadcast and direct message endpoints
- Microsoft Bot Framework: conversation and activity endpoints
- Slack:
chat.postMessageand member enumeration - Viber:
broadcast_messageendpoint
Env vars:
CORE_URL-> hbf-coreCORE_TOKEN-> hbf-coreFB_GRAPH_VERSION/FB_MAX_USERS_PER_BATCH-> FacebookTEAMS_MAX_USERS_PER_BATCH-> TeamsVIBER_MAX_USERS_PER_BATCH-> Viber