> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/integrations/builtin/handle-rate-limits.md).

# Handle rate limits

How to handle API rate limits when using n8n integrations.

When a node hits an API rate limit, it errors: turn on **Retry On Fail** for short waits, or batch requests with pauses using **Loop Over Items** and **Wait**. **Retry On Fail** allows at most five tries, up to 5 seconds apart.

API[^1] rate limits are restrictions on request frequency. For example, an API may limit the number of requests you can make per minute, or per day.

APIs can also limits how much data you can send in one request, or how much data the API sends in a single response.

## Identify rate limit issues <a href="#identify-rate-limit-issues" id="identify-rate-limit-issues"></a>

When an n8n node hits a rate limit, it errors. n8n displays the error message in the node output panel. This includes the error message from the service.

If n8n received error 429 (too many requests) from the service, the error message is **The service is receiving too many requests from you**.

To check the rate limits for the service you're using, refer to the API documentation for the service.

## Handle rate limits for integrations <a href="#handle-rate-limits-for-integrations" id="handle-rate-limits-for-integrations"></a>

There are two ways to handle rate limits in n8n's integrations: using the Retry On Fail setting, or using a combination of the [Loop Over Items](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches.md) and [Wait](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait.md) nodes:

* Retry On Fail adds a pause between API request attempts.
* With Loop Over Items and Wait you can break you request data into smaller chunks, as well as pausing between requests.

### Enable Retry On Fail <a href="#enable-retry-on-fail" id="enable-retry-on-fail"></a>

When you enable Retry On Fail, the node automatically tries the request again if it fails the first time.

1. Open the node.
2. Select **Settings**.
3. Enable the **Retry On Fail** toggle.
4. Configure the retry settings. For example, if the API allows one request per second, set **Wait Between Tries (ms)** to `1000` to wait 1 second between retries.

**Retry On Fail limitations:** **Wait Between Tries** is limited to 5000 ms (5 seconds), and **Max Tries** is limited to five. The HTTP Request node doesn't automatically honor the API's `Retry-After` response header. For rate limits requiring longer delays, use batching or combine Loop Over Items with a Wait node to control request frequency.

### Use Loop Over Items and Wait <a href="#use-loop-over-items-and-wait" id="use-loop-over-items-and-wait"></a>

Use the Loop Over Items node to batch the input items, and the Wait node to introduce a pause between each request.

1. Add the Loop Over Items node before the node that calls the API. Refer to [Loop Over Items](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches.md) for information on how to configure the node.
2. Add the Wait node after the node that calls the API, and connect it back to the Loop Over Items node. Refer to [Wait](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait.md) for information on how to configure the node.

For example, to handle rate limits when using OpenAI:

![Workflow using Loop Over Items and Wait nodes to pace requests to the OpenAI API](https://139179334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBKcbOzIWja8NfqKDcqHc%2Fuploads%2Fgit-blob-f1b0ada19c1456f0f3becfa242f98746ccd642db%2Floop-wait.png?alt=media)

## Handle rate limits in the HTTP Request node <a href="#handle-rate-limits-in-the-http-request-node" id="handle-rate-limits-in-the-http-request-node"></a>

The HTTP Request node has built-in settings for handling rate limits and large amounts of data.

### Batch requests <a href="#batch-requests" id="batch-requests"></a>

Use the **Batching** option to control how many requests the node sends before pausing. The **Batch Interval** setting controls the delay between batches.

1. In the HTTP Request node, select **Add Option** > **Batching**.
2. Set **Items per Batch** to the number of input items to process in each batch. Each input item generates a separate HTTP request.
3. Set **Batch Interval (ms)** to introduce a delay between batches. For example, set **Batch Interval (ms)** to `1000` to wait 1 second between batches.

### Paginate results <a href="#paginate-results" id="paginate-results"></a>

APIs paginate their results when they need to send more data than they can handle in a single response. For more information on pagination in the HTTP Request node, refer to [HTTP Request node | Pagination](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest.md#pagination).

[^1]: APIs, or application programming interfaces, offer programmatic access to a service's data and functionality. APIs make it easier for software to interact with external systems. They're often offered as an alternative to traditional user-focused interfaces accessed through web browsers or UI.
