Skip to main content

Slack Trigger

Type ID: slackTrigger  ·  Kind: Trigger  ·  Trigger style: poll  ·  Trace: CHAIN

Polls the Slack conversations.history API on an interval and triggers the workflow when new messages matching the configured filters are posted in a channel.

Credentials

Slack

Properties

PropertyKeyTypeRequiredDefaultPossible valuesShown when
Poll IntervalpollIntervalMsnumberYes60000Interval in milliseconds to check for new messages (minimum 60 seconds)Always
EventeventoptionsYesmessagePostedmessagePosted (Message Posted)Always
Channel IDchannelIdstringYes''Slack channel ID to monitor, e.g. C1234567890Always
OutputoutputoptionsNosimplesimple (Simplified), raw (Raw)Always
FiltersfiltersobjectNo{}See sub-tableAlways
OptionsoptionsobjectNo{}See sub-tableAlways

filters (object)

PropertyKeyTypeRequiredDefaultPossible values
User IDuserIdstringNo''Only trigger on messages from this Slack user ID
Text ContainstextContainsstringNo''Only trigger on messages containing this text
Exclude Bot MessagesexcludeBotsbooleanNotrueExclude messages from bots
Message SubtypesubtypestringNo''Filter by message subtype, e.g. bot_message, file_share

options (object)

PropertyKeyTypeRequiredDefaultPossible values
Max Messages Per PollmaxMessagesnumberNo10Max messages processed per poll (clamped to 1-100)
Include Thread RepliesincludeThreadRepliesbooleanNofalseInclude messages that are thread replies

Notes

Fires via poll(). Requires channelId (poll and execute both throw if missing). Uses a stateless time window: each poll calls conversations.history with oldest = (now - pollIntervalMs) and latest = now as Unix timestamps, inclusive: true, and limit = maxMessages.

Filtering is applied client-side after fetch: messages are dropped if they don't match userId, if textContains is set and the text doesn't include it, if excludeBots is set and the message has a bot_id or bot_message subtype, if subtype is set and doesn't match, or (unless includeThreadReplies) if the message is a thread reply (thread_ts set and not equal to ts). simple output maps each message to a flattened object (ts, type, user, text, channel, threadTs, isBot, subtype, attachments, files, reactions, edited); raw returns the message as received.

When the channel returns no messages in the window, or none survive filtering, the node returns null and the workflow does not trigger. Otherwise it emits one item whose json contains messages (array) and a summary with count, channel, users, previews (first 50 chars per message), pollInterval, and polledAt.

The trigger() method delegates to poll(). When used as a non-root internal node, execute() returns a wait item on the poll channel.