The notification node
The notification node sends a notification using a selected event template from the Events (opens in a new tab) module. Channels, languages, and recipients come from the template settings, and the node passes variable values to the template.
The node is in the left panel next to the telegram and whatsapp nodes. It has one input and one output.
notification node settings
1. Name
The node name.
The name appears in the workspace and helps you identify the node.
If you leave it empty, the node is named notification.
Example:
- Node name:
send order code
2. Event template
Here you select the event template and set the data for it.
Template
A dropdown list of templates. It shows up to 100 events from the Events module that are marked as workflow templates (the Use as a template for workflow checkbox in the event settings). Names are shown in the current interface language.
Until you select a template, the field shows — select template —. To clear the selection, click the cross in the field.
When you change the template, the variable values and the recipients path are cleared, and you need to fill them in again.
Template details
After you select a template, a template card appears below the list:
- Template name: the template name.
- Channels: the sending channels enabled in the template: Email, Push, WebSocket.
- Recipients: who the template sends the notification to.
- Locales: the languages the template is filled in for.
Possible Recipients values:
| Value | Who receives the notification |
|---|---|
| All users | All users |
| Subscribers | Subscribers |
| User group | A user group |
| Target user | The target user |
| Registered | Registered users |
| Everyone | Everyone |
| User IDs from workflow | Users whose IDs the workflow passes |
| Email addresses from workflow | Email addresses the workflow passes |
If something is wrong with the selected template, the form shows a warning:
- Failed to load the list of templates. The template list didn't load.
- Template not found. It may have been deleted. The template wasn't found; it may have been deleted.
- The selected event is no longer a template. The selected event is no longer marked as a template.
3. Recipients
This block appears only if the template recipients are User IDs from workflow or Email addresses from workflow. It has one field with the path to the recipients array in the workflow message, in Mustache format:
- Path to user IDs in the message: for User IDs from workflow. The field hint is
{{msg.payload.userIds}}. - Path to email addresses in the message: for Email addresses from workflow. The field hint is
{{msg.payload.emails}}.
Example:
{{msg.payload.userIds}}
4. Template variables
This block appears if the template has custom variables. Each variable gets its own field, labeled with the variable name (or its marker if it has no name).
The value is a Mustache expression or a plain string.
Example:
{{msg.payload.code}}
If a variable was removed from the template but the node still has a saved value for it, the form shows the warning These variables are no longer used in the template: with a list of those variables and their values.
Parameters in the JSON schema
The workflow JSON schema stores the node settings as follows:
name(string) - the node nameeventId(number | null) - the ID of the selected event templatevariables(object) - template variable values: the key is the variable marker, the value is a Mustache expression or a stringrecipientsPath(string) - the path to the recipients array in the message
Usage example
Example 1: Notifying users passed by the workflow
Task:
Send an order code to several users whose IDs the workflow calculates.
Workflow:
[inject] ---> [function] ---> [notification]
function node code:
msg.payload = {
userIds: [12, 15],
code: "A-1024"
};
return msg;
notification node settings:
- Template: an event template whose recipients are User IDs from workflow and whose text contains a variable with the marker
code - Path to user IDs in the message:
{{msg.payload.userIds}} - The
codevariable field in Template variables:{{msg.payload.code}}
Result:
The notification goes to users with IDs 12 and 15 through the channels enabled in the template, and A-1024 replaces the code variable in the text.