How to Connect Slack to N8N (2025) (Step-by-Step)

N8n is a powerful, open-source AI automation platform that lets you build complex workflows using a simple drag-and-drop interface. By connecting it to Slack, you can send automated notifications, create chatbot interactions, and trigger workflows directly from your channels.

We’ll cover three key integrations:

  1. Sending messages via a Slack Bot.
  2. Setting up a trigger for when someone mentions your bot.
  3. BONUS: Sending messages as yourself using OAuth.

Let’s dive in!


Prerequisites

Before you start, make sure you have:

  • An N8n instance running (cloud or self-hosted).
  • Admin/owner access to a Slack workspace.

Part 1: Sending a Message via a Slack Bot

This is the most common use case: having an N8n workflow send a notification to a Slack channel or user via a custom bot.

Step 1: Create a Slack App

  1. Go to api.slack.com/apps and click “Create New App.”
  2. Choose “From scratch.”
  3. Give your app a name (e.g., N8n Tutorial Bot) and select the workspace you want to install it to.

Step 2: Configure Bot Permissions (OAuth Scopes)

  1. In the left sidebar of your app’s configuration, navigate to “OAuth & Permissions.”
  2. Scroll down to “Bot Token Scopes” and click “Add an OAuth Scope.”
  3. For sending messages, you need at least the chat:write scope. This allows your bot to send messages.
  4. To send messages to specific users, you also need the users:read scope. This allows the bot to see the list of users in the workspace. Add this scope as well.

Step 3: Install the App to Your Workspace

  1. Scroll back to the top of the “OAuth & Permissions” page and click “Install to Workspace.”
  2. Click “Allow” to install the app with the permissions you selected.

Step 4: Copy the Bot User OAuth Token

After installation, you’ll land back on the “OAuth & Permissions” page. You will see a “Bot User OAuth Token” (starts with xoxb-). Copy this token. This is the key that allows N8n to act as your bot.

Step 5: Configure the Slack Node in N8n

  1. In your N8n workflow, add a Slack node.
  2. Click on the “Credentials” dropdown and then “Create New.”
  3. Choose “Access Token” as the method.
  4. Paste the Bot User OAuth Token you copied in the previous step. Name the credential (e.g., My Slack Bot) and save it.
  5. Back in the node configuration, select the “Send Message” action.
  6. Choose the channel or user you want to send the message to. You can now search for users because we added the users:read scope.
  7. Type your test message (e.g., “Hello from N8n!”) and click “Execute Node.”

✅ Success! You should receive a direct message from your bot in Slack. Your N8n workflow can now send automated notifications.


Part 2: Setting Up a Trigger (Bot Mention)

Now, let’s make it interactive. We’ll set up a trigger that activates an N8n workflow whenever someone mentions your bot.

Step 1: Add a Slack Trigger Node

  1. In your N8n workflow, add a new node and search for Slack Trigger.
  2. Select the trigger “On Bot Mention.” This means the workflow will start whenever your bot is tagged with an @.

Step 2: Configure the Webhook URL

  1. After adding the trigger node, a Webhook URL will be generated. Copy this URL.
    • Important: Use the Test URL while building your workflow. Use the Production URL after you activate it.
  2. Go back to your Slack app settings on api.slack.com/apps and navigate to “Event Subscriptions.”
  3. Toggle “Enable Events” to On.
  4. Paste your N8n Webhook URL into the “Request URL” field. Slack will automatically try to verify it. If it fails, click “Execute Node” in N8n and then “Retry” in Slack. It should then verify successfully.

Step 3: Subscribe to Bot Events

  1. Once the URL is verified, scroll down to “Subscribe to bot events.”
  2. Click “Add Bot User Event” and select app_mention. This tells Slack to notify your webhook whenever the bot is mentioned.
  3. Click “Save Changes.”

Step 4: Test the Trigger

  1. Invite your bot to a Slack channel by typing @YourBotName.
  2. Activate your N8n workflow.
  3. Go to the channel and mention your bot with a message like, “@N8nBot hello!
  4. The N8n trigger node should activate, and you’ll see the message data in N8n. You can now connect other nodes to process the message and perform actions!

Part 3: BONUS – Sending Messages as Yourself (OAuth2)

What if you want N8n to send a message that appears to come from you, not the bot? This is useful for automating messages you would personally send.

Step 1: Create New OAuth2 Credentials in N8n

  1. In a Slack node, go to Credentials and click “Create New.”
  2. This time, select “OAuth2 API” as the method.
  3. You will need your app’s Client ID and Client Secret, found under “Basic Information” in your Slack app settings.

Step 2: Configure Your Slack App

  1. In your Slack app, go to “OAuth & Permissions.”
  2. In the “Redirect URLs” section, add the OAuth callback URL provided by N8n when you create the credential. Click “Add” and “Save URLs.”

Step 3: Authenticate and Connect

  1. Back in N8n, after entering the Client ID and Secret, click “Connect OAuth2 Account” or “Save”. A pop-up window will appear.
  2. Authorize the app to access your Slack workspace as you.
  3. Once authorized, your credential is ready.

Step 4: Send a Message as a User

  1. In your Slack node, select the new OAuth2 credential.
  2. Choose the “Send Message” action and select a recipient.
  3. Execute the node. The message will now be sent from your personal Slack account.

Conclusion

Congratulations! You’ve successfully connected N8n and Slack. You now know how to:

  • Send automated messages via a Slack bot.
  • Trigger workflows from Slack mentions.
  • Send messages as yourself for personal automation.

This opens up a world of possibilities: error alerts from your workflows, automated status reports, customer support triage, and much more.

5/5 - (5 votes)

About

Leave a Comment

Your email address will not be published. Required fields are marked *