Back to n8n Fundamentals
n8n Fundamentals

How to Connect Slack to n8n

Slack app creation, OAuth, channel messaging node setup.

How to Connect Slack to n8n

Connecting Slack to n8n requires three components: a Slack app with proper OAuth scopes, a bot token, and a configured credential in n8n. This guide walks through the complete setup, including the exact scopes you need and how to troubleshoot common authentication failures.

What You Need Before Starting

You need admin access to your Slack workspace and an n8n instance (cloud or self-hosted). If you're on Slack's free plan, you can still create apps - there's no paid tier requirement for API access.

For n8n, you need either an n8n Cloud account or a self-hosted instance running version 0.180.0 or later. Earlier versions have a different OAuth flow that's deprecated.

Create Your Slack App

Navigate to https://api.slack.com/apps and click "Create New App."

Step 1: Select "From scratch" (not "From an app manifest"). The manifest option is for advanced users who already know their exact configuration.

Step 2: Name your app something specific to its function. Use "n8n Workflow Bot" or "Client Intake Notifications" instead of generic names like "Integration" or "Bot."

Step 3: Select your workspace from the dropdown. This is the workspace where the app will be installed. You can add it to additional workspaces later, but start with one.

Step 4: Click "Create App."

Configure OAuth Scopes

Scopes determine what your bot can do. Too few scopes and your workflows fail. Too many and you create unnecessary security exposure.

Step 1: In the left sidebar, click "OAuth & Permissions."

Step 2: Scroll to "Scopes" and click "Add an OAuth Scope" under "Bot Token Scopes" (not User Token Scopes).

Step 3: Add these scopes based on what you need:

For sending messages:

  • chat:write - Post messages to channels
  • chat:write.public - Post to channels without joining them first

For reading messages:

  • channels:history - Read messages from public channels
  • channels:read - View basic channel information

For user lookups:

  • users:read - Access user profile information
  • users:read.email - Read user email addresses (only if you need to match users to your CRM
    )

For file operations:

  • files:write - Upload files to Slack
  • files:read - Download files from Slack

For reactions:

  • reactions:write - Add emoji reactions to messages

Do not add scopes you don't need. If you're only sending notifications, you only need chat:write and chat:write.public.

Install the App and Get Your Token

Step 1: Scroll to the top of the "OAuth & Permissions" page and click "Install to Workspace."

Step 2: Review the permissions screen and click "Allow."

Step 3: Copy the "Bot User OAuth Token" that appears. It starts with xoxb-. Store this in your password manager immediately - you'll need it in n8n.

Step 4: Do not share this token. It has full access to your Slack workspace within the scopes you defined. Treat it like a password.

Add Slack Credentials in n8n

