The budget is tokens, and endpoints cost different amounts
Most APIs give you a request count. Pipedrive gives a company a daily token budget and charges each call against it according to what that call costs to serve. The published model starts from a base allocation of 30,000 tokens and scales it by the plan and by seat count, which means the same integration behaves completely differently on a two-seat Essential account and a forty-seat Enterprise one.
The consequence for design is that request count is the wrong thing to optimise. A workflow issuing 2,000 cheap GETs by ID can be well inside budget while a workflow issuing 500 search calls is not, because search is markedly more expensive per call. Anyone tuning a Pipedrive integration by counting requests is optimising the wrong number.
daily budget = 30,000 x plan factor x seat count
# The practical implication, not the arithmetic:
# GET /api/v2/deals/901 cheap — a keyed read
# GET /api/v2/deals?limit=100 cheap per RECORD, one call
# GET /api/v2/deals/search?term=... expensive — several times a keyed read
#
# 500 searches can outspend 2,000 keyed reads.
# Count cost, not calls.
Honour Retry-After instead of guessing
A Pipedrive 429 carries a Retry-After header telling you how long to wait. Honouring it is strictly better than an invented delay: too short and you re-collide immediately, too long and the job runs for hours longer than it needed to. Layer exponential backoff with jitter on top for the case where Retry-After is absent, capped so a stuck job fails visibly rather than sleeping forever.
Classify before retrying, as with any API. A 429 is worth retrying; a 400 on an invalid field never is, and a 401 means the token is wrong rather than exhausted. Retrying everything uniformly spends the retry budget on failures that cannot succeed and hides the real pattern.
// n8n: HTTP Request node with "never error" / error-output enabled
const status = $json.statusCode ?? $json.error?.statusCode;
if (status === 429) {
const retryAfter = Number($json.headers?.['retry-after']) || 0;
const attempt = $json.attempt ?? 0;
const waitMs = retryAfter > 0
? retryAfter * 1000
: Math.min(60000, 1000 * 2 ** attempt) + Math.floor(Math.random() * 500);
return [{ json: { ...$json, attempt: attempt + 1, waitMs } }];
}
// 400 / 401 / 404 -> dead-letter branch, never the retry branch
Reducing cost beats slowing down
Because the budget is daily and cost-weighted, pacing a job more slowly does not change how much of the budget it spends — it spends the same tokens later. The only durable fixes remove work.
The largest single win in most Pipedrive workflows is replacing per-item search with a keyed read. Searching for a person by email on every one of 5,000 rows is 5,000 expensive calls; storing the Pipedrive person ID against your own record the first time and reading by ID thereafter turns those into cheap ones. The second largest is fetching field definitions once per execution instead of once per item — a metadata call inside a loop is pure overhead that produces no business value.
Pagination matters too. The v2 endpoints page with an opaque cursor rather than an offset, which is both cheaper and correct under concurrent writes: an offset-based page walk over a changing dataset re-reads and skips records, so it costs more tokens and returns worse data at the same time.
# One call, 100 records, one cost
GET https://COMPANY.pipedrive.com/api/v2/deals?limit=100
x-api-token: YOUR_TOKEN
# -> { "data": [...],
# "additional_data": { "next_cursor": "eyJpZCI6OTAxfQ" } }
GET https://COMPANY.pipedrive.com/api/v2/deals?limit=100&cursor=eyJpZCI6OTAxfQ
# next_cursor === null -> last page
# vs. the expensive shape this usually replaces:
# for each of 5,000 rows:
# GET /api/v2/persons/search?term=<email> <- 5,000 expensive calls
# Persist person_id on first resolution and read by ID afterwards.
The budget belongs to the company, not to your integration
The daily allocation is a company-wide figure. Your n8n workflows, a reporting tool, a marketing sync and anything a colleague built against the same account all draw from it. A backfill that consumes the day's tokens by lunchtime takes every other integration down with it, and the owners of those integrations will see 429s they did nothing to cause.
Before a bulk job, estimate its cost in the same terms — records multiplied by the calls each record genuinely makes, weighted toward search if the design uses it — and leave a reserve for the interactive and webhook traffic that has to keep working. If the estimate does not leave a reserve, split the job across days or redesign it to use keyed reads. Checkpoint the job so a mid-run exhaustion resumes rather than restarting, and make writes idempotent so a resume cannot duplicate records that were already created.
A blanket sleep between every request is the reflex fix and it does not work here. The budget is consumed per day, not per second — slowing down spreads the same spend over more hours and still exhausts it.
Planning a backfill against a budget you share
A bulk job is the usual cause of a company-wide exhaustion, and it is also the easiest one to make safe, because its cost is knowable in advance. Count the calls the job makes per record, weight the expensive ones, and compare the total against the allocation with a reserve left for everything else the company runs against Pipedrive.
Then make the job resumable. Checkpoint the last confirmed source row and the Pipedrive ID it produced, so an exhaustion at 60% completion resumes rather than restarts — restarting doubles the spend and, without idempotency, doubles the records. Pair the checkpoint with a deterministic idempotency key stored on the record so a resumed run recognises its own earlier writes.
Run it in a quiet window, and stop it on the first sustained 429 rather than letting it grind. A worker that keeps retrying into an exhausted budget consumes nothing but time and makes the recovery slower for everyone else on the account.
- Estimate cost before starting: records x calls per record, weighted for search.
- Leave a reserve for interactive and webhook traffic — it is the same budget.
- Checkpoint every chunk; never restart a large job from zero.
- Use a deterministic idempotency key so a resume cannot duplicate.
- Stop on sustained 429s instead of retrying into an exhausted allocation.
Where these facts come from