This workflow automates sending messages to Discord channels via webhooks, supporting simple, rich, or embed messages. Key nodes include Webhook Trigger (receives POST requests), Validate Input (checks webhookUri and text), Security Validation (sanitizes inputs), Check Security Validation, Prepare Message Options (sets parameters), Route Message Type (directs message type), Send Embed/Rich/Simple Message (API interactions), Check Message Success (verifies response), Check Timestamp Option, Add Timestamp, Success Response, Error Response, Security Error Response, and Return Response (handle outputs).\n\nSetup Requirements and Configuration: Install n8n by downloading from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow installation prompts or create a cloud account. Obtain a Discord webhook URL from discord.com: log in, go to a server you manage, edit a channel, select 'Integrations' > 'Create Webhook,' and copy the webhook URL. In n8n, import the provided JSON to create the workflow. Configure Discord nodes (Send Embed/Rich/Simple Message) with the webhook URL in the node parameters (no separate credentials needed). Set the Webhook Trigger node’s path to 'discord-message,' ensure it accepts POST requests, and optionally enable header authentication with a secure key. The Security Validation node ensures valid webhook URLs and sanitizes text to prevent unwanted mentions.\n\nTesting and Deployment Steps: Test by sending a POST request to the Webhook URL (from the Webhook Trigger node) using Postman. Example JSON body: {'webhookUri': 'https://discord.com/api/webhooks/123/abc', 'text': 'Test message', 'messageType': 'simple'} or {'webhookUri': 'https://discord.com/api/webhooks/123/abc', 'text': 'Update', 'messageType': 'embed', 'embeds': [{'title': 'Test'}]} with the authentication header if enabled. The 'Success Response' node returns a 200 status with message details, or 'Error Response' (400 status) for missing inputs, or 'Security Error Response' (400 status) for invalid URLs. Monitor logs for errors like invalid webhook URLs or message length issues, and verify inputs if problems occur. Activate the workflow in n8n’s interface for deployment. Validate outputs to confirm that messageType and timestamp match the request.
$6.99
Workflow steps: 17
Integrated apps: webhook, if, set