Skip to content
Jaylen Baxter edited this page Oct 13, 2024 · 5 revisions

This node is constructed with main fields and two different sets of fields to utilize: generic fields, and JSON and n8n binary fields.

Main Fields

Credentials

Screenshot of n8n credential field

Use this field to provide a valid bearer token to the request when necessary. View the Credentials wiki page to learn how to create an n8n credential with a ntfy token.

Custom Server

Screenshot of n8n custom server fields

To use a custom server url, check the "Use Custom Server" and enter a valid ntfy server url within the "Server URL" field. If "Use Custom Server" is false (or off), then the notification will be posted to a topic on the ntfy.sh server.

Topic (Required)

Screenshot of n8n topic field

This is the only required field within the node, as the API requires a specific topic to post the notification.

Construct Notification

Screenshot of n8n construct notification field

This field selects whether generic fields are used or JSON and binary fields.

Generic Fields

Title

Screenshot of n8n title field

Overrides the title of the notification. If no title is input into the field, the default title will be the topic name.

Priority

Screenshot of n8n priority field

All notifications sent with the ntfy API require a priority. To learn more about the significance and usage of the notification priority, view the ntfy docs.

Emojis/Tags

Screen recording of using n8n emojis/tags field

The above screen recording shows the emojis/tags field in use. You may add multiple emojis/tags to the notification. To add an emoji and utilize the search functionality of all emojis available through the ntfy API, choose "From list" in the "Mode" dropdown. To add any custom tags, or to add emojis without the search functionality, choose "String" from the "Mode" dropdown. You must add a field for each tag you want to add. Do not separate tags with a comma or any other delimiter when using the "String" mode.

To view the full list of available emojis through the ntfy API, view the ntfy docs.

Message

Screenshot of n8n message field

A message is not required, however, the field will be populated with "triggered" by default if no message is provided.

Additional Options

The additional options section of the node consists of additional fields to provide to your ntfy notification.

Action Buttons

Action buttons allow you to react to notifications directly by providing buttons to tap on the notification. There are 3 actions supported within the ntfy API:

  1. view: Opens a website or app
  2. broadcast: Sends an Android broadcast intent
  3. http: Sends an HTTP request

Within the node, only view and http are supported. To learn more about using action buttons, view the ntfy docs.

View

Screenshot of n8n action button view field

HTTP

Screenshot of n8n action button http field

When sending headers and/or a body with the HTTP request, the field(s) requires a properly formatted JSON object. In further updates of the node, this may change to allowing a JSON object, or a series of keypairs.

Attachment

Screenshot of n8n attachment field

This allows sending images or other files as attachments to a ntfy notification. In the above screenshot, there are 2 fields: one for changing the filename of the attachment, and one for the URL of the attachment. Currently, this n8n node only supports attaching images/files through a URL and does not support binary data coming from another node. Attaching a file as binary data through this node is planned for a future update, however, you may use the n8n core HTTP Request node to attach a file as binary data. An example of this workflow/HTTP node will be provided on this wiki at a later time.

Click Action

Screenshot of n8n click action field

This defines a URL which will open when the notification is tapped. To view more information on the click action and/or valid URLs, visit the ntfy docs.

Icon

Screenshot of n8n icon field

This defines a URL to a JPEG/PNG image to use for the icon of the notification. Currently, ntfy only supports this option on Android devices. Refer to the ntfy docs to learn more.

Scheduled Delivery

Screenshot of n8n scheduled delivery field

This allows you to delay the sending of the notification to the ntfy server. To view more information on proper values for this field, visit the ntfy docs.

JSON and Binary Fields

JSON

Screenshot of n8n json field

This field takes JSON data and converts the data into headers on the backend for the request to ntfy servers. To learn more about the headers available to use and how to use them, visit the ntfy docs

File Attachment

Screenshot of n8n file attachment field

This field takes a string value, representing any n8n binary data coming into the ntfy node. For example, say you convert a base64 string into an image using the n8n Convert to File node, and in that node, you set the Put Output File in Field option within that node as "data". You would then set this field to "data" to utilize the n8n binary data to attach it as a file attachment within the notification. For text based files, you may need to set the Filename header in the JSON file so that ntfy understands the binary data it's receiving.