Send Notification
Use this node to dispatch notifications to users or groups via the notification center — for example, sending a web notification to on-call engineers when a critical alarm is created, or emailing a tenant administrator when a device goes offline.
Configuration
Section titled “Configuration”- Template — required. A Rule node type notification template that defines the content, format, and delivery channels (Web, Email, SMS, Slack, etc.). Select from existing templates in your ThingsBoard instance.
- Recipients — required. One or more recipient groups that will receive the notification. The notification system automatically deduplicates recipients across groups.
Outgoing message format
Section titled “Outgoing message format”On success, the following field is added to the message metadata:
notificationRequestResult— JSON string with delivery statistics:sent— map of delivery channel → number of notifications senterrors— map of delivery channel → number of failurestotalSent/totalErrors— aggregate countserror— top-level error message (null on success)
Example metadata after successful notification:
{ "deviceName": "Weather Station 01", "notificationRequestResult": "{\"sent\":{\"WEB\":1},\"errors\":{},\"totalErrors\":0,\"error\":null,\"totalSent\":1}"}Message data is not modified.
Message processing algorithm
Section titled “Message processing algorithm”- Create a notification request from the incoming message data, metadata, originator, and the configured template and recipients.
- Submit the request asynchronously to the notification center.
- On completion, add
notificationRequestResultto the message metadata and route viaSuccess. - On unexpected error, route via
Failure.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
Success | Notification processed and sent; notificationRequestResult added to metadata. |
Failure | Unexpected error during notification processing. |
Examples
Section titled “Examples”Example 1 — Notify on-call team of telemetry values
Section titled “Example 1 — Notify on-call team of telemetry values”Data: { "temperature": 23.5, "humidity": 65.2 } | Metadata: { "deviceName": "Weather Station 01" }.
{ "templateId": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "entityType": "NOTIFICATION_TEMPLATE" }, "targets": ["784f394c-42b6-435a-983c-b7beff2784f9"]}Template body: Weather Update from ${deviceName}: Temp ${temperature}°C, Humidity ${humidity}%
Result: notification sent via Web channel. notificationRequestResult added to metadata. Routes via Success.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbNotificationNodeConfiguration", "type": "object", "required": ["templateId", "targets"], "additionalProperties": false, "properties": { "templateId": { "type": "object", "required": ["id", "entityType"], "properties": { "id": { "type": "string", "format": "uuid" }, "entityType": { "type": "string", "enum": ["NOTIFICATION_TEMPLATE"] } } }, "targets": { "type": "array", "items": { "type": "string", "format": "uuid" }, "minItems": 1 } }}