Build a Discord Bot with n8n: No-Code Tutorial (2026)

Discord bots used to require Python, JavaScript, and a dedicated server to run on. Not anymore. With n8n, you can build a sophisticated, production-ready Discord bot using a visual workflow editor — no backend code, no deployment headaches — in under an hour.

This tutorial covers everything from connecting Discord to n8n, to building the six most useful bot workflows, to best practices that keep your bot running reliably 24/7.

Don’t have n8n yet? Start your free 14-day n8n Cloud trial — no credit card needed.

Why Build a Discord Bot with n8n?

Building a Discord bot from scratch the traditional way means setting up a Node.js or Python project, registering slash commands via the Discord API, deploying to a VPS or cloud function, and maintaining the infrastructure indefinitely. Every new feature requires writing more code and updating the deployment.

n8n eliminates all of that friction. You get:

  • A native Discord node that handles authentication and the most common operations out of the box.
  • A Webhook node to receive real-time events from Discord (messages, member joins, reactions).
  • Connections to 400+ other services — OpenAI, Google Calendar, Notion, Slack, databases — without writing integration code.
  • Visual debugging: see exactly where a workflow fails and fix it without reading stack traces.

The result is a Discord bot that would take days to build in code, built in an afternoon in n8n.

Step 1: Create Your Discord Application and Bot

Before you touch n8n, you need a Discord bot account. Here is the exact process:

Register the Application

  1. Go to the Discord Developer Portal at https://discord.com/developers/applications.
  2. Click New Application and give it a descriptive name (e.g., “n8n Community Bot”).
  3. In the left sidebar, click Bot.
  4. Click Add Bot and confirm.
  5. Under Token, click Reset Token and copy the bot token. You will paste this into n8n. Keep it private — anyone with this token controls your bot.

Set the Required Intents

For your bot to read messages and see new members, you must enable the correct Gateway Intents in the Bot settings:

  • Server Members Intent: Required to detect when someone joins your server.
  • Message Content Intent: Required to read the content of messages (not just metadata). Note: bots in 100+ servers need Discord verification to use this intent.

Invite the Bot to Your Server

  1. In the Developer Portal, go to OAuth2 → URL Generator.
  2. Under Scopes, select bot and applications.commands.
  3. Under Bot Permissions, select the permissions your bot needs (Send Messages, Manage Messages, Read Message History at minimum).
  4. Copy the generated URL, open it in a browser, and add the bot to your server.

Step 2: Connect Discord to n8n

  1. In n8n, go to Credentials → New Credential → Discord.
  2. Paste your bot token in the Bot Token field.
  3. Test the credential with a simple Send Message action to a channel. Paste a channel ID (right-click any channel in Discord with Developer Mode enabled → Copy Channel ID) and send a test message.
  4. If the message appears in Discord, your connection is working.

6 Discord Bot Workflows to Build with n8n

1. Welcome New Members with a Personalized DM

First impressions matter. This workflow automatically sends every new server member a personalized welcome direct message the moment they join.

Workflow structure:

  1. Trigger: Discord Webhook → Member Join event
  2. Extract the new member’s username and ID from the event payload.
  3. Send a personalized DM: “Welcome to [Server Name], @username! Here are the channels to start with: [links]. Drop a message in #introductions and say hi.”
  4. Post a welcome message in your #welcome channel tagging the new member.
  5. Optionally: assign a “New Member” role via the Discord API (HTTP Request node).

2. AI-Powered Message Moderation

This is one of the most powerful bots you can build with n8n. Instead of keyword-based moderation (which bad actors easily bypass), use AI to understand the intent of messages.

Workflow structure:

  1. Trigger: Discord Webhook → Message Created
  2. Filter out messages from bots and moderators (check roles).
  3. Send the message content to OpenAI with a system prompt: “Classify this message as: safe, spam, toxic, or off-topic. Reply with a JSON object with keys: label, confidence, reason.”
  4. If label is “toxic” or “spam” with confidence above 0.85:
    • Delete the message using the Discord API.
    • Send the user a warning DM explaining what was removed and why.
    • Log the incident in a Google Sheet or Airtable.
    • If this is the user’s third offense: notify a human moderator in a private #mod-alerts channel.

3. AI Customer Support Bot

For SaaS products and communities built around a tool or service, this workflow creates a bot that answers common support questions using your documentation as context.

