Discord Send Message

Send messages to Discord channels via webhook from a workflow. Use it for notifications, alerts, and bot-style messages without managing a full Discord bot connection.

When to Use

Use Discord Send Message when:

  • You need to post alerts or notifications to a Discord channel from a workflow
  • You want rich embed messages with titles, descriptions, and colors
  • You need a lightweight integration using a channel webhook (no bot token required)
  • An AI Agent should post Discord notifications as a tool

Each webhook URL is tied to one channel. Create additional webhooks for other channels.

Inputs

HandleTypeDescription
inputanyUpstream data for template expression references in settings bindings.

Output

HandleTypeDescription
resultobjectDiscord message send result

The result (accessed as {{ discord_message.* }}) shape:

FieldTypeDescription
successbooleanWhether the message was sent successfully
errorstringError message if success is false
{
  "success": true,
  "error": null
}

Settings

SettingTypeDefaultDescription
contentcode editorMessage content. Required. Supports template expression bindings. Discord has a 2000-character limit.
usernamestringOverride the webhook's display username. Optional. Supports template expression bindings.
embedscode editor (JSON)Rich embed objects as a JSON array. Optional. Supports template expression bindings.

Required Secrets

Configure on the Env Vars page:

Env VarDescription
DISCORD_WEBHOOK_URLWebhook URL from Discord server Settings → Integrations → Webhooks. See Discord webhook docs for setup instructions.

To create a webhook:

  1. Open Discord server Settings
  2. Go to IntegrationsWebhooks
  3. Click New Webhook, select the target channel, and copy the URL

Example

Canvas

Post an alert when a webhook event fires:

Webhook Trigger → Discord Send Message

Discord Send Message settings:

  • Content: New order received: #{{ webhook.body.orderId }}
  • Username: Order Bot

Send a rich embed notification:

  • Content: (leave empty)
  • Embeds:
[
  {
    "title": "Deployment Complete",
    "description": "Service `api-gateway` deployed successfully.",
    "color": 3066993
  }
]

Access the result in downstream nodes:

{{ discord_message.success }}
{{ discord_message.error }}

TSL

import webhook from @tensorify/webhook-trigger:4.0.0
import discord from @tensorify/discord-send-message:1.0.0

node trigger @tensorify/webhook-trigger:4.0.0 {
    provider = "generic"
    path = "/orders"
    method = "POST"
}

node notify @tensorify/discord-send-message:1.0.0 {
    content = "New order received: #{{ webhook.body.orderId }}"
    username = "Order Bot"
}

trigger.payload -> notify.input

Error Handling

Discord Send Message has an On Error control output branch. Enable it via the "Error output handle" toggle at the bottom of the settings panel.

The error branch fires when:

  • The Discord webhook API returns an error (invalid URL, rate limit, etc.)
  • DISCORD_WEBHOOK_URL is missing or invalid
  • Embed JSON is malformed or fails Discord validation
  • Message content exceeds the 2000-character limit

Connect the error output to a fallback notification or If node. On the success path, check {{ discord_message.success }} — the node does not automatically stop execution on failure.

Common Gotchas

  • One channel per webhook: A webhook URL is tied to a single channel. Create additional webhooks for other channels, or use separate env vars per channel.
  • Content length limit: Discord webhooks have a 2000-character limit for message content.
  • Embed validation: Invalid embed JSON causes the send to fail. Validate your embed structure against the Discord embed object docs.
  • Check discord_message.success: Connect the On Error branch or add an If node to handle send failures.
  • Missing DISCORD_WEBHOOK_URL: The node fails at runtime if the env var is not set.

See Also

On this page