Library/n8n/How to Set Up and Connect a Slack Bot to n8n (Step‑by‑Step Tutorial)
n8n

How to Set Up and Connect a Slack Bot to n8n (Step‑by‑Step Tutorial)

by Bradford Carlton - Automate Business AI

The video walks through creating a Slack app, generating a bot token and signing secret, configuring OAuth scopes and event subscriptions, installing the app to a workspace, and connecting the resulting credentials to n8n via a Slack Trigger node and a Slack Message node. It demonstrates how to test the workflow by sending a message to the bot in Slack and having n8n reply, while highlighting common pitfalls like missing scopes, wrong token types, and the need to invite the bot to channels.


How to Set Up and Connect a Slack Bot to n8n

Overview

This guide reproduces the exact steps shown in Bradford Carlton’s video "How to Set Up and Connect a Slack Bot to n8n". You’ll create a Slack app, configure it for bot usage, install it to your workspace, set up event subscriptions, and wire everything into an n8n workflow that responds to app_mention events.

Prerequisites

  • A Slack workspace where you have admin rights.
  • An n8n instance (self‑hosted or n8n Cloud).
  • Basic familiarity with the Slack API and n8n UI.

Step‑by‑Step Instructions

1. Create a Slack App

  1. Go to api.slack.com/apps and click Create New AppFrom scratch.
  2. Name the app (e.g., n8n Test Bot) and select your workspace.
  3. Click Create App.

2. Add Bot Token Scopes

  1. In the left sidebar, open OAuth & Permissions.
  2. Under Bot Token Scopes, click Add an OAuth Scope and add the following:
    • app_mentions:read
    • channels:history
    • channels:read
    • chat:write
    • files:read
    • files:write
    • groups:history
    • groups:read
    • im:history
    • im:read
    • mpim:history
    • mpim:read
    • reactions:read
    • reactions:write
  3. (Optional) Add any additional scopes you need for your workflow.

3. Install the App to Workspace

  1. Still in OAuth & Permissions, scroll to OAuth Tokens for Your Workspace.
  2. Click Install to Workspace and grant the requested permissions.
  3. Copy the Bot User OAuth Token (starts with xoxb-).
  4. Copy the Signing Secret from Basic InformationApp Credentials.

4. Configure Event Subscriptions

  1. In the Slack app, open Event Subscriptions.
  2. Toggle Enable Events to On.
  3. For Request URL, paste a placeholder for now (you’ll replace it with the n8n webhook later).
  4. Under Subscribe to bot events, add:
    • app_mention
    • message.channels
    • message.groups
    • message.im
  5. Save changes.

5. Create an n8n Workflow

  1. In n8n, click New Workflow.
  2. Add a Slack Trigger node.
    • Authentication: Create a new credential of type Slack OAuth2 API.
    • Client ID & Client Secret: Paste the values from your Slack app’s Basic Information.
    • Redirect URL: Copy the OAuth Callback URL shown in the credential and paste it into OAuth & PermissionsRedirect URLs.
    • Trigger on: app_mention.
  3. Add a Slack Message node (to reply).
    • Authentication: Create a new credential of type Slack using the Bot User OAuth Token.
    • Resource: Message.
    • Operation: Send.
    • Send Message To: Channel.
    • Channel: #n8n-test (or any channel the bot is invited to).
    • Message Text: {{ $json.text }} (or any custom response).
  4. Connect the Trigger to the Message node.
  5. Save the workflow and Activate it.

6. Wire the Webhook URL to Slack

  1. In the Slack Trigger node, copy the Webhook URL (the Production URL if the workflow is active).
  2. Return to your Slack app’s Event Subscriptions.
  3. Replace the placeholder Request URL with the copied webhook URL.
  4. Slack will verify the URL; once verified, the subscription is live.

7. Invite the Bot to a Channel

  1. In Slack, open the channel you chose in step 5.
  2. Type /invite @YourBotName and press Enter.

8. Test the Bot

  1. In the channel, type @YourBotName hello.
  2. The bot should respond with the message defined in the n8n workflow.

Tips & Gotchas

  • Wrong token type: Using an OAuth2 credential for the Slack Message node will send from your personal account, not the bot. Use the Bot User OAuth Token instead.
  • Token rotation: If you enable token rotation in Slack, the xoxb- token will expire after 12 h. Disable it during setup.
  • Channel invitation: The bot cannot post to a channel it isn’t invited to; use /invite.
  • Testing vs Production URLs: While testing, use the Test URL from the Trigger node and keep Slack pointing to it. When you activate the workflow, switch to the Production URL in Slack.
  • Event verification: Slack will immediately ping the webhook URL; if it fails, check that the workflow is active and the URL is correct.
  • Avoid loops: If the bot replies to its own messages, you’ll get an endless loop. Exclude the bot’s user ID in the Trigger on field or filter in the workflow.

This markdown guide mirrors the exact sequence demonstrated in the video, ensuring that anyone following it will replicate the same working Slack bot integrated with n8n.

This guide was generated by an AI agent based on the video above. Always verify steps against the original source.Watch on YouTube ↗

More n8n guides

See all n8n guides →
Telegram Expense Tracker using n8n + Google Sheets (Step-by-Step)
n8n

Telegram Expense Tracker using n8n + Google Sheets (Step-by-Step)

Tech Area

Telegram Expense Tracker using n8n + Google Sheets (Step-by-Step) from Tech Area. Learn how to build a simple and powerful expense tracker using Telegram, Google Sheets, and n8n in this beginner-friendly ...

N8N daily expenses with telegram and supabase #ai #kopianan #n8n #supabase #telegram #bot
n8n

N8N daily expenses with telegram and supabase #ai #kopianan #n8n #supabase #telegram #bot

kopianan

N8N daily expenses with telegram and supabase #ai #kopianan #n8n #supabase #telegram #bot from kopianan. A practical n8n tutorial indexed from YouTube.

This AI Agent can help you with money management #ai #n8n #workflow #aiagents
n8n

This AI Agent can help you with money management #ai #n8n #workflow #aiagents

Bernard | AI Automation

This AI Agent can help you with money management #ai #n8n #workflow #aiagents from Bernard | AI Automation. A practical n8n tutorial indexed from YouTube.

Zapier vs n8n: The Truth No One Tells You
n8n

Zapier vs n8n: The Truth No One Tells You

Kevin Stratvert

Zapier vs n8n: The Truth No One Tells You from Kevin Stratvert. n8n is getting a lot of attention, but does it really beat Zapier? In this short breakdown, I compare both tools side-by-side — setup, ...

How We Automate Receipt Tracking with n8n
n8n

How We Automate Receipt Tracking with n8n

Linkeli LTD

How We Automate Receipt Tracking with n8n from Linkeli LTD. We built a zero-touch receipt tracker using n8n, OCR, and AI. Here's how it works—step by step, with real-world tools.

Automação Financeira com n8n e Gemini: Passo a Passo
n8n

Automação Financeira com n8n e Gemini: Passo a Passo

Programação Dinâmica

Automação Financeira com n8n e Gemini: Passo a Passo from Programação Dinâmica. Automatizei meu registro de gastos com n8n, mensagens de voz no Telegram viram entradas no Notion. Veja como essa ...

Browse other AI tools