Package Information
Documentation
@mbakgun/n8n-nodes-slack-socket-mode

+
This is an n8n community node that lets you use Slack Socket Mode in your n8n workflows. It enables real-time event processing from Slack without requiring public URLs for webhooks.
Since the current integration of Slack in n8n only supports webhooks, this node allows you to use the Slack Socket Mode to listen to events in your Slack workspace in real-time, even in local development environments.
n8n is a fair-code licensed workflow automation platform.
Table of Contents
- Installation
- Slack App Setup
- Credentials
- Node Configuration
- Supported Events
- Usage Examples
- Example Workflow
- Compatibility
- Resources
- Version History
Installation
Follow the installation guide in the n8n community nodes documentation.
Using Bun (recommended):
bun add @mbakgun/n8n-nodes-slack-socket-mode
Using npm:
npm install @mbakgun/n8n-nodes-slack-socket-mode
After installation, restart n8n and the node will be available in the nodes panel.
Development Setup
This project uses Bun as its package manager. To set up your development environment:
Install Bun:
curl -fsSL https://bun.sh/install | bash
Install dependencies:
bun install
Build the project:
bun run build
Slack App Setup
Before using this node, you need to create a Slack app with Socket Mode enabled:
- Go to https://api.slack.com/apps and create a new app
- Navigate to "Socket Mode" in the left sidebar and enable it
- Generate an 'App-Level Token' with the
connections:write
scope - Go to "OAuth & Permissions" and add the following Bot Token Scopes:
app_mentions:read
channels:history
channels:read
chat:write
reactions:read
team:read
- (Add any other scopes required for your use case)
- Install the app to your workspace (This will generate a 'Bot User OAuth Token')
- Copy the Bot User OAuth Token, App-Level Token, and Signing Secret(from the 'Basic Information' section) for credential setup
- Go to 'Event Subscriptions' and enable 'Socket Mode'
- Subscribe to the events you want to listen to (e.g.
app_mention
,message
,reaction_removed
,reaction_added
)
Credentials
To use this node, you need to set up credentials with the following information:
- Bot Token: Your Slack Bot User OAuth Token (starts with
xoxb-
) - App-Level Token: Your Slack App-Level Token for Socket Mode (starts with
xapp-
) - Signing Secret: Your Slack App Signing Secret
These values can be found in your Slack App configuration.
Node Configuration
The Slack Socket Trigger node can be configured with the following options:
Trigger On: Select which Slack events should trigger your workflow:
- All Slack events are now supported (app_mention, message, reaction events, channel events, etc.)
- See the Supported Events section below for a complete list of available events
Regex Pattern: Optional regular expression to match against incoming Slack messages
Regex Flags: Flags for the regular expression (e.g.,
g
for global,i
for case-insensitive)
Supported Events
The node currently supports the following Slack events:
app_mention
: When your bot is mentioned in a channelblock_actions
: When a user interacts with buttons, including NPS-style ratingsmessage
: When a message is posted to a channel the app is added tochannel_created
: When a new public channel is createdteam_join
: When a new user is added to Slackreaction_added
: When a reaction is added to a messagereaction_removed
: When a reaction is removed from a messageapp_deleted
: User has deleted an appapp_home_opened
: User clicked into your App Homeapp_installed
: User has installed an appapp_mention
: Subscribe to only the message events that mention your app or botapp_rate_limited
: Indicates your app's event subscriptions are being rate limitedapp_requested
: User requested an appapp_uninstalled
: Your Slack app was uninstalledapp_uninstalled_team
: User has uninstalled an appassistant_thread_context_changed
: The context changed while an AI assistant thread was visibleassistant_thread_started
: An AI assistant thread was startedbot_added
: A bot user was addedbot_changed
: A bot user was changedcall_rejected
: A Call was rejectedchannel_archive
: A channel was archivedchannel_created
: A channel was createdchannel_deleted
: A channel was deletedchannel_history_changed
: Bulk updates were made to a channel's historychannel_id_changed
: A channel ID changedchannel_joined
: You joined a channelchannel_left
: You left a channelchannel_marked
: Your channel read marker was updatedchannel_rename
: A channel was renamedchannel_shared
: A channel has been shared with an external workspacechannel_unarchive
: A channel was unarchivedchannel_unshared
: A channel has been unshared with an external workspacecommands_changed
: A slash command has been added or changeddnd_updated
: Do not Disturb settings changed for the current userdnd_updated_user
: Do not Disturb settings changed for a memberemail_domain_changed
: The workspace email domain has changedemoji_changed
: A custom emoji has been added or changedexternal_org_migration_finished
: An enterprise grid migration has finished on an external workspaceexternal_org_migration_started
: An enterprise grid migration has started on an external workspacefile_change
: A file was changedfile_comment_added
: A file comment was addedfile_comment_deleted
: A file comment was deletedfile_comment_edited
: A file comment was editedfile_created
: A file was createdfile_deleted
: A file was deletedfile_public
: A file was made publicfile_shared
: A file was sharedfile_unshared
: A file was unsharedfunction_executed
: Your app function is executed as a step in a workflowgoodbye
: The server intends to close the connection soongrid_migration_finished
: An enterprise grid migration has finished on this workspacegrid_migration_started
: An enterprise grid migration has started on this workspacegroup_archive
: A private channel was archivedgroup_close
: You closed a private channelgroup_deleted
: A private channel was deletedgroup_history_changed
: Bulk updates were made to a private channel's historygroup_joined
: You joined a private channelgroup_left
: You left a private channelgroup_marked
: A private channel read marker was updatedgroup_open
: You created a group DMgroup_rename
: A private channel was renamedgroup_unarchive
: A private channel was unarchivedhello
: The client has successfully connected to the serverim_close
: You closed a DMim_created
: A DM was createdim_history_changed
: Bulk updates were made to a DM's historyim_marked
: A direct message read marker was updatedim_open
: You opened a DMinvite_requested
: User requested an invitelink_shared
: A message was posted containing one or more links relevant to your applicationmanual_presence_change
: You manually updated your presencemember_joined_channel
: A user joined a public channel, private channel or MPDMmember_left_channel
: A user left a public or private channelmessage
: A message was sent to a channelmessage.app_home
: A user sent a message to your Slack appmessage.channels
: A message was posted to a channelmessage.groups
: A message was posted to a private channelmessage.im
: A message was posted in a direct message channelmessage.mpim
: A message was posted in a multiparty direct message channelmessage_metadata_deleted
: Message metadata was deletedmessage_metadata_posted
: Message metadata was postedmessage_metadata_updated
: Message metadata was updatedpin_added
: A pin was added to a channelpin_removed
: A pin was removed from a channelpref_change
: You have updated your preferencespresence_change
: A member's presence changedpresence_query
: Determine the current presence status for a list of userspresence_sub
: Subscribe to presence events for the specified usersreaction_added
: A member has added an emoji reaction to an itemreaction_removed
: A member removed an emoji reactionreconnect_url
: Experimentalresources_added
: Access to a set of resources was granted for your appresources_removed
: Access to a set of resources was removed for your appscope_denied
: OAuth scopes were denied to your appscope_granted
: OAuth scopes were granted to your appshared_channel_invite_accepted
: A shared channel invite was acceptedshared_channel_invite_approved
: A shared channel invite was approvedshared_channel_invite_declined
: A shared channel invite was declinedshared_channel_invite_received
: A shared channel invite was sent to a Slack usershared_channel_invite_requested
: A shared channel invite was requestedstar_added
: A member has saved an item for later or starred an itemstar_removed
: A member has removed an item saved for later or starred an itemsubteam_created
: A User Group has been added to the workspacesubteam_members_changed
: The membership of an existing User Group has changedsubteam_self_added
: You have been added to a User Groupsubteam_self_removed
: You have been removed from a User Groupsubteam_updated
: An existing User Group has been updated or its members changedteam_access_granted
: Access to a set of teams was granted to your org appteam_access_revoked
: Access to a set of teams was revoked from your org appteam_domain_change
: The workspace domain has changedteam_join
: A new member has joinedteam_migration_started
: The workspace is being migrated between serversteam_plan_change
: The account billing plan has changedteam_pref_change
: A preference has been updatedteam_profile_change
: The workspace profile fields have been updatedteam_profile_delete
: The workspace profile fields have been deletedteam_profile_reorder
: The workspace profile fields have been reorderedteam_rename
: The workspace name has changedtokens_revoked
: API tokens for your app were revokedurl_verification
: Verifies ownership of an Events API Request URLuser_change
: A member's data has changeduser_resource_denied
: User resource was denied to your appuser_resource_granted
: User resource was granted to your appuser_resource_removed
: User resource was removed from your appuser_typing
: A channel member is typing a messageworkflow_deleted
: A workflow that contains a step supported by your app was deletedworkflow_published
: A workflow that contains a step supported by your app was publishedworkflow_step_deleted
: A workflow step supported by your app was removed from a workflowworkflow_step_execute
: A workflow step supported by your app should executeworkflow_unpublished
: A workflow that contains a step supported by your app was unpublished
Usage Examples
Respond to mentions
Configure the node to trigger on app_mention
events to make your workflow respond when someone mentions your bot.
Process messages matching a pattern
Use the Regex Pattern field to only trigger on messages that match a specific pattern:
- Pattern:
help|assist|support
- Flags:
i
This will trigger the workflow only when messages containing "help", "assist", or "support" (case-insensitive) are posted.
Monitor channel creation
Set the trigger to channel_created
to run workflows whenever a new channel is created in your workspace.
Example Workflow
Here's an example of a simple workflow that responds to Slack mentions:
[Slack Socket Trigger] → [JSON Parse] → [IF] → [HTTP Request] → [Slack]
- Slack Socket Trigger: Configured to trigger on app mentions
- JSON Parse: Extracts the message text and channel from the event data
- IF: Checks if the message contains certain keywords
- HTTP Request: Fetches relevant data based on the message
- Slack: Sends a response back to the channel
This workflow allows you to create a Slack bot that responds to mentions with data from external APIs, all without needing to expose your n8n instance to the internet.
Compatibility
- Requires n8n version 1.6.0 or later
- Tested against n8n versions 1.91.3
- Uses Bun as package manager for improved performance
Resources
- n8n community nodes documentation
- Slack API Documentation
- Slack Socket Mode Documentation
- Slack Events API Documentation
- Bun Documentation
Version History
- 1.2.0: Added support for all Slack events
- Updated to include all events from the Slack Events API
- Improved event descriptions and documentation
- 1.0.0: Initial release - Project initialized with Socket Mode support for Slack events
- Support for app_mention, message, reaction events
- Added button interaction support
License
MIT License
Copyright (c) 2025 Mehmet Burak Akgün
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.