Skip to content

Push Notification

Overview

The Push Notification node sends a push notification to a device token or a named topic using a configured provider (e.g. FCM, APNs). Use it to alert users or systems of battle results, workflow completions, or other time-sensitive events. The node requires a valid credential binding to the push provider and will route failures to the error output rather than halting the workflow. Notification delivery is fire-and-forget; the output carries the provider's message ID for downstream tracking.

Configuration

FieldTypeRequiredDescription
providerenum (fcm, apns, expo)YesPush provider to use for delivery. Determines which credential set is resolved at runtime.
credentialIdstringYesID of the stored credential that authenticates against the selected provider.
targetstringYesDevice registration token or topic name (prefix with '/topics/' for topic-based fanout).
titlestringYesNotification title shown in the system tray. Supports template variables (e.g. {{battle.title}}).
bodystringYesNotification body text. Supports template variables.
dataobjectNoArbitrary key-value payload delivered silently alongside the visible notification.
soundstringNoSound file name to play on delivery. Use 'default' for the system default sound. Omit to send silently.
ttlnumberNoTime-to-live in seconds. Messages undelivered after this duration are dropped by the provider. Defaults to 2419200 (28 days).

Inputs

PortTypeDescription
inputanyTrigger signal and optional context passed from the upstream node. Template variables in title/body/data are resolved against this value.
targetstringOptional override for the device token or topic at runtime, taking precedence over the static target configured on the node.

Outputs

PortTypeDescription
outputobjectPasses through the input value merged with a messageId field returned by the provider on successful delivery.
errorobjectEmitted when the provider rejects the request or a network failure occurs. Carries code, message, and the original input for retry logic.

Example

json
{
  "nodeType": "push_notification",
  "config": {
    "provider": "fcm",
    "credentialId": "cred_fcm_prod_01",
    "target": "/topics/battle-results",
    "title": "Battle finished: {{battle.title}}",
    "body": "{{winner.handle}} won by a score of {{score.final}}. See the full breakdown.",
    "data": {
      "battleId": "{{battle.id}}",
      "type": "battle_result"
    },
    "ttl": 86400
  }
}