Skip to main content

Discord Nodes

Send messages, manage servers, react to incoming messages, and handle slash commands through a Discord bot.

Available Nodes

Discord Send and Discord API are dual-purpose: they work as standalone workflow nodes and as AI Agent tools when connected to an agent’s tools handle.

Setup Requirements

  1. Create an application in the Discord Developer Portal
  2. Open Bot in the left sidebar and copy the token
  3. Under Bot > Privileged Gateway Intents, enable Message Content Intent
  4. Under OAuth2 > URL Generator, select the bot scope and the permissions you need, then open the generated URL to invite the bot to your server
Enable the Message Content intent before connecting. Without it the bot still connects normally, but every incoming message arrives with empty text and no error is reported anywhere. Discord only exempts messages that mention the bot directly or are sent in DMs. The credential check tells you whether the intent is enabled.

Connecting

There is no “connect” workflow node. The bot is managed from the Credentials panel:
  1. Open the Credentials modal and select the Discord panel
  2. Paste the bot token and validate it. A successful check shows the bot’s username and whether the Message Content intent is on
  3. Click Connect to open the gateway connection that Discord Receive listens on
Discord Send and Discord API work as soon as the token is saved. Only the triggers need the connection.

Finding IDs

Discord addresses everything by numeric ID. Enable Developer Mode under User Settings > Advanced, then right-click any server, channel, user, or message and choose Copy ID.

Multiple bots

Every Discord node has an Account dropdown. Leave it blank to use the bot saved in the Credentials panel. To run more than one bot, save additional tokens under separate accounts; each account keeps its own gateway connection and its own status.
An AI agent cannot change which bot a node acts as. The account is operator configuration, and it is removed from anything the model supplies. This matters because an incoming Discord message is the most likely source of a prompt injection.

Discord Send

Post a message to a channel, or open a direct message with a user.

Parameters

select
default:"channel"
channel posts in a channel; user opens a DM with a user
string
Channel ID. Shown when target type is channel
string
User ID. Shown when target type is user. A DM channel is opened automatically
string
Message text. Text longer than 2000 characters is split across several messages
array
Up to 10 embed objects, in Discord’s embed format
file
A file from the workflow workspace to attach
string
Reply to an existing message by ID
boolean
default:"false"
Hide link previews on this message
boolean
default:"false"
Send as a text-to-speech message

Output

parts and the full message_ids list appear only when the text was long enough to split. message_id is always the first message.

Discord API

The rest of the REST surface, selected by the Operation dropdown.

Downloading attachments

Discord Receive reports attachments as metadata only. To get the files, connect it to a Discord API node with the download_attachments operation and map the trigger’s attachments output into the Attachments field. Each file is saved into the workflow workspace and returned as a reference the rest of the workflow can use.
Discord’s download links are signed and expire after a day, so download in the same workflow run that received the message rather than storing the link.

Webhooks

execute_webhook posts through a Discord webhook URL (Server Settings > Integrations > Webhooks). No bot token is involved, so it can reach channels the bot is not in. The URL is the credential: keep it out of shared workflow exports.

Custom routes

custom calls any path under Discord’s API with the bot’s token, for example users/@me or channels/123/messages. Only relative paths are accepted; a full URL or a path containing .. is refused.

Discord Receive

Trigger node that fires when a message arrives in a server channel or a DM. Requires the bot to be connected from the Credentials panel.

Parameters

select
default:"all"
all, guild (server channels only), or dm (direct messages only)
string
Only fire for messages in this server
string
Only fire for messages in this channel
string
Only fire for messages from this user
string
Comma-separated words. Fires only if the message contains one of them
boolean
default:"false"
Only fire when the bot is mentioned. Works even without the Message Content intent
boolean
default:"false"
Only fire for messages that include a file
boolean
default:"true"
Ignore messages from other bots. Turning this off can create a loop between two bots replying to each other

Output

All IDs are strings. guild_id is null for a direct message. The bot’s own messages never fire the trigger.

Discord Interaction

Trigger node that fires on a slash command, button click, select menu, or modal submit. Interactions arrive over HTTP rather than the gateway, so this needs extra setup.

Setup

  1. In the Developer Portal, under General Information, copy the Public Key and paste it into the Discord credential’s Public Key field
  2. Set the application’s Interactions Endpoint URL to https://<your-server>/api/discord/interactions. Discord tests the URL when you save it; the server must be reachable from the internet
  3. Register your slash commands with Discord (the Developer Portal or the API)
Setting an Interactions Endpoint URL changes where Discord delivers all interactions for that application. They arrive at the URL and stop arriving over the gateway. This is a per-application setting on Discord’s side.
For a second bot account, use https://<your-server>/api/discord/interactions/<account-id>.

Parameters

select
default:"all"
all, command (slash commands), component (buttons and menus), or modal
string
Only fire for this slash command. A leading / is fine
string
Only fire for the button, menu, or modal with this custom ID
string
Only fire for interactions in this server

Output

options contains the slash command’s arguments by name. interaction_type is 2 for a command, 3 for a component, 5 for a modal.

Replying to an interaction

Discord requires an acknowledgement within three seconds, so the trigger sends one immediately and the workflow replies afterwards. Connect a Discord API node with the interaction_respond operation, map the trigger’s interaction_ref into its Interaction reference field, and set the reply text. The reply must be sent within 15 minutes of the interaction.
interaction_ref is an opaque handle, not Discord’s interaction token. The token can post messages as your app, so it never appears in workflow output. References are held in memory and do not survive a server restart.

User authorization (OAuth2)

To act on behalf of a Discord user rather than the bot, fill in the credential’s OAuth2 Client ID and Client Secret (Developer Portal > OAuth2), add https://<your-server>/api/discord/callback as a redirect URI there, then use Connect on the user panel. Only the identify and guilds scopes are requested.

Troubleshooting

The Message Content intent is not enabled. Turn it on under Bot > Privileged Gateway Intents in the Developer Portal, then reconnect. Messages that mention the bot, and all DMs, carry text regardless.
Connect the bot from the Credentials panel before deploying. A deployed trigger listens on the gateway connection, and refuses to arm if there is none.
Discord verifies the URL by sending a test request that must be rejected with a signature error. Check that the Public Key in the credential matches the application, and that the server is reachable from the internet over HTTPS.
Discord limits each bot to 50 requests per second, and separately blocks hosts that send too many invalid requests. Short waits are handled automatically. A long block usually means a wrong token or a channel the bot cannot see; fix the underlying error rather than retrying.
Check the bot’s role and the channel’s permission overrides in Discord. The bot needs View Channel and Send Messages at minimum, and Attach Files to send attachments.