Skip to main content

Node notification

The notification node sends a notification using a selected event template from the Events module. Channels, languages, and recipients are taken from the template settings, and the node passes variable values to the template.

The node is located in the left panel next to the telegram and whatsapp nodes. It has one input and one output.


Settings for the notification node

1. Name

A field for specifying the name of the node.
The name is displayed in the workspace and helps easily identify the node.
If left empty, the node will be called notification.

Example:

  • Node name: send order code

2. Event template

A section where the event template is selected and data for it is specified.

Template

A dropdown list of templates. It shows events from the Events module that are marked as templates for the workflow (the Use as a template for workflow checkbox in the event settings) — up to 100 items. The name is taken in the current interface language.

Until a template is selected, the field displays — select template —. The selection can be reset with the cross in the field.

info

When changing the template, the variable values and the path to recipients are cleared — they need to be filled in again.

Template Information

After selecting, a template card appears below the list:

  • Template name — the name of the template.
  • Channels — sending channels included in the template: Email, Push, WebSocket.
  • Recipients — to whom the template sends the notification.
  • Locales — languages in which the template is filled out.

Possible values for Recipients:

ValueWho will receive the notification
All usersall users
Subscriberssubscribers
User groupuser group
Target usertarget user
Registeredregistered users
Everyoneeveryone
User IDs from workflowusers whose IDs are passed by the workflow
Email addresses from workflowemail addresses passed by the workflow

If there is an issue with the selected template, the form warns about it:

  • Failed to load the list of templates. — the list of templates did not load.
  • Template not found. It may have been deleted. — the template was not 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 contains one field with the path to the array of recipients in the message of the workflow, in Mustache format:

  • Path to user IDs in the message — for User IDs from workflow, the hint in the field: {{msg.payload.userIds}};
  • Path to email addresses in the message — for Email addresses from workflow, the hint in the field: {{msg.payload.emails}}.

Example:

{{msg.payload.userIds}}

4. Template variables

This block appears if the template has custom variables. Each variable has a separate field labeled with the variable name (or its marker if there is no name).

The value can be a Mustache expression or a regular string.

Example:

{{msg.payload.code}}

If a variable is removed from the template but a value is saved for it in the node, the form shows a warning These variables are no longer used in the template: with a list of such variables and their values.


Parameters in the JSON schema

In the JSON schema of the workflow, the node settings are stored as follows:

  • name (string) - the name of the node
  • eventId (number | null) - the identifier of the selected event template
  • variables (object) - values of the template variables: key — variable marker, value — Mustache expression or string
  • recipientsPath (string) - path to the array of recipients in the message

Example usage

Example 1: Notification to users passed by the workflow

Task:
Send the order code to several users, the IDs of whom are calculated by the workflow.

Workflow:

[inject] ---> [function] ---> [notification]

Code for the function node:

msg.payload = {
userIds: [12, 15],
code: "A-1024"
};
return msg;

Settings for the notification node:

  • Template: event template where the recipients are User IDs from workflow, and the text contains a variable with the marker code
  • Path to user IDs in the message: {{msg.payload.userIds}}
  • Variable field code in Template variables: {{msg.payload.code}}

Result:
The notification will be sent to users with IDs 12 and 15 through the channels included in the template, and the variable code in the text will be replaced with A-1024.