TooManyRequestsError for Particle batch upload

Pretty new to the Losant platform, so I apologist in advance if this has been discussed already.

I am getting the “TooManyRequestsError Over rate limit, request throttled. Retry in 0 seconds.” error in my workflow responsible for saving the state of my particle devices. (workflow ID: 5cec9559b98fb3000841918e)

My particle devices generally connect and upload data twice a day, because of the limited size of particle publishes, my data is generally broken into 2 to 4 different payloads and sent to losant (through the particle integration)

Rough outline of the workflow: Particle -> JSON decode -> Loop on JSON (-> get device from particle id -> save state) -> debug

The state node is raising the TooManyRequestsError.

Side note, the get device being in the loop is probably not the best, I just haven’t gotten around to moving it out.

There are normally 18 elements with 3 attributes to save the state of in each payload.

The hitch is that I have multiple devices that report at the same time, but the individual payloads are received approximately 1 second apart.

Based on the documentation this is the only way I could see to implement batch uploading with time values in the past.

Currently everything is “working”, I just loose small chunks of data when the node errors out.

Hi @Jonas_Armes,

So, you are experiencing throtletting in the Device State Node. As of now, here are the throttling limits:

The Device State Node has the same throttling rules as using the API or the broker to set state - it is limited to 30 calls in a 15-second window (per device) - on average, 2 calls per second.

There are really two main ways to solve this problem:

Report State In Batches - This would remove the need for a loop and you’ll be able to send your state reports in one request.

Delay Node - The Delay Node would allow you to add a slight delay to your Workflow to avoid hitting the limit. But, keep in mind that Workflows timeout overall at 60 seconds.

Let me know if this helps :slight_smile:

Thanks!

That is a HUGE help, guess I missed that part of the documentation :grimacing:

1 Like