If you're looking for a way to automate community management, send alerts, or trigger AI agents from Discord messages, then the n8n Discord integration opens up powerful workflow possibilities. Whether you're building a bot that filters messages, runs commands, or connects Discord to other tools like Google Sheets, Airtable, or OpenAI, n8n gives you full flexibility with no-code configuration but endless extensibility.
Let’s walk through how to set up a Discord bot inside n8n, listen for messages or slash commands, and send automated responses or trigger external actions—all without writing code.
Why Use n8n for Discord Workflows?
Discord already supports bots built with JavaScript or Python, but creating and hosting your own code can be time-consuming. With n8n:
- You can visually build workflows without coding
- Easily connect to third-party services
- Self-host for full data control or use the hosted version
- Use community nodes or create your own for advanced use
Whether you're managing a gaming server or coordinating a remote team via Discord, the n8n Discord integration makes your bot logic dynamic and maintainable.
Prerequisites Before You Start
Before building the workflow in n8n, you’ll need to set up a Discord bot and get the necessary credentials.
Create a Bot in Discord
- Go to the Discord Developer Portal and click “New Application.”
- Name it, click “Bot” in the sidebar, then “Add Bot.”
- Copy the bot TOKEN — you’ll need this for n8n.
- Under “OAuth2 → URL Generator,” select:
botandapplications.commandsscopes- Bot permissions like
Send Messages,Read Message History, orManage Webhooks
- Copy the generated URL, paste it into your browser, and add the bot to your desired server.
Set Up Your Webhook or Gateway
Depending on your use case, you can receive messages through:
- Webhooks: Fast and simple for sending messages, but not great for listening.
- Gateway connection: For listening to events like message creation, you’ll need a gateway bot node.
n8n supports both via custom or community nodes.
We’ll go with the Webhook + Bot Token combo for sending messages and using a custom setup for listening.
Part 1: Listening to Discord Messages in n8n
The easiest way to listen for Discord interaction in real time is by using a gateway node with the Discord API. Since n8n does not offer an official Discord trigger by default, we can use WebSockets via a custom node or a middleware service like Pipedream (integrated via n8n).
Alternatively: Use a third-party webhook service (e.g., Typing-specific slash commands) in combination with Discord’s Application Commands.
Workaround with Slash Commands
Instead of listening to every message, you can trigger specific commands. Here’s how:
-
In the Discord Developer Portal, go to your application and add a Slash Command under “Bot” > “Interactions”.
-
Set the endpoint URL to an HTTP Webhook in n8n (we’ll create that next).
-
In n8n, create a new workflow:
- Add a Webhook node, set it to
POSTmethod - Set the webhook path (e.g.,
discord-command) - Save and activate
- Add a Webhook node, set it to
-
Copy the webhook URL and paste into the interaction URL field in your Discord bot’s settings.
Now when users type /mycommand, Discord sends the payload to your n8n workflow.
Bonus: Verify the Signature (Optional)
To comply with Discord's security, verify the X-Signature-Ed25519 and X-Signature-Timestamp headers in your Webhook node using a Function node.
If that's too complex, use a proxy tool like Pipedream for simple verification.
Tip: You can also trigger workflows from Discord using the Telegram-style message triggers in n8n if you're building similar bot logic.
Part 2: Sending Messages to a Discord Channel from n8n
Sending messages is significantly easier, and can be done using the Discord API with an HTTP Request node inside n8n.
Steps to Send a Message to Discord
-
Get your Discord Channel ID:
- On Discord, right-click the channel and click Copy ID (ensure Developer Mode is enabled)
-
Grab your Bot Token from the Discord Developer Portal
-
In your n8n workflow:
- Add an HTTP Request node
- Method:
POST - URL:
https://discord.com/api/v10/channels/YOUR_CHANNEL_ID/messages - Authentication: None
- Add a header:
Authorization:Bot YOUR_BOT_TOKENContent-Type:application/json
-
In the body parameters (raw JSON), add:
{ "content": "Hello from n8n! 🎉" } -
Click “Execute Node” — if successful, you’ll see the message in Discord instantly.
You can chain this after any trigger: emails, Airtable updates, AI decisions, or scraped web content.
Example Use Cases
Here are some automation ideas combining Discord with other tools via n8n:
| Use Case | Trigger | Action |
|---|---|---|
| Notify on new Airtable record | Airtable trigger | Send Discord message |
| Auto-reply to a specific slash command | Incoming webhook | Respond to user |
| Alert when a YouTube channel uploads | YouTube trigger | Post in Discord |
| Moderate content with ChatGPT | Discord command | Filter/rewrite with OpenAI, send reply |
| Create tasks from Discord | Slash command | Create item in Notion or ClickUp |
You can explore AI use cases using tools like Flowise vs n8n or add visual content using Creatomate integration.
Tips to Maintain Your n8n Discord Integration
- Use environment variables in n8n for bot tokens to keep them secure
- Log errors and build retry logic if commands fail (see error handling guide)
- Store log history in Google Sheets, Notion or Airtable for debugging
- Test commands thoroughly using Discord’s UI before going live
FAQ
Can I automate both reading and sending messages in Discord using n8n?
Yes, but reading messages requires more setup since Discord doesn’t push chat events via simple webhooks. Sending is easy via the API. For reading, use slash commands or integrate via a custom gateway bot.
Do I need coding skills for the n8n Discord integration?
Not necessarily. You can build most workflows using visual nodes like Webhooks and HTTP Requests. However, for signature verification or full message listeners, basic JavaScript or third-party tools may be helpful.
Is this integration free?
Yes! If you’re self-hosting n8n and using Discord’s API, you can build these automations absolutely free. Check out how to run n8n without paying on cloud or local machines.
What kind of permissions does my Discord bot need?
At minimum, your bot needs Send Messages, Read Message History, and Use Slash Commands. For moderation, add permissions like Manage Messages.
Can I trigger workflows based on emojis, reactions, or user joins?
Yes, but it requires deeper event listening via Discord Gateway (WebSocket). This setup goes beyond simple webhooks and calls for a persistent listener, possibly using Node.js connected through n8n or external tools.
The n8n Discord integration is a powerful way to streamline server management, enhance community interaction, or build AIOps agents. With a few simple steps, you can merge Discord with the rest of your workflows and elevate your automation game.