Trigger Slack alert

Send a Slack message when a trigger condition is met.

Overview

This node sends a Slack message when a trigger condition is met. It can upload a snapshot image and a video clip to Slack, then link to them in the notification.

Inputs & Outputs

  • Inputs : 1, Media Format : Raw Video
  • Outputs : 1, Media Format: Raw Video
  • Output Metadata : None

Properties

PropertyDescriptionTypeDefaultRequired
trigger_sourceSend notifications from events generated by other nodes or a custom defined trigger. Options: Events from previous nodes (built_in); Custom Trigger (custom).enumcustomYes
triggerSend an alert when this condition evaluates to true. Conditional on trigger_source being custom.trigger-conditionnullYes
enabledNotifications EnabledbooltrueNo
slack_bot_tokenBot token created from your Slack app.stringnullYes
slack_channelsComma-separated list of channel IDs or #channel names to post messages to.stringnullYes
subjectTitle of the Slack message. See node documentation for template variables.string{{ source_name }} : {{ event_name }}Yes
bodyBody of the Slack message. See node documentation for template variables.string{{ event_description }}No
include_snapshotInclude a snapshot from the trigger time.booltrueNo
snapshot_object_typesSelect the object types to include in the snapshot. If not specified, entire frame will be sent. Conditional on include_snapshot being true.model-labelsnullNo
media_nodeAttaches media from the specified node with the message. Specifying a Save Clip node will include the most recent clip from the node. The node must be configured to store clips locally.stringnullNo
livestream_nodeEnables including the live stream URL from the named WebRTC node with the message. Accepted node type: stream_webrtc_out.stringnullNo
intervalMin. time between consecutive notifications. Unit: seconds.float10No
max_media_wait_timeMax. time to wait until a media clip is available. Unit: seconds.float10No
media_extensionsComma separated list of media extensions to attach when a Media node is specified. For example, 'mp4,jpg,png,gif'.stringmp4No
use_camera_as_sourceEnable to report a linked camera as the source for camera streams and Universal bridge clips.boolfalseNo

Template Syntax

The following Template variables are available to use in Subject and Body. The templates can be built using Jinja2 Template Syntax.

Variables available to the template:

VariableDescription
metaFrame metadata. Contains keys like nodes, objects, and other custom metadata inserted by Custom function node.
application_idThe application ID of the deployment that produced this metadata.
application_nameThe application name of the deployment that produced this metadata.
deployment_idThe deployment ID of the deployment that produced this metadata.
deployment_nameThe deployment name of the deployment that produced this metadata.
source_nameThe name of the source that produced this metadata.
livestream_urlThe URL of the livestream.
event_nameName of event(s) contained in this frame.
event_descriptionDescription of events contained in this frame.

Example templates

Static text content:

Text content

Reference specific metadata:

Person detected on {{ source_name }}. View live stream at {{ livestream_url }}

Metadata reinserted as is:

{{ meta | tojson }}

Output Metadata

Node does not insert any output metadata; upstream metadata continues through the pipeline

Slack App Setup

  1. Create a new Slack app at https://api.slack.com/apps and choose From scratch.
  2. Under OAuth & Permissions, add the following Bot Token Scopes:
    • chat:write
    • files:write
    • channels:read (only needed if you use #channel names instead of IDs for public channels)
    • groups:read (only needed if you use #channel names instead of IDs for private channels)
  3. Install the app to your workspace and copy the Bot User OAuth Token (starts with xoxb-).
  4. Invite the bot to the target channel in Slack (e.g. /invite @Lumeo Alerts).
  5. Paste the bot token into slack_bot_token and the channel name/IDs into slack_channels.

Slack App Manifest

Use this app manifest to quickly configure the Slack app.

_display_information:
  name: Lumeo Alerts
features:
  bot_user:
    display_name: Lumeo Bot
    always_online: true
oauth_config:
  scopes:
    bot:
      - chat:write
      - files:write
      - channels:read
      - groups:read
settings:
  org_deploy_enabled: false
  socket_mode_enabled: false
  token_rotation_enabled: false

Did this page help you?