Stay organized with collections Save and categorize content based on your preferences.
This page describes how to create Cloud Tasks queues. When tasks are added to a queue, the queue dispatches them and makes sure they are reliably processed by a service, also known as a worker.
Note the following:
Queue names consist of three parts: a project ID, a location, and a queue ID. You must have a Google Cloud project which provides the project ID.
If you are using App Engine target tasks, you must also have an App Engine application which is located in a specific region and which is where your queue and your handlers run. Note the region when you add the app.
Note: Two locations, calledeurope-west
and us-central
in App Engine commands, are called, respectively, europe-west1
and us-central1
in Cloud Tasks commands.Using HTTP Target tasks doesn't require an App Engine app. You select a Google Cloud location when you create your queue.
You can create a queue in the following ways:
In the Google Cloud console, go to the Cloud Tasks > Queues page.
Click add_box Create queue.
Enter a Queue name—for example, my-queue
.
In the Region list, select a supported location where the queue will run—for example, asia-south1
.
If your organization restricts resource location and you want to create your queue in either us-central1
or us-central2
, the organization policy must allow queue creation in both us-central1
and us-central2
(even if you only need a queue in one of those regions).
Optionally, you can further configure your queue.
Click Create.
Use the gcloud tasks queues create
command to create your queue:
gcloud tasks queues create QUEUE_ID \ --location=LOCATION
Replace the following:
QUEUE_ID
: the identifier you assign to your queue—for example, my-queue
.
LOCATION
: a supported region where the queue will run—for example, asia-south1
.
If your organization restricts resource location and you want to create your queue in either us-central1
or us-central2
, the organization policy must allow queue creation in both us-central1
and us-central2
(even if you only need a queue in one of those regions).
Other flags for the gcloud CLI command let you configure rate limits, retry options, queue types, and more.
REST APITo create a queue, use the projects.locations.queues.create
method.
Before using any of the request data, make the following replacements:
PROJECT_ID
: your Google Cloud project ID.LOCATION
: a supported region where the queue will run—for example, asia-south1
.
If your organization restricts resource location and you want to create your queue in either us-central1
or us-central2
, the organization policy must allow queue creation in both us-central1
and us-central2
(even if you only need a queue in one of those regions).
QUEUE_ID
: the identifier you assign to your queue—for example, my-queue
.Queue
resource include rate limits, retry options, queue types, and more.
Request JSON body:
{ "name": "projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID" }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
. Run the following command in the terminal to create or overwrite this file in the current directory:
cat > request.json << 'EOF' { "name": "projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID" } EOF
Then execute the following command to send your REST request:
curl -X POST \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudtasks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/queues"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
. Run the following command in the terminal to create or overwrite this file in the current directory:
@' { "name": "projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID" } '@ | Out-File -FilePath request.json -Encoding utf8
Then execute the following command to send your REST request:
$cred = gcloud auth print-access-tokenAPIs Explorer (browser)
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudtasks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/queues" | Select-Object -Expand Content
Copy the request body and open the method reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and click Execute.
If successful, the response body contains a newly created instance of Queue
:
{ "name": "projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID", "rateLimits": { "maxDispatchesPerSecond": 500, "maxBurstSize": 100, "maxConcurrentDispatches": 1000 }, "retryConfig": { "maxAttempts": 100, "minBackoff": "0.100s", "maxBackoff": "3600s", "maxDoublings": 16 }, "state": "RUNNING" }
It can take a few minutes for a newly created queue to be available.
Describe your queueYou can confirm that your queue was created successfully in the following ways:
By sending a direct request to the Cloud Tasks API
In the Google Cloud console, go to the Cloud Tasks > Queues page.
A green checkmark check_circle should indicate that your queue is running.
For more details, click the name of the queue, and then click the Configuration tab.
Use the gcloud tasks queues describe
command to verify that your queue was created successfully:
gcloud tasks queues describe QUEUE_ID \ --location=LOCATION
Replace the following:
QUEUE_ID
: the queue ID (its short name)LOCATION
: the location of the queueThe output should be similar to the following:
name: projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID rateLimits: maxBurstSize: 100 maxConcurrentDispatches: 1000 maxDispatchesPerSecond: 500.0 retryConfig: maxAttempts: 100 maxBackoff: 3600s maxDoublings: 16 minBackoff: 0.100s state: RUNNINGREST API
To retrieve a queue, use the projects.locations.queues.get
method.
Before using any of the request data, make the following replacements:
PROJECT_ID
: your Google Cloud project ID.LOCATION
: the region in which the queue is deployed—for example, us-central1
.QUEUE_ID
: the short ID of the queue—for example, my-queue
.To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X GET \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudtasks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-tokenAPIs Explorer (browser)
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://cloudtasks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID" | Select-Object -Expand Content
Open the method reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Complete any required fields and click Execute.
If successful, the response body contains an instance of Queue
:
{ "name": "projects/PROJECT_ID/locations/LOCATION/queues/QUEUE_ID", "rateLimits": { "maxDispatchesPerSecond": 500, "maxBurstSize": 100, "maxConcurrentDispatches": 1000 }, "retryConfig": { "maxAttempts": 100, "minBackoff": "0.100s", "maxBackoff": "3600s", "maxDoublings": 16 }, "state": "RUNNING" }Troubleshoot creating a queue Note: Logging for your queue is not enabled by default. For information on enabling logging, see Use Cloud Logging with queues.
If you don't see the expected output, you can try the following:
Make sure a queue with the same ID does not already exist. You can view the queues in your project by using the gcloud tasks queues list
command:
gcloud tasks queues list \ --location=LOCATION
To search multiple locations you need to make multiple requests.
Check if you've reached your queue quota:
In the Google Cloud console, go to the API/Service Details page for the Cloud Tasks API .
Click the Quotas & System limits tab.
To increase a quota, in the row for the quota, click the ellipsis icon more_vert> Edit quota.
For more information, see Request a quota adjustment.
Re-run the commands to create your queue and ensure that each step is completed correctly.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4