Discord Action
discord_action · Nodes · Providers
Runs Discord bot or webhook actions.
Discord Action#
Performs stateless Discord HTTP actions using either a Discord bot-token connection or a Discord webhook connection.
When to Use#
- Send or edit Discord messages through a Discord bot-token connection
- List Discord channels, members, or messages without a gateway trigger
- Respond to or defer Discord interactions when you already have
interaction_idandtoken - Send channel-scoped messages through a Discord webhook credential
Discord Action covers the operations listed below, not the entire Discord REST API. For an operation that is not represented here, use HTTP Request with the same Discord bot connection. Keep the bot token in the connection rather than adding an Authorization header to the workflow.
Configuration#
credential_kind#
Choose which credential family this node should use:
connection— Discord token connection (discord_bot)webhook— Discord webhook connection (discord_webhook)
connection#
Shown when credential_kind = connection.
Select a Discord api token connection from Settings → Connections.
Agent discovery: call list_connections with provider_name: "discord_bot" before asking the user for a Discord token. Use this credential kind for Discord API operations, including list_channels.
webhook_connection#
Shown when credential_kind = webhook.
Select a Discord webhook connection from Settings → Connections.
Agent discovery: call list_connections with provider_name: "discord_webhook" before asking the user for a webhook. Webhook credentials are channel-scoped and only support webhook send_message in this node.
retry#
Whether a request is sent again after a failure that passes: a rate limit, a busy server, a dropped connection. Off by default; see Retries for how attempts and waits work. defer_update, update_message, show_modal and webhook send_message are writes, sent again only when Discord refused them before acting: the connection never opened, or Discord answered 425 or 429. edit_original_response with components first looks up the bot's application, a read sent again freely. Uploads, meaning anything with attachments or with components on send_message, edit_message, respond_to_interaction and edit_original_response, go once. The other operations go through Discord's own client, which handles Discord's rate limits itself, and Retry does not apply to them.
Operations#
Connection operations:
send_messagereplyreactedit_messagedelete_messagesend_typinglist_channelslist_memberslist_messagesrespond_to_interactiondefer_interactiondefer_updateupdate_messageshow_modaledit_original_responseset_presence
Bot presence#
set_presence sets the bot's online status and activity:
status:online,idle,dnd(Do Not Disturb), orinvisibleactivity: tagged bykindnonecustomwithstate, a custom status messageplaying,listening,watching,competingwithnamestreamingwithnameandurl; the url must be a twitch.tv or youtube.com link
Activity text is interpolated and must be at most 128 characters once rendered.
Presence is a gateway feature with no HTTP endpoint, so this operation needs a running listener: a Discord Bot trigger installed on the same connection. Without one the run fails with "No listener is configured for this Discord bot". The operation never connects the gateway itself. The presence lasts until the next change, the last listener on the connection going away, or a Verdalia restart. A Discord Bot trigger's initial_presence replaces it when that trigger is installed or its workflow is saved.
Output: { "status": "idle", "activity": { "kind": "custom", "state": "Shipping" } }, with activity null for none.
Discord listing behavior#
- Use
list_channelswithcredential_kind = connectionand adiscord_botconnection to discover numeric channel IDs. - Message operations that take
channel_idrequire a Discord numeric channel snowflake, not a channel name such as#general. list_memberspaginates internally to return the requested total, even past Discord's per-request cap.list_messagesinlatestmode fetches the N most recent messages and can paginate internally.beforepages backward from a message ID.afteruses Discord's single-request window.arounduses Discord's single-request window.- Cursor values are Discord message IDs (snowflakes), not timestamps.
- Supported cursor modes are
latest,before,after, andaround.
Message-content limit#
Discord content is limited to 2,000 UTF-16 code units. Discord Action sends exactly one request: it does not split, truncate, or iterate array input.
For text that can exceed the limit, use the explicit sequential graph for message-creating operations (send_message, reply, and webhook send_message):
Split Text.output → Loop.input
Loop.loop → Discord Action.input
Set the Discord Action content field to {{ input }}. Split Text.output is one array value; Loop is required to send one ordered chunk per Discord request.
Do not loop edit_message, edit_original_response, update_message, or an initial respond_to_interaction. Repeated edits overwrite the same message and repeated initial interaction responses fail. Those operations require content under 2,000 units; shorten it, attach a file when the operation supports attachments, or use an appropriate deferred/follow-up flow.
Webhook operations:
send_message
For message and response operations, embeds is one JSON text block.
Accepted shapes:
- one embed object
- an array of embed objects
The field is interpolated before parsing.
Single embed example:
{"title":"Build failed","url":"https://example.com/build/123"}
Multiple embeds example:
[
{"title":"Leaderboard","description":"Top 10"},
{"image":{"url":"https://example.com/chart.png"}}
]
Pass-through from upstream payload:
{{ input.embeds }}
input.embeds can be either an object or array.
For message and response operations, attachments is interpolated exactly from the
workflow input and accepts a direct runtime binary, a binary wrapper
{ "binary": ..., "filename"?, "content_type"? }, a media reference wrapper
{ "object_id": ... }, or a flat array of those
values. The legacy JSON attachment format remains accepted: an object or array of
objects with url (HTTP/HTTPS) or base64. A url must reach a public address, under the same
rules as HTTP Request.
Examples:
{"url":"https://example.com/image.png"}
For message and interaction operations, components is one JSON text block containing a raw Discord components array.
Supported here:
send_messagewithout attachmentsedit_messagewithout attachmentsrespond_to_interactionwithout attachmentsupdate_messageshow_modaledit_original_responsewithout attachments
Empty means no components. Non-empty input must parse as a JSON array. Raw components cannot be combined with attachments for send_message, edit_message, respond_to_interaction, or edit_original_response; use no attachments or omit components.
Button response example:
[
{
"type": 1,
"components": [
{"type": 2, "style": 1, "custom_id": "approve", "label": "Approve"}
]
}
]
Modal example:
[
{
"type": 1,
"components": [
{
"type": 4,
"custom_id": "summary",
"label": "Summary",
"style": 2,
"required": true
}
]
}
]
[
{"url":"https://example.com/chart.png","filename":"chart.png"},
{"base64":"{{ input.output.base64 }}","filename":"snapshot.png","content_type":"image/png"}
]
This example expects Read Media with output_format = base64 upstream. HTTP Request returns binary responses as runtime binary, not as a body_base64 field; persist or transform that binary explicitly before using a base64-only attachment input.
Inputs#
input is any upstream JSON payload.
Workflow templates are keyed by input socket name. For object-shaped standard input, use {{ input.message.channel_id }}. If the standard input socket contains an array, use numeric path segments such as {{ input.0.message.channel_id }}. To render the entire standard input socket, use {{ input }}.
Exact template paths such as {{ input.embeds }} can pass through a whole JSON object or array for fields that accept JSON.
If an interpolation error says Available inputs: input: array(len=1), the input socket is an array. Add a numeric segment to the path. Example: change {{ input.message.channel_id }} to {{ input.0.message.channel_id }}.
Examples:
Object-shaped input:
{{ input.message.channel_id }}{{ input.message.id }}{{ input.interaction.id }}{{ input.interaction.token }}{{ input.body.id }}{{ input.body.token }}
Array-shaped input:
{{ input.0.message.channel_id }}{{ input.0.message.id }}
Outputs#
output is the raw operation result.
- Message mutations usually return
{ "success": true }plusmessage_idwhen Discord creates a message - Interaction mutations return
{ "success": true } - List operations return arrays of channels, members, or messages
Important Contract Notes#
- This node is stateless only. It does not subscribe to the Discord gateway;
set_presenceuses the gateway aDiscord Bottrigger already holds. - This node does not inspect
input.provenance. edit_original_responsedoes not requireapplication_idin node config or input.- Initial interaction callbacks must reach Discord within Discord's 3-second deadline.
show_modalsends callback type 9 and must be the initial callback; it cannot run afterdefer_interaction/defer_update.show_modalcannot respond to a modal submit interaction. Userespond_to_interaction,update_message, ordefer_updatefor modal submit handling.
Examples#
Reply to a slash command from Discord Bot#
Use Discord Bot with event_kind = slash_command, then configure Discord Action with:
credential_kind:connectionconnection: selected Discord bot-token connectionoperation:respond_to_interactioninteraction_id:{{ input.interaction.id }}token:{{ input.interaction.token }}
Defer, then edit the original interaction response#
Discord Actionwithdefer_interactioninteraction_id:{{ input.interaction.id }}token:{{ input.interaction.token }}
- Later, another
Discord Actionwithedit_original_responsetoken:{{ input.interaction.token }}content: bounded text (at most 2,000 UTF-16 code units); this edit cannot be looped to create multiple messages- optional
embeds: Discord embed JSON (object or array) - optional
attachments: Discord attachment JSON (object or array)
Send a webhook message#
Use credential_kind = webhook with:
webhook_connection: selected Discord webhook connectionoperation:send_messagecontent: message text- optional
usernameandavatar_urloverrides - optional
embeds: Discord embed JSON (object or array) - optional
attachments: Discord attachment JSON (object or array)
Show typing indicator in a channel#
Use credential_kind = connection with:
connection: selected Discord bot-token connectionoperation:send_typingchannel_id:{{ input.message.channel_id }}for object-shaped input,{{ input.0.message.channel_id }}for array-shaped input, or another channel snowflake
Send to a named Discord channel#
Do not put a channel name in channel_id. Discord API sends require the numeric channel ID.
- Use
list_connectionswithprovider_name: "discord_bot"to find a bot-token connection. - Run
Discord Actionwithcredential_kind = connection, that bot connection, andoperation = list_channels. - Select the returned channel object by
name. - Use its numeric
idaschannel_idforsend_message,reply,react,edit_message,delete_message,send_typing, orlist_messages.
Follow up from a generic Webhook Trigger#
If a generic webhook workflow receives a Discord interaction payload, you can still use this node.
- Initial HTTP response goes through
Webhook Response - Later Discord API calls use
Discord Action - For interaction follow-up fields, interpolate from the webhook payload, for example:
interaction_id:{{ input.body.id }}token:{{ input.body.token }}
Tips#
- Use
connectionfor general Discord HTTP APIs. - Use
list_connectionswithprovider_name: "discord_bot"for bot-token connections. - Use
list_connectionswithprovider_name: "discord_webhook"for channel webhook connections. - Use
send_typingto emit Discord's channel typing indicator before a delayed response. - Use
webhook_connectiononly for channel-scoped webhook sends. - Use numeric Discord channel IDs, not channel names, in
channel_idfields. send_message,reply,edit_message,respond_to_interaction, andedit_original_responseall supportembedsandattachmentsJSON.- For unbounded text in
send_message,reply, or webhooksend_message, useSplit Text → Loop → Discord Actionwithcontent: {{ input }}. Discord Action does not split automatically. send_message,edit_message,respond_to_interaction,update_message,show_modal, andedit_original_responsesupport raw DiscordcomponentsJSON arrays; attachments cannot be combined with raw components except on operations that do not support attachments.- For gateway slash-command workflows,
Discord Botprovidesinput.interaction.*values directly. - For generic webhook workflows,
Webhook Responsehandles the inbound HTTP response andDiscord Actionhandles outbound Discord API calls.
Inputs
inputRequired
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
credential_kind | enum(connection, webhook) | No | |
connection | connection(discord_bot) | Yes | Discord bot-token connection. Discover with list_connections provider_name=discord_bot. Use for API actions and list_channels. Numeric Discord IDs are required for channel_id fields. |
webhook_connection | connection(discord_webhook) | Yes | Discord webhook connection. Discover with list_connections provider_name=discord_webhook. Use only with webhook send_message. |
connection_operation | tagged_union | No | |
webhook_operation | tagged_union | No | |
retry | tagged_union | No | Sends a request again after a failure that passes: a rate limit, a busy server, a dropped connection. Off sends once. |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |