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
| Property | Value |
|---|---|
trigger | Send the message once this trigger condition is met. |
slack_bot_token | Bot token created from your Slack app (starts with xoxb-). |
slack_channels | Comma-separated list of Slack channel IDs or channel names (e.g. #alerts) to post messages to. |
subject | Title of the Slack message. Supports template variables such as {{ source_name }} and {{ event_name }}. |
body | Body of the message. Supports template variables such as {{ event_description }}. |
include_snapshot | Include a snapshot image from the trigger time. |
media_node | Upload the most recent media file from this node (for example, a Save Clip node) and include a link in the message. |
livestream_node | Include the live stream URL from a Stream WebRTC node. |
interval | Min time (seconds) between consecutive notifications. |
max_media_wait_time | Maximum time to wait for a media clip to become available. |
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:
| Variable | Description |
|---|---|
meta | Frame metadata. Contains keys like nodes, objects, and other custom metadata inserted by Custom function node. |
application_id | The application ID of the deployment that produced this metadata. |
application_name | The application name of the deployment that produced this metadata. |
deployment_id | The deployment ID of the deployment that produced this metadata. |
deployment_name | The deployment name of the deployment that produced this metadata. |
source_name | The name of the source that produced this metadata. |
livestream_url | The URL of the livestream. |
event_name | Name of event(s) contained in this frame. |
event_description | Description 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 }}
Metadata
| Metadata Property | Description |
|---|---|
| None | None |
Slack App Setup
- Create a new Slack app at https://api.slack.com/apps and choose From scratch.
- Under OAuth & Permissions, add the following Bot Token Scopes:
chat:writefiles:writechannels:read(only needed if you use#channelnames instead of IDs for public channels)groups:read(only needed if you use#channelnames instead of IDs for private channels)
- Install the app to your workspace and copy the Bot User OAuth Token (starts with
xoxb-). - Invite the bot to the target channel in Slack (e.g.
/invite @Lumeo Alerts). - Paste the bot token into
slack_bot_tokenand the channel name/IDs intoslack_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: falseUpdated 2 days ago
