DEV Community

Pirate Prentice
Pirate Prentice

Posted on

n8n Discord Node: Send Messages, Manage Channels, and Build Bots in Your Workflows [Free Workflow JSON]

The n8n Discord node lets you send messages, manage channels and roles, react to events with the Discord Trigger, and build full Discord bots—all without writing a bot framework from scratch. This guide covers every operation, the credential setup that trips most people up, and three production-ready workflow patterns you can import today.

Free workflow JSON for a Discord notification bot is included at the end.


Why Use the Discord Node?

Discord has 500M+ registered accounts and is the default community platform for developer tools, crypto projects, gaming, and SaaS products. If your product has a Discord server—or your team uses one—the n8n Discord node lets you:

  • Send automated alerts and digests to channels
  • DM users for onboarding or support events
  • React to slash commands and mentions
  • Manage roles for access-gating and onboarding
  • Bridge Discord to any other service in your n8n stack

Credential Setup

The Discord node uses a bot token, not OAuth2. You must create a Discord application and bot.

Steps:

  1. Go to discord.com/developers/applicationsNew Application
  2. Go to BotAdd Bot → copy the Token
  3. Under Privileged Gateway Intents, enable Server Members Intent and Message Content Intent if your workflow reads messages
  4. Go to OAuth2 → URL Generator: select bot scope + permissions your workflow needs (Send Messages, Manage Roles, etc.)
  5. Open the generated URL to invite the bot to your server
  6. In n8n → Credentials → Discord API → paste the bot token

Common gotcha: The bot must be a member of the server AND have the correct channel-level permissions. A bot with Send Messages at the server level can still be blocked by channel permission overwrites.


Discord Node: All Operations

Message Operations

Operation What It Does
Send Post a message to a channel (text, embeds, files)
Delete Remove a message by ID
Get Fetch a single message
Get Many Fetch multiple messages (up to 100)
React Add an emoji reaction to a message
Pin Pin a message in a channel

Channel Operations

Operation What It Does
Create Create a text, voice, or category channel
Delete Delete a channel
Get Fetch channel details
Get Many List channels in a server
Update Rename, set topic, slow-mode, etc.

Member / Role Operations

Operation What It Does
Get Fetch a member's details
Get Many List server members
Add Role Assign a role to a member
Remove Role Remove a role from a member
Ban Ban a user from the server
Kick Kick a user from the server

Server Operations

Operation What It Does
Get Fetch server (guild) metadata

Discord Trigger Node

The Discord Trigger node listens for real-time gateway events. Add it as the first node of a workflow to react to:

  • MESSAGE_CREATE — every new message in monitored channels
  • INTERACTION_CREATE — slash commands and button clicks
  • GUILD_MEMBER_ADD / GUILD_MEMBER_REMOVE — member join/leave
  • GUILD_MEMBER_UPDATE — role or nickname changes
  • REACTION_ADD — emoji reactions

Important: The Discord Trigger requires a persistent connection to Discord's gateway. This works in n8n Cloud and self-hosted setups, but the workflow must be active (not just saved).


Key Fields When Sending Messages

Server ID (Guild ID): Right-click your server name in Discord → Copy Server ID. (Enable Developer Mode in Discord settings first.)

Channel ID: Right-click the channel → Copy Channel ID.

Content vs Embeds: Use content for plain text. Use Embed for rich cards with titles, descriptions, fields, colors, and images.

Message Reference: To reply to an existing message, set Message Reference → Message ID to the parent message's ID.


Gotchas

Problem Fix
"Missing Permissions" error Bot doesn't have the required permission in that channel—check channel permission overwrites, not just server-level
Trigger doesn't fire Workflow must be active, not just saved; gateway connection requires the workflow to be running
Message Content Intent not enabled Enable it in the Developer Portal under Bot → Privileged Gateway Intents or MESSAGE_CREATE payloads arrive with empty content
Embed not rendering Discord enforces embed limits: title ≤ 256 chars, description ≤ 4096 chars, total ≤ 6000 chars across all fields
Rate limits Discord enforces per-route rate limits (e.g., 5 msg/5s per channel); add a Wait node (1–2 seconds) in loops to avoid 429s
Bot can't DM user User must share a server with the bot AND have DMs from server members enabled
Slash commands not showing Slash commands must be registered via the Discord API; the n8n Discord node handles messages, not command registration

3 Production-Ready Patterns

Pattern 1: Stripe Payment → Discord Alert

Trigger your team's Discord channel instantly when a new Stripe payment lands.

Workflow:

Stripe Trigger (checkout.session.completed)
  → Discord: Send Message
    Channel: #payments
    Content: 💰 New payment: {{$json.amount_total / 100}} {{$json.currency.toUpperCase()}} from {{$json.customer_details.name}}
Enter fullscreen mode Exit fullscreen mode

Why it works: The Stripe Trigger fires synchronously; the Discord message lands in seconds. No polling, no delay.

Add: An IF node to only alert on amounts > $100 to reduce noise.


Pattern 2: New Member Welcome Bot

DM every new server member with an onboarding message and assign a role.

Workflow:

Discord Trigger (GUILD_MEMBER_ADD)
  → Discord: Send Message (DM to new member)
    Content: Welcome to the server! Here's what to do first: ...
  → Discord: Add Role
    Role: Newcomer
    User: {{$json.user.id}}
Enter fullscreen mode Exit fullscreen mode

Why it works: GUILD_MEMBER_ADD fires immediately on join. The DM + role assignment runs in under a second with no manual moderator action needed.

Gotcha: The bot must have Manage Roles permission and its role must be higher in the hierarchy than the role it assigns.


Pattern 3: Keyword Alert Monitor

Watch a high-volume channel for mentions of keywords (competitor names, bug reports, your product name) and route matches to a Slack channel or email.

Workflow:

Discord Trigger (MESSAGE_CREATE)
  → IF: content contains any of ["outage", "bug", "broken", "error"]
      True → Slack: Send Message
               Channel: #alerts
               Text: Discord alert in #{{$json.channel_id}}: {{$json.content}}
      False → NoOp
Enter fullscreen mode Exit fullscreen mode

Why it works: The trigger fires on every message; the IF filters to only the ones that matter. You can extend the keyword list with a Code node using regex for more flexible matching.

Extend: Add a Google Sheets node to log every match for trend analysis.


Free Workflow JSON: Discord Notification Bot

This workflow sends a formatted embed to a Discord channel on a schedule—useful for daily digests, status updates, or metric summaries.

{
  "name": "Discord Daily Digest Bot",
  "nodes": [
    {
      "parameters": {
        "rule": { "interval": [{ "field": "hours", "hoursInterval": 24 }] }
      },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [200, 300]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "send",
        "guildId": "YOUR_SERVER_ID",
        "channelId": "YOUR_CHANNEL_ID",
        "content": "",
        "embeds": {
          "values": [
            {
              "title": "Daily Digest — {{ $now.toFormat('LLL dd, yyyy') }}",
              "description": "Here's what happened today. Replace this with your data source.",
              "color": 5814783,
              "fields": {
                "values": [
                  { "name": "New signups", "value": "42", "inline": true },
                  { "name": "Revenue", "value": "$1,280", "inline": true },
                  { "name": "Support tickets", "value": "7 open", "inline": false }
                ]
              }
            }
          ]
        }
      },
      "name": "Discord: Send Digest",
      "type": "n8n-nodes-base.discord",
      "position": [420, 300],
      "credentials": { "discordApi": { "name": "Discord Bot" } }
    }
  ],
  "connections": {
    "Schedule Trigger": { "main": [[{ "node": "Discord: Send Digest", "type": "main", "index": 0 }]] }
  }
}
Enter fullscreen mode Exit fullscreen mode

To use: Replace YOUR_SERVER_ID and YOUR_CHANNEL_ID with your server's IDs, connect your Discord Bot credential, and wire in a real data source (HTTP Request, Google Sheets, database) to replace the static field values.


Discord Node vs Webhook vs Slash Commands

Approach Best For
Discord Node (bot token) Sending messages, managing roles/channels, DMs
Discord Trigger Reacting to events (messages, joins, reactions)
Webhook (incoming) One-way posting without a bot (simpler setup, no trigger)
Slash commands Interactive user-initiated commands (requires separate registration)

For most automation use cases—alerts, digests, notifications—the Discord node + bot token is the right choice. Use an incoming webhook (HTTP Request node → Discord webhook URL) only if you want the simplest possible one-way push without managing a bot.


Build Your First Discord Automation

The Discord node covers every common automation pattern: alerts, onboarding, moderation, and monitoring. The key steps are always the same—create a bot, set the right permissions, grab server and channel IDs, then chain whatever trigger and data source makes sense for your workflow.

The n8n Workflow Starter Pack bundles pre-built workflow JSON files for Discord and 20+ other integrations so you can skip the setup and start from a working base.

👉 Get the n8n Workflow Starter Pack ($29)

Drop your Discord automation use case in the comments—I'd love to hear what you're building.

Top comments (0)