Step 1: Open your n8n instance and go to "Credentials" in the left sidebar (or navigate to Settings > Credentials if you're on an older version).

Step 2: Click "Add Credential" and search for "Slack."

Step 3: Select "Slack OAuth2 API

" (not "Slack API
" - that's the legacy credential type).

Step 4: Fill in the credential fields:

  • Credential Name: Use something descriptive like "Slack - Main Workspace" or "Slack - Client Notifications"
  • Access Token: Paste your xoxb- token from Slack
  • Slack Subdomain: This is optional. Leave it blank unless you're using Slack Enterprise Grid with multiple workspaces.

Step 5: Click "Save."

n8n will test the connection automatically. If you see a green checkmark, you're connected. If you see an error, verify your token is correct and hasn't been regenerated in Slack.

Build Your First Slack Workflow

Here's a complete workflow that posts a message when a new row appears in a Google Sheet. This pattern works for any trigger - swap the Google Sheets node for Typeform, Airtable, webhooks

, or scheduled triggers.

Step 1: Create a new workflow in n8n.

Step 2: Add a "Google Sheets Trigger" node (or your preferred trigger).

Step 3: Configure the trigger to watch a specific sheet. For Google Sheets, you'll need to authenticate with Google and select your spreadsheet.

Step 4: Add a "Slack" node and connect it to your trigger.

Step 5: Configure the Slack node:

  • Credential: Select the Slack credential you created earlier
  • Resource: Message
  • Operation: Post
  • Channel: Enter the channel ID or name. Use #general or C01234ABCDE (the channel ID from Slack's URL)
  • Text: Click the "Expression" toggle and build your message using data from the trigger

Example message expression:

New client intake form submitted:

Name: `{{ $json.name }}`
Email: `{{ $json.email }}`
Service: `{{ $json.service_requested }}`

View full details: `{{ $json.sheet_url }}`

Step 6: Click "Execute Node" to test. Check your Slack channel for the message.

Step 7: Save and activate the workflow.

Use Channel IDs Instead of Names

Channel names can change. Channel IDs cannot. For production workflows, always use channel IDs.

To find a channel ID:

Step 1: Open Slack in your browser (not the desktop app).

Step 2: Navigate to the channel.

Step 3: Look at the URL. It will be https://yourworkspace.slack.com/archives/C01234ABCDE

Step 4: Copy the part after /archives/ - that's your channel ID.

Step 5: In n8n, paste the channel ID directly into the Channel field. No # symbol needed.

Send Direct Messages to Users

To send a DM, you need the user's Slack ID, not their email or display name.

Step 1: In your Slack node, set the Channel field to the user's ID. User IDs start with U (like U01234ABCDE).

To find a user ID:

Step 1: Click on the user's profile in Slack.

Step 2: Click "More" (three dots).

Step 3: Click "Copy member ID."

For dynamic user lookups:

Add a "Slack" node before your message node. Set Resource to "User" and Operation to "Get" or "Get by Email." This returns the user ID, which you can pass to your message node using {{ $json.id }}.

Format Messages with Block Kit

Plain text messages work, but Block Kit messages look professional and support buttons, images, and structured layouts.

Step 1: In your Slack node, change "Text" to "Blocks."

Step 2: Use Slack's Block Kit Builder (https://app.slack.com/block-kit-builder) to design your message visually.

Step 3: Copy the JSON from the Block Kit Builder.

Step 4: Paste it into the "Blocks" field in n8n. Toggle to "Expression" mode if you need to inject dynamic data.

Example Block Kit message:

[
  {
    "type": "section",
    "text": {
      "type": "mrkdwn",
      "text": "*New Lead Captured*\n`{{ $json.name }}` from `{{ $json.company }}`"
    }
  },
  {
    "type": "section",
    "fields": [
      {
        "type": "mrkdwn",
        "text": "*Email:*\n`{{ $json.email }}`"
      },
      {
        "type": "mrkdwn",
        "text": "*Phone:*\n`{{ $json.phone }}`"
      }
    ]
  }
]

Fix Common Authentication Errors

Error: "not_in_channel"

Your bot isn't a member of the channel. Either add the bot manually (/invite @YourBotName) or use the chat:write.public scope to post without joining.

Error: "invalid_auth"

Your token is wrong or expired. Go back to Slack's "OAuth & Permissions" page and verify the token matches what's in n8n. If you regenerated the token in Slack, update it in n8n.

Error: "missing_scope"

You're trying to perform an action your bot doesn't have permission for. Check the error message for the required scope, add it in Slack's app settings, then reinstall the app to your workspace.

Error: "channel_not_found"

The channel ID or name is incorrect. Verify the channel exists and your bot has access to it. Private channels require explicit invitation.

Store Tokens Securely

Never hardcode tokens in workflow nodes. Always use n8n's credential system.

For self-hosted n8n, set the N8N_ENCRYPTION_KEY environment variable to encrypt credentials at rest. Without this, credentials are stored in plain text in your database.

For multi-environment setups (dev, staging, production), create separate Slack apps for each environment. Use different tokens so a compromised dev token can't access production channels.

Monitor Rate Limits

Slack's API

has rate limits: 1 request per second per method for most endpoints. If you're sending high-volume messages, add a "Wait" node between iterations or batch messages using Slack's chat.postMessage with multiple blocks.

For workflows that trigger frequently, consider aggregating notifications. Instead of sending 50 individual messages, collect data for 5 minutes and send one summary message.

Revenue Institute

Reviewed by Revenue Institute

This guide is actively maintained and reviewed by the implementation experts at Revenue Institute. As the creators of The AI Workforce Playbook, we test and deploy these exact frameworks for professional services firms scaling without new headcount.

Revenue Institute

Need help turning this guide into reality? Revenue Institute builds and implements the AI workforce for professional services firms.

RevenueInstitute.com