API errors like 429, 503, code 4 DEADLINE_EXCEEDED, code 8 RESOURCE_EXHAUSTED
API errors like those described in the title can occur when sending a large volume of closely-spaced requests, or requests in parallel. It's usually a result of exceeding our recommended rate limiting.
A basic technique for integrations to gracefully handle limiting is to watch for 429
HTTP status codes and build in a retry mechanism. The retry mechanism should follow an exponential backoff schedule to reduce request volume when necessary. We also recommend building some randomness into the backoff schedule to avoid a thundering herd effect.