Flosight.

reliability

Rate Limits, and the Integration That Got Itself Blocked

A 429 is an instruction, not an error. Reading it properly is the difference between a brief slowdown and an account the other side has stopped answering.

The worst outage an integration can cause is not the one where the other side goes down. It is the one where the other side is fine and has decided to stop answering you specifically.

That outcome has a reliable recipe. Send too fast, get a 429, treat it as a generic error, retry immediately, get another 429, retry again. Within a minute you have multiplied your request rate at exactly the moment you were asked to reduce it, and the other side escalates from throttling to blocking.

The status is an instruction

RFC 6585 defines 429 Too Many Requests, and the definition is specific: the user has sent too many requests in a given amount of time. It is not a failure of the request. The request was understood and refused on grounds of rate.

It normally arrives with a Retry-After header, defined in RFC 9110, carrying either a number of seconds or an HTTP date. That header is the server telling you exactly when it will be willing to talk again.

Honour it. Not approximately, not with your own shorter number because the job is urgent. The header is the only piece of information in the exchange that comes from the side that knows the answer, and backing off faster than asked is the behaviour that turns throttling into a ban.

If there is no Retry-After, fall back to exponential backoff with jitter, for the reasons the AWS builders' library piece sets out: without jitter every blocked client retries on the same schedule and the recovery attempt becomes the next outage.

Do not get there in the first place

Reacting well to a 429 is the second-best outcome. The best is not generating one.

Most APIs publish their limits. Most integrations never read them, because during development the volume is three requests and nothing throttles. The limit is discovered in production, by a customer-facing workflow, on the busiest day.

Two mechanisms prevent it, and the cheaper one is usually enough.

A client-side ceiling. Decide the maximum rate you will send at, below the published limit, and enforce it in your own code. A token bucket is the standard shape: tokens accumulate at a fixed rate up to a cap, each request spends one, and a request with no token available waits. It smooths bursts without serialising everything.

A single queue per destination. The common cause of accidental bursts is concurrency: eight workers each politely sending one request a second produce eight requests a second. The limit applies to your account, not to your worker, so the rate control has to live where the account does.

Bulk is not many singles

The other reliable way to hit a limit is to do in a loop what the API offers in one call.

Many APIs have a batch endpoint that accepts a hundred items and counts as one request. Sending a hundred individual requests does the same work, takes a hundred times the quota, and is slower. The loop usually exists because it was written first, when there were three items, and nobody revisited it when the list grew.

Before building any sync that iterates, check whether the endpoint has a plural form. It usually does.

Watch the headers you are already being sent

Plenty of APIs tell you where you stand on every single response, in headers along the lines of a limit, a remaining count and a reset time. The names vary; the information is the same.

Reading those turns rate limiting from an incident into a dial. If remaining drops below a threshold, slow down before you are told to. Logging the remaining count at the end of each batch gives you a free early warning of a workflow that has quietly started doing ten times as much work.

Almost nobody reads them. They cost one line.

The failure that looks like success

The worst handling of a 429 is not aggressive retrying. It is silent swallowing.

A workflow that catches the 429, logs it at debug level and moves on has produced a run that completed successfully and did not do the work. Nobody is told. The dashboard is green. The customers who were in the throttled portion of the batch simply did not get their message, and the only evidence is an absence.

If a step is rate limited and cannot be completed within its retry budget, that run failed. It belongs in the dead letter queue, with the destination and the reset time attached, and it belongs in whatever a person looks at.

The audit

Three questions about any integration you run.

What is the published limit, and what is your ceiling? If the answer to the second is "we do not have one", you are relying on the other side to be gentle with you.

When a 429 arrives, do you read Retry-After? Not catch it. Read it.

If a batch is throttled halfway, does the run report success?

A no to the first, a no to the second, and a yes to the third is the exact combination that produces a blocked account, and it is the default behaviour of most code written without reading this page.

Sources

More on this