Rate Limit API Calls with the Wait Node in n8n

Difficulty
2/10
Tags
EssentialsWaitLoop Over ItemsHTTP RequestSplit OutEdit Fields (Set)APIJSONArrays

Many APIs enforce rate limits to prevent overload. If you send too many requests too quickly, you will get errors like "429 Too Many Requests." This is especially common when processing batches of data.

The Wait node pauses workflow execution for a specified duration before continuing. Combined with the Loop Over Items node, you can process data in batches with delays between each batch to stay within API rate limits.

What you'll practice:

  • Using the Wait node to add delays
  • Processing items in batches with Loop Over Items
  • Building rate-limited API workflows

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

Some of your customers filled out a survey about your product. They provided you with their user id, first names, last names and email addresses. Your task is to verify that these users exist in your CRM and enrich their profiles with existing data.

To avoid overloading your CRM, you have to implement a wait node, so that the individual requests to check the database don't come all at once. A 2-second delay between each request should be enough.

  1. You are provided with an Edit Fields node that holds the form data. Build the workflow from here.
  2. Split the users array into individual items to get ready for the loop
  3. Set the loop to process batches of 1 user per iteration
  4. For each batch, make an HTTP request to fetch individual user details. Use the user id in the URL to fetch the correct user.
  5. Wait 2 seconds before processing the next batch

Expected output: 6 items in the "Done" branch of the Loop Over Items node, each containing extensive information about the 6 user IDs you requested from the API.

Hints

  1. Add a Manual Trigger node to start the workflow
  2. Connect it to the Edit Fields node (already provided with user data)
  3. Add a Split Out node with Field To Split Out set to users
  4. Add a Loop Over Items node with Batch Size set to 1
  5. Connect the Loop Over Items "loop" output to an HTTP Request node
  6. In the HTTP Request, set the URL to https://dummyjson.com/users/{{ $json.id }} to fetch individual user details (or use query parameters)
  7. Add a Wait node after the HTTP Request
  8. Set Resume to "After Time Interval" with Amount of 2 and Unit of "Seconds"
  9. Connect the Wait node back to the Loop Over Items node to continue the loop

Tip: The Loop Over Items node has two outputs: "done" (when all batches are processed) and "loop" (for each batch). Connect your processing nodes to the "loop" output.

Explanation

Why we need Wait:

The Wait node pauses workflow execution, which is essential for:

  • Respecting API rate limits
  • Waiting for external processes to complete
  • Adding delays between operations

How the Wait node works:

The Wait node can resume execution in several ways:

  • After Time Interval: Waits for a specified duration (seconds, minutes, hours)
  • At Specified Time: Waits until a specific date/time
  • On Webhook Call: Waits for an external HTTP call
  • On Form Submitted: Waits for a form submission

In this challenge, we use "After Time Interval" to add a simple delay.

How Loop Over Items works:

The Loop Over Items node processes items in batches. It has two outputs:

  • done: Triggers when all batches have been processed
  • loop: Triggers for each batch, passing the current batch of items

By connecting the Wait node back to the loop input, we create a controlled loop that processes each batch with a delay.

How the solution works:

  1. Manual Trigger: Starts the workflow
  2. Edit Fields: Contains the survey data (6 users with id, firstName, lastName, email)
  3. Split Out: Converts the users array into 6 individual items
  4. Loop Over Items: Processes items one at a time (batch size of 1)
  5. HTTP Request: Fetches detailed data for the current user from https://dummyjson.com/users/{id}
  6. Wait: Pauses for 2 seconds before the next iteration
  7. The loop continues until all 6 users are processed, outputting enriched data in the "done" branch

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise

Related Content

Continue your learning journey with these related challenges and guides: