429 rate limit error, how do i make my module wait and try again?

Hi,

I’m using the HTTP Make a basic auth request for a open API. The API has a limit of 30 queries within 60 seconds.

My issue is that i have over 888 records i need to run, and i need the HTTP module to run 30 queries each 60 second, anybody know how i can pull this off?

blueprint (8).json (44.3 KB)

I believe i should use Sleep + Repeater, but i’m not sure where to place them, and how i can make the API run 30/ then start from the last place it stopped?

Hi @Tobias_Hansen,

I believe you can right click the HTTP module, add an error route, select Resume.
On that route, between HTTP and Resume, you add two modules, Sleep, and a clone of your HTTP module.
So the order is:
HTTP (original) → Sleep → HTTP (clone) → Resume

In the Sleep module, enter in 60 seconds.
In the Resume module, fill in the fields from the HTTP (clone) module.

To describe what this does… run HTTP (original), if there’s an error, wait 60 seconds, run HTTP (clone), pass the results of HTTP clone as if they were the result of HTTP (original) into the rest of your scenario.

2 Likes

Hey Donald,
Thanks for getting back to me so quickly!

I just tried it out:

But it dosent seem like the “Error route” starts, the scenario runs like normal and dosent take route 2

Oops, missed a step!
If you open up the HTTP module, there’s an option at the bottom to enable Advanced settings, tick that to on.
Then, at the top, there’s an option to Evaluate all states as errors (except for 2xx and 3xx).
Set that to Yes and let’s see if that helps!

2 Likes

Strange stuff is happening Donald,

When i’m doing this (Enabled Advanced settings) i get The operation failed with an error. Error: 400 Bad Request. Basically Evaluate all states as errors (except for 2xx and 3xx ) is breaking the scenario.

The error code is 429, is it possible to send it to route 2 if Error: 429 comes up?

image

But it works fine when i dont do the error route without Evaluate all states as errors (except for 2xx and 3xx )

Any ideas?

Wow, that’s very odd.
Can’t really say more until we see what you’re running.
The 400 is badly formatted request. The only way I can see changing the Evaluate all states as errors can cause this is if you’ve been running bad requests and just didn’t know it until now.

Is that a possibility?

1 Like