Create a Google Cloud Tasks queue to reliably execute HTTP endpoints with rate limiting and retry
domain: cloud.google.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Create a queue in a specific location using the Cloud Tasks API or gcloud tasks queues create, which by default gets sensible rate-limit and retry defaults
Configure the queue's rate limits by setting max_dispatches_per_second (the system derives max_burst_size automatically from this value) to bound how fast tasks are dispatched, whether first attempts or retries
Configure retry behavior with MIN_INTERVAL and MAX_INTERVAL (exponential backoff bounds), MAX_DOUBLINGS (how many times the retry interval doubles before becoming constant), and MAX_ATTEMPTS/MAX_RETRY_DURATION to bound total retry attempts and time
Enqueue tasks targeting an HTTP endpoint (an HTTP target task) by specifying the URL, method, headers, and body; a task attempt is considered successful only if the endpoint returns an HTTP status in the 200-299 range
Handle transient overload gracefully: if the worker returns 429 or 503, or the observed error rate is high, Cloud Tasks automatically increases its backoff rate for that queue
Monitor queue depth and task attempt counts via Cloud Monitoring to detect endpoints that are failing persistently
Known gotchas
If MAX_ATTEMPTS is not -1 (unlimited) and MAX_RETRY_DURATION is greater than zero, Cloud Tasks stops retrying once EITHER condition is satisfied (not just when both are exhausted) — read the exact combination semantics in the current docs before relying on a specific retry count
Any non-2xx response, or no response before the task's dispatch deadline, counts as a failed attempt and triggers a retry — a slow-but-eventually-successful endpoint can still be retried and cause duplicate processing, so handlers must be idempotent
Rate limits apply to total dispatch rate (first attempts plus retries combined) — a queue under heavy retry load will dispatch fewer first-time tasks per second, not more
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?