Skip to main content

Communication: hbf-event-publisher

1-hop view of how this service communicates with its siblings. For the full system view, see service-communication.md.

Calls Out To

ServiceProtocolPurposeKey calls / queues
hbf-coreHTTP (via got)User token validationGET /users/me
Power AutomateHTTP POSTFlow trigger executionPOST to trigger URLs per FlowAssociation
Firebase FCMfirebase-admin SDKBatch push notifications (up to 500 tokens)getMessaging().sendMulticast()

Called By

ServiceProtocolHow
hbf-botHTTP POSTPOST /connectors/flows:trigger -- trigger flows
hbf-lcmHTTP POSTPOST /connectors/flows:trigger -- livechat flow triggers
hbf-lcgHTTP POSTPOST /connectors/flows:trigger -- livechat gateway flow triggers (via publisher-client.service.ts)
hbf-session-managerHTTP POSTPOST /connectors/flows:trigger -- session completion triggers

Contracts

Inbound

Flow management (JWT auth):

  • POST /connectors/power-automate/flows/type/:type -- create flow
  • GET /connectors/flows -- list flows (HBF auth)
  • DELETE /connectors/flows/:flowId -- delete flow

Flow trigger (HBF auth):

  • POST /connectors/flows:trigger -- trigger flows

Trigger callback (JWT auth):

  • PATCH /connectors/triggers/:flowId -- update trigger status

Push notifications (JWT auth):

  • POST /push/{impl}/register -- device token registration
  • POST /push/{impl}/unregister -- device token invalidation
  • POST /push/{impl}/send -- single push
  • POST /push/{impl}/send-to-many -- multi push
  • POST /push/{impl}/send-batch -- batch to single user
  • POST /push/{impl}/send-batch-to-many -- batch to many

Outbound

  • hbf-core: GET {HBF_CORE_URL}/users/me with caller's Bearer token (passthrough via HBFGuard)
  • Power Automate: POST {triggerUrl} with custom headers and body
  • Firebase FCM: multicast to device tokens

Env vars:

  • HBF_CORE_URL -> hbf-core
  • GOOGLE_APPLICATION_CREDENTIALS -> Firebase
  • JWT_SECRET -> JWT signing

Flows Involving This Service