Slack Trigger

Receive Slack messages and events as workflow triggers.

When to Use

Use Slack Trigger when:

  • You want to run a workflow when someone posts a message or mentions your bot
  • You need to react to emoji reactions or channel activity
  • Slack is the event source and your workflow runs asynchronously

For sending messages back to Slack, pair this with Slack Send Message.

Output

HandleTypeDescription
payloadobjectNormalized Slack event payload

The payload (accessed as {{ slack.* }}) shape:

FieldTypeDescription
userstringSlack user ID of the event author
channelstringChannel ID where the event occurred
textstringMessage text (for message and mention events)
timestampstringSlack message timestamp (ts)
thread_tsstringThread parent timestamp, if the message is in a thread
event_typestringEvent type (e.g. message, app_mention, reaction_added)
raw_eventobjectFull Slack event object for advanced use cases

Settings

Events

SettingTypeDefaultDescription
event_typesmulti-selectmessage, app_mentionSlack event types to listen for: message, app_mention, reaction_added, message.channels

Filters

SettingTypeDefaultDescription
channel_filterstringOnly trigger for events in this channel ID. Leave empty to accept all channels.

Testing

SettingTypeDefaultDescription
mockPayloadcode editor (JSON)Sample Slack event JSONJSON body to inject when running this workflow locally for testing.

Required Secrets

Configure these on the Env Vars page:

Env VarDescription
SLACK_BOT_TOKENBot User OAuth Token (xoxb-...) from your Slack app
SLACK_SIGNING_SECRETSigning secret used to verify incoming Slack requests

Example

Canvas

React to bot mentions and reply in the same thread:

  1. Create a Slack App at api.slack.com/apps
  2. Enable Event Subscriptions and set the Request URL to your deployed trigger endpoint on triggers.tensorify.io
  3. Subscribe to bot events matching your event_types setting
  4. Install the app and add SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET as env vars
  5. Set event_types to app_mention
  6. Add a Slack Send Message node — set Channel to {{ slack.channel }}, Thread Timestamp to {{ slack.thread_ts }}, and Message Text to your response

Access event data in downstream nodes:

{{ slack.user }}
{{ slack.text }}
{{ slack.channel }}
{{ slack.event_type }}

The plugin handles Slack's URL verification challenge automatically.

TSL

import slack from @tensorify/slack-trigger:1.0.0
import slack_send from @tensorify/slack-send-message:1.0.0

node trigger @tensorify/slack-trigger:1.0.0 {
    event_types = ["app_mention"]
    channel_filter = ""
}

node reply @tensorify/slack-send-message:1.0.0 {
    channel = "{{ slack.channel }}"
    thread_ts = "{{ slack.timestamp }}"
    text = "Thanks for mentioning me, <@{{ slack.user }}>!"
}

trigger.payload -> reply.input

Common Gotchas

  • Bot messages ignored: Slack does not deliver bot-authored messages by default. Subscribe to app_mention if you want the bot to respond when tagged.
  • Missing scopes: Ensure your Slack app has the OAuth scopes required for the events you subscribe to (e.g. channels:history, app_mentions:read).
  • Channel filter: Use the channel ID (e.g. C01234ABCDE), not the channel name.
  • Signing secret required: Requests without a valid signature are rejected. Double-check SLACK_SIGNING_SECRET matches your app settings.

See Also

On this page