google_cloud_tasks_queue cost estimation
Managed task queue for HTTP/gRPC targets. First 1M tasks/month free, then $0.40 per million tasks. No queue infrastructure to manage. Tasks call HTTP endpoints (Cloud Run, Cloud Functions, GKE services) with retry and rate limiting.
Cloud Tasks is GCP's managed task queue for asynchronous HTTP/gRPC dispatch. The google_cloud_tasks_queue resource creates a queue; tasks are enqueued via API and dispatched to HTTP targets. Pricing is simple: per-task with a free tier.
Pricing: - First 1 million tasks/month: free - Beyond 1M: $0.40 per million tasks - No per-queue fee - No data transfer for HTTP delivery (typical egress rates if target is internet)
A typical workload: 50M tasks/month = (50 - 1) × $0.40 = $19.60/month. Even at 500M tasks, only $200/month — Cloud Tasks is one of the cheapest GCP services.
When Cloud Tasks wins: - Async work that needs to call an HTTP endpoint (Cloud Run, Cloud Functions, etc.) - Rate-limited dispatch (workflow A can't overwhelm service B) - Retry on failure - Scheduled tasks (run at specific time) - Deduplication (idempotent task IDs)
When Pub/Sub is better: - Pub/sub patterns with multiple subscribers - Stream processing - Event-driven architectures - Higher throughput needs
When Workflows is better: - Multi-step processes with conditionals - State management between steps - Long-running workflows (hours/days)
Cloud Tasks is sometimes called "the simpler Pub/Sub" — purpose-built for HTTP task dispatch with retry, rate limiting, and scheduling.
c3x estimates Cloud Tasks based on expected task volume from c3x-usage.yml.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_cloud_tasks_queue" "email" {
name = "send-emails"
location = "us-central1"
rate_limits {
max_concurrent_dispatches = 50
max_dispatches_per_second = 10
}
retry_config {
max_attempts = 5
min_backoff = "1s"
max_backoff = "300s"
max_doublings = 3
max_retry_duration = "300s"
}
}Pricing dimensions
What you actually pay for when you provision google_cloud_tasks_queue.
| Dimension | Unit | What's being charged |
|---|---|---|
| Task operations | per million tasks | Each task enqueued counts as one operation. First 1M free per billing account per month. $0.40 per 1M tasks (after free tier) |
| Data transfer | per GB | Egress if task targets are outside GCP. Internal GCP-to-GCP is free for most regions. Standard GCP egress rates |
Optimization tips
Common ways to reduce google_cloud_tasks_queue cost without changing the workload.
Stay within the free tier
100% under 1M tasks/month1M tasks/month is genuinely free. For small workloads, Cloud Tasks costs $0. Many internal automation, low-volume async work fits within this tier.
Batch task enqueueing
Use BulkAdd to enqueue many tasks in a single API call (up to 1,000 tasks). Reduces API call count, easier on rate limits. Cost is the same per-task but lower client overhead.
Set max_attempts appropriately
Each retry counts as additional task dispatch attempts (but the same enqueue). For tasks that should succeed eventually, lower max_attempts can reduce wasted retries when targets are persistently failing.
Use Cloud Tasks for HTTP, Pub/Sub for events
Cloud Tasks is purpose-built for 'invoke this HTTP endpoint with these arguments'. For event-driven 'something happened, multiple subscribers care', Pub/Sub is the right choice. Don't use Cloud Tasks as a generic message bus.
FAQ
How does Cloud Tasks compare to Pub/Sub?
Cloud Tasks is for HTTP/gRPC task dispatch with rate limiting and retries (1:1 producer-consumer-like). Pub/Sub is for event distribution to multiple subscribers (1:many fan-out). For 'call this endpoint when this happens', Cloud Tasks. For 'tell all interested services that this happened', Pub/Sub.
Are scheduled tasks more expensive than immediate tasks?
No, same per-task rate. Scheduled tasks (scheduleTime in the future) are stored until dispatch time. No additional cost for the delay.
What's the latency of task dispatch?
Typically sub-second for immediate tasks. Scheduled tasks dispatch within ~30 seconds of the scheduled time. Cloud Tasks is designed for async work where seconds-level latency is acceptable, not for real-time event processing (use Pub/Sub Lite or Eventarc for that).
Can I rate-limit dispatch to my target?
Yes. max_dispatches_per_second and max_concurrent_dispatches let you cap the rate at which Cloud Tasks calls your target. Critical for protecting downstream services from being overwhelmed by queued work bursts.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including google_cloud_tasks_queue.