Communication: hbf-session-manager
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 SDK + direct HTTP | Tenant list, chat session lookup, batch status updates, NLP pipeline queries | Multiple SDK clients + direct HTTP |
| hbf-event-publisher | HTTP POST | Flow triggers on session/survey completion | POST /connectors/flows:trigger (chat-session-completed, survey-completed) |
| hbf-nlp | HTTP POST | LLM summarization of completed sessions | POST /organizations/:orgId/tenants/:tenantId/sessions/:chatSessionId/analyze |
| Customer webhooks | HTTP POST | Completed session payloads to registered URLs | POST to registered webhook URLs with custom headers |
| SMTP | nodemailer | Error notification emails | Error alerts via configured SMTP |
Called By
| Service | Protocol | How |
|---|---|---|
| Admin/moderator API | REST | CRUD for webhook integrations |
Scheduled Jobs (Cron)
| Job | Interval | Purpose |
|---|---|---|
| Chat session expiry check | CHAT_SESSION_CHECK_INTERVAL_IN_MINS | Finds inactive sessions, marks COMPLETED, triggers event-publisher, dispatches webhooks, initiates LLM summarization |
| NLP pipeline auto-train check | NLP_PIPELINE_CHECK_INTERVAL_IN_MINS | Triggers training for out-of-date pipelines |
Contracts
Inbound
POST /organizations/:orgId/integrations/-- create webhook integrationGET /organizations/:orgId/integrations/-- list integrationsGET /organizations/:orgId/integrations/:id-- get integrationPUT /organizations/:orgId/integrations/:id-- update integrationDELETE /organizations/:orgId/integrations/:id-- delete integrationGET /organizations/:orgId/integrations/errors/:id-- list webhook errors
Outbound
- Customer webhook:
POST {webhookUrl}-- ChatSessionDTO with messages, tenant, participants, contacts. Custom headers per integration. - hbf-event-publisher:
POST /connectors/flows:trigger?triggerType=chat-session-completed|survey-completed&organizationId=<id>&tenantId=<id>-- session/survey DTO - hbf-nlp:
POST /organizations/:orgId/tenants/:tenantId/sessions/:sessionId/analyze-- Bearer token - hbf-core:
GET /nlp-pipelines/:id(poll training status),POST hbf-nlp /nlp-pipelines/:id/train
Env vars:
CORE_URL-> hbf-coreCORE_TOKEN-> hbf-coreEVENT_PUBLISHER_URL-> hbf-event-publisherNLP_URL-> hbf-nlp