n8n - 💡(How to fix) Fix Discord Node failing to validate Rate Limit Headers [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#28375Fetched 2026-04-13 05:45:21
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
commented ×1labeled ×1mentioned ×1renamed ×1

Error Message

  • error: all

Root Cause

Just send a webhook or bot message a bunch of times and done. To fix this issue a custom pipeline that queues and flushes messages is needed that can end up making the entire discord integration useless because of a oversight in the rate limit handeling.

Code Example

< Retry-After: 65
< X-RateLimit-Limit: 10
< X-RateLimit-Remaining: 0
< X-RateLimit-Reset: 1470173023.123
< X-RateLimit-Reset-After: 64.57
< X-RateLimit-Bucket: abcd1234
< X-RateLimit-Scope: user
RAW_BUFFERClick to expand / collapse

Bug Description

The integration for discord does not validate the mandatory rate limit headers:

< Retry-After: 65
< X-RateLimit-Limit: 10
< X-RateLimit-Remaining: 0
< X-RateLimit-Reset: 1470173023.123
< X-RateLimit-Reset-After: 64.57
< X-RateLimit-Bucket: abcd1234
< X-RateLimit-Scope: user

Discord suggests to use them in every possible case as it can help prevent global rate limits, however the node does not do that bug rather cause inconstant delivery of messages due to rate limits not beeing parsed and retried correctly.

To Reproduce

Just send a webhook or bot message a bunch of times and done. To fix this issue a custom pipeline that queues and flushes messages is needed that can end up making the entire discord integration useless because of a oversight in the rate limit handeling.

Expected behavior

The discord integration should validate the rate limit headers for bots, webhooks etc.. automatically and retry after the rate limit ended, not silently fail.

Debug Info

Not needed, its just a faulty implementation of the send message code.

Debug info

core

  • n8nVersion: 2.15.1
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.13.1
  • nodeEnv: production
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 966aa388-5307-4415-9317-7b98b92bca65

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 1 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36
  • isTouchDevice: false

security

  • secureCookie: false

Generated at: 2026-04-12T19:42:25.504Z

Operating System

Ubuntu Linux 24.04.4 LTS

n8n Version

2.15.1

Node.js Version

24.13.1

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

Implement a custom pipeline to queue and flush messages, handling Discord rate limit headers to prevent global rate limits and ensure consistent message delivery.

Guidance

  • Review the Discord API documentation to understand the rate limit headers and how to handle them correctly.
  • Implement a queueing system to store messages when the rate limit is exceeded, and flush them when the rate limit is reset.
  • Parse the X-RateLimit-Reset and X-RateLimit-Reset-After headers to determine when to retry sending messages.
  • Consider using a library or module that handles rate limiting and retry logic to simplify the implementation.

Example

// Pseudo-code example of handling rate limit headers
const Discord = require('discord.js');

// ...

const rateLimitReset = response.headers['x-ratelimit-reset'];
const rateLimitResetAfter = response.headers['x-ratelimit-reset-after'];

if (rateLimitReset && rateLimitResetAfter) {
  // Queue the message and retry after the rate limit is reset
  queueMessage(message);
  setTimeout(() => {
    sendMessage(message);
  }, rateLimitResetAfter * 1000);
}

Notes

The provided example is pseudo-code and may not work as-is. The actual implementation will depend on the specific requirements and constraints of the project. Additionally, the discord.js library may have built-in support for handling rate limits, which should be investigated before implementing a custom solution.

Recommendation

Apply a workaround by implementing a custom pipeline to handle rate limit headers, as the current implementation does not seem to handle rate limits correctly. This will help prevent global rate limits and ensure consistent message delivery.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The discord integration should validate the rate limit headers for bots, webhooks etc.. automatically and retry after the rate limit ended, not silently fail.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING