Discord Integration
Understand NexFlow's current Discord HTTP Interactions implementation and its setup limitations.
On this page
How Discord works
/ask message:HelloThe current integration uses Discord HTTP Interactions, not a persistent Gateway connection and not a bot token. NexFlow verifies Discord's Ed25519 signature using the saved Public Key, validates the configured command, immediately returns Discord's deferred acknowledgement, and queues the workflow. The reply action later replaces the original deferred response.
Note
Discord requires a fast initial acknowledgement. NexFlow returns that acknowledgement before its asynchronous node execution finishes. The interaction token is encrypted and used only to deliver the final reply within Discord's allowed lifetime.
Create a Discord App credential
- Create or open an application in Discord Developer Portal.
- Copy its Application ID and Public Key from the application's General Information area.
- In NexFlow Credentials, add a Discord App credential with a descriptive name, Application ID, and Public Key.
- Do not enter a bot token. This integration does not use one.
Discord Trigger settings
| Setting | Current behavior |
|---|---|
| Variable Name | Names the normalized interaction; default discord. |
| Discord Credential | Required owned Discord App credential. |
| Slash Command | Lowercase command name, default /ask, maximum 32 characters. |
| Private reply | The checkbox value is saved, but the current acknowledgement and reply code does not apply an ephemeral flag. |
Self-service endpoint setup is incomplete
Saving a configured Discord Trigger creates an enabled endpoint record, but the current settings panel neither displays the endpoint URL nor offers connect/status controls. It explicitly says endpoint connection is a later phase. A normal user cannot discover <webhookId> from the current UI, so do not invent or guess it.
Discord Developer Portal setup
The implemented endpoint format is shown below. In production, your-domain.com is the deployed NexFlow domain. Discord verifies this URL with a signed PING before accepting it.
https://your-domain.com/api/webhooks/discord/<webhookId>- In Discord Developer Portal, create a chat-input slash command whose name exactly matches the NexFlow trigger (for example
ask). - Add a required string option named
message; the current normalizer requires it. - Set the application's Interactions Endpoint URL to the NexFlow endpoint when your deployment has a supported way to obtain its generated webhook ID.
- Test
/ask message:"Hello"and inspect NexFlow Executions if the final reply fails.
Discord variables
{{discord.interactionId}}
{{discord.applicationId}}
{{discord.command.name}}
{{discord.command.options.message}}
{{discord.context.guildId}}
{{discord.context.channelId}}
{{discord.user.id}}
{{discord.user.username}}
{{discord.user.globalName}}Send Discord Reply
Send Discord Reply can only be saved in a workflow with Discord Trigger. Set a unique Variable Name (default discordReply) and the Reply text, commonly {{aiText.text}}. Replies are limited to 2,000 Unicode characters. Allowed mentions are disabled to avoid unintended mentions.
The result contains status: responded, the Discord message ID when returned, the sent text, and an ISO response timestamp.
Discord troubleshooting
| Problem | Possible cause and fix |
|---|---|
| The application did not respond | The endpoint may not be reachable, endpoint setup may be incomplete, the command may not match, or queuing may have failed. Verify the deployed HTTPS route and inspect server/execution status. |
| Endpoint verification failed | Confirm the Public Key, Application ID, HTTPS endpoint, and generated webhook ID. Discord requests must reach NexFlow unchanged for signature verification. |
| Unknown Webhook | The interaction token may have expired or the original interaction is unavailable. Run a new slash command; replies must complete within the token lifetime. |
| Credential unavailable | Select an owned Discord App credential whose Application ID and Public Key match the Discord application, then save. |
| Slash command unsupported | Match the command name exactly and include a string option named message. |
| Stale local tunnel URL | Update Discord's endpoint to the current public HTTPS URL. The current NexFlow panel does not automate this step. |
| Reply too long | Keep the final response at or below 2,000 characters. |