Workflow Automation

Handling API Rate Limits in n8n Without Losing Records

Why n8n workflows fail with 429 errors on bigger runs, and three ways to fix it: HTTP Request batching, Loop Over Items with a Wait node, and a retry loop that reads the Retry-After header.

1 December 2026 · 6 min read · TOSS
TOSS illustration for Handling API Rate Limits in n8n Without Losing Records

A workflow that syncs ten contacts works perfectly in testing. Then someone imports 2,000 rows from a trade show list, the workflow fires 2,000 API calls as fast as n8n can send them, and the CRM answers with 429 Too Many Requests somewhere around record 150. Some contacts made it in, most did not, and nobody is sure which.

That is a rate limit. Almost every API you will connect to has one: a cap on how many requests you can make per second, per minute or per day. n8n does not know those caps. It sends requests as fast as it can unless you tell it otherwise.

Why the obvious fix only goes so far

Every n8n node has Retry On Fail under its Settings tab, with Max Tries and Wait Between Tries (ms). Turning it on is a sensible default, but n8n’s own documentation states the limits: five tries at most, and no more than 5,000 ms between them. The HTTP Request node also ignores the Retry-After header that many APIs send back with a 429.

So if an API tells you to wait 60 seconds, Retry On Fail will burn through its five attempts in under half a minute and fail anyway. It covers brief hiccups. It does not cover a real limit.

The better approach is to send requests at a pace the API accepts in the first place, and keep a proper retry for the times you still get pushed back.

Option 1: Batching inside the HTTP Request node

If the calls go through an HTTP Request node, this is the quickest change. Open the node, click Add Option, choose Batching, and set:

Setting What it does Example
Items per Batch How many items are sent before pausing 10
Batch Interval Milliseconds to pause between batches 1000

With those values the node sends ten requests, waits a second, sends the next ten. Work out the numbers from the API’s published limit and leave headroom. If the limit is shared with other integrations on the same account (your website form, a reporting tool, another workflow), your workflow only gets part of it.

This only works for the HTTP Request node. Built-in app nodes, such as a CRM node, do not offer the same option.

Option 2: Loop Over Items with a Wait node

For any node, including the built-in app nodes, put the pacing in the workflow itself:

  1. Add Loop Over Items before the node that calls the API. Set its batch size to what the API can take in one go.
  2. Connect the loop output to your API node.
  3. After the API node, add a Wait node set to resume after a time interval.
  4. Connect the Wait node back into Loop Over Items.
  5. Whatever needs the full result (a summary message, a “sync finished” log) goes on the done output.

This is the pattern n8n’s documentation recommends for longer delays, and it has a side benefit: each batch is a visible step in the execution log, so when something fails you can see exactly which batch it was.

One trap. If the API accepts several records in a single request (many CRM bulk endpoints do), use that before you start pacing individual calls. One request with 50 records counts as one request against most limits. Check the API’s documentation for the maximum per call.

Option 3: A retry loop that respects Retry-After

Pacing reduces 429s but will not remove them, especially when other systems share the quota. For calls that must not be lost, build the retry yourself.

On the HTTP Request node, open Options > Response and turn on Include Response Headers and Status and Never Error. The node now passes the status code and headers through instead of stopping the workflow, so you can decide what to do with a 429.

After it, add a Code node (mode: run once for each item) that works out how long to wait:

// Runs after an HTTP Request node with "Never Error" and
// "Include Response Headers and Status" turned on.
const res = $json;
const status = res.statusCode;

if (status !== 429 && status < 500) {
  // Success, or a 4xx that retrying will not fix: pass it on.
  return { json: { ...res, retry: false } };
}

// Retry-After is either a number of seconds or an HTTP date.
const header = res.headers?.['retry-after'];
let waitSeconds = 30; // fallback when the API sends no header

if (header) {
  const asNumber = Number(header);
  if (!Number.isNaN(asNumber)) {
    waitSeconds = asNumber;
  } else {
    const until = Date.parse(header);
    if (!Number.isNaN(until)) {
      waitSeconds = Math.max(1, Math.ceil((until - Date.now()) / 1000));
    }
  }
}

return { json: { ...res, retry: true, waitSeconds } };

Then wire it up:

  • An If node checks {{ $json.retry }} is true and {{ $runIndex }} is less than 5. $runIndex counts how many times this node has run in the execution, so it stops the loop from going round forever.
  • The true branch goes to a Wait node with the amount set to {{ $json.waitSeconds }} seconds, then back into the HTTP Request node.
  • The false branch splits again: successes carry on, and anything still failing goes to a step that records it (a row in a sheet, a Slack message, a “failed sync” tag in the CRM).

That last step matters more than the retry. A rate limit failure you can see and rerun is an inconvenience. One that disappears into the execution history is how a CRM quietly ends up with half a contact list. If you already have an error workflow set up, as described in our guide to n8n error workflow alerts, the false branch can end in a Stop and Error node so it lands in the same alert channel.

Testing it before the big import

Do not wait for the 2,000 row import to find out whether it works. Lower Items per Batch or the loop batch size so you are sure to hit the limit with a small test set, or point the request at a test endpoint that returns 429 on demand. Then confirm three things in the execution log: the Wait node actually ran, the retried calls succeeded, and the item count at the end matches the count at the start.

Rate limits are rarely the hard part of an integration, but they are a common reason a workflow that “worked fine” starts losing data once the business grows. If your automations are reaching that point, our workflow automation team can review them, or tell us what you are running and we will look at where it is likely to break first.

Talk to TOSS

Turn the idea into a working system.

Start with the friction. We will help you find the right system.

Start a conversation →