Core Capabilities
What Reports · Notifications Does
A single webhook call from the automation workflow triggers the entire distribution chain — report, PDF, email, Telegram, dashboard broadcast, and a database log entry — with each step running independently so a failed email doesn't block the Telegram send.
Audience
Who Receives What
Project Managers
Get the full PDF report by email the moment it's generated — no need to log into the dashboard to see whether last week's numbers moved.
Site Supervisors
Receive the Telegram summary on their phone, with the option to open the attached PDF if the headline numbers warrant a closer look.
Owners & Sponsors
Are added to the email distribution list without needing any dashboard access at all — the report comes to them.
Ops / IT Admins
Use the notification history endpoint and MySQL views to confirm delivery rates and troubleshoot a missed send.
Integration Points
Where This Plugs In
This module is the backend half of the pipeline — it doesn't process documents itself, it receives already-classified, already-scored data from the automation workflow and turns it into something a person actually reads.
| Webhook Endpoint | POST /api/notifications/webhook — authenticated with an API key, receives disciplineData, crossDiscipline, and metadata from the n8n workflow. |
| Report → PDF → Notify | Report generation, PDF conversion, and both notification channels run via Promise.allSettled so one failure doesn't block the others. |
| WebSocket Broadcast | Uses the same WebSocket server instance shared with the backend's core API, so no separate real-time infrastructure is needed. |
| Mobile & Web Consumers | Both the web dashboard and the mobile app listen for the report_generated and alert broadcast types to refresh their views. |
Next Module
The report just landed — now what?
See how the same data reaches a phone in the field through the Mobile App module.