Workflow structure:

  1. Trigger: Discord Webhook → Message Created in #support channel (or when the bot is @mentioned)
  2. Fetch the relevant documentation from Notion, a Google Doc, or a plain text file stored in n8n’s static data.
  3. Send the user’s question plus the documentation context to OpenAI.
  4. Post the AI’s answer in the channel as a reply to the original message, using Discord’s reply threading feature.
  5. If the AI response includes “I don’t know” or confidence is low: tag a human support agent in the thread.

4. Daily Digest Summarizer

Busy servers generate hundreds of messages per day. This workflow automatically summarizes the most important discussions and posts a daily digest, so members who missed the day can catch up in under 2 minutes.

Workflow structure:

  1. Trigger: Schedule (every day at 6 PM)
  2. Fetch the last 200 messages from each active channel via the Discord API.
  3. Filter out bot messages, links-only messages, and short acknowledgements.
  4. Send the filtered content to OpenAI with a prompt: “Summarize the key discussions, decisions, and announcements from these messages in bullet points.”
  5. Post the formatted digest in a dedicated #daily-digest channel.

5. Price Alert Bot for Crypto or Stocks

This workflow monitors asset prices from an external API and posts alerts to Discord when a configured threshold is crossed.

Workflow structure:

  1. Trigger: Schedule (every 5 minutes)
  2. Fetch current prices from CoinGecko (crypto) or Alpha Vantage (stocks) via HTTP Request node.
  3. Compare against stored threshold values (stored in n8n’s static data or a Google Sheet).
  4. If a threshold is crossed: post a formatted alert to the #price-alerts channel with the asset name, current price, threshold, and percentage change.
  5. Use a cooldown flag to prevent the same alert from firing multiple times in a row.

6. Google Calendar Event Reminders

This workflow syncs your server’s event schedule from Google Calendar and sends automated reminders to a designated Discord channel at 24 hours, 1 hour, and 5 minutes before each event.

Workflow structure:

  1. Trigger: Schedule (every 5 minutes)
  2. Fetch upcoming events from Google Calendar for the next 25 hours.
  3. Check which events are at the 24h, 1h, or 5min mark (comparing event start time to current time).
  4. For each match: post a reminder to #events with the event name, time, and a join link.
  5. Log sent reminders in n8n’s static data to avoid duplicate messages.

Handling Discord’s Rate Limits

Discord enforces rate limits on a per-route basis. Most routes allow 5 requests per second; some allow more or less. For bots that send many messages in a short window (like a bulk moderation action), use n8n’s Wait node to add a deliberate pause between API calls and avoid hitting the limit.

For read operations (fetching message history, listing members), Discord allows up to 50 requests per second globally. n8n’s HTTP Request node respects these limits automatically when you enable rate limit handling in the node settings.

Slash Commands: Registering Them Once

The Discord node in n8n does not natively register slash commands (the /command style inputs). To add slash commands to your bot, you need to register them once via the Discord REST API — you can do this directly from n8n using an HTTP Request node pointed at https://discord.com/api/v10/applications/{application_id}/commands. After registration, n8n handles the incoming slash command events via a Webhook trigger the same way it handles regular messages.

Self-Hosting vs. n8n Cloud for Discord Bots

If you are running n8n self-hosted on a VPS, your Discord bot workflows run as long as n8n is running. Use PM2 or Docker restart policies (--restart=always) to ensure n8n restarts automatically if the server reboots.

For most teams, n8n Cloud is the easier option: managed uptime, automatic updates, and no infrastructure to maintain. Your bot workflows run on n8n’s servers around the clock without you touching a server.

Security Best Practices

  • Store your Discord bot token exclusively in n8n’s Credentials manager. Never paste it directly into a workflow node.
  • Scope bot permissions to the minimum required. If a workflow only reads messages, do not grant the bot Manage Server permissions.
  • For AI-powered bots, implement a per-user rate limit (e.g., max 10 AI queries per hour) to prevent abuse and runaway API costs. Store counters in n8n’s static data or a Redis instance.
  • Test every new workflow in a private “bot-testing” channel before deploying it to public channels.

Build Your Discord Bot Today

A Discord bot that welcomes members, moderates content with AI, answers support questions, and sends reminders would take a developer days to build in code. With n8n, you can have all of that running in an afternoon — and modify any part of it without touching code.

The real advantage of n8n for Discord automation is the ability to chain Discord actions with any other service: post a Discord message when a Stripe payment fails, sync Discord member data to a CRM, or trigger a workflow from a Discord slash command that updates a Notion database. The possibilities are only limited by your imagination.

If you are ready to build your first Discord bot workflow, start your free n8n Cloud trial here. No credit card required.

This article contains affiliate links. If you sign up through them, we receive a commission at no extra cost to you.