When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED.
This command is meant to be used for manual debugging. For example, tasks.run can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.
The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.
If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's scheduleTime will be reset to the time that tasks.run was called plus the retry delay specified in the queue's RetryConfig.
tasks.run returns google.rpc.Code.NOT_FOUND when it is called on a task that has already succeeded or permanently failed.
HTTP request
POST https://cloudtasks.googleapis.com/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run
The responseView specifies which subset of the Task will be returned.
By default responseView is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for FULL requires cloudtasks.tasks.fullViewGoogle IAM permission on the Task resource.
Response body
If successful, the response body contains an instance of Task.
[[["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-04-23 UTC."],[],[],null,["# Method: projects.locations.queues.tasks.run\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nForces a task to run now.\n\nWhen this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits](/tasks/docs/reference/rest/v2/projects.locations.queues#RateLimits) or is [PAUSED](/tasks/docs/reference/rest/v2/projects.locations.queues#State.ENUM_VALUES.PAUSED).\n\nThis command is meant to be used for manual debugging. For example, [tasks.run](/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/run#google.cloud.tasks.v2.CloudTasks.RunTask) can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.\n\nThe dispatched task is returned. That is, the task that is returned contains the \\[status\\]\\[Task.status\\] after the task is dispatched but before the task is received by its target.\n\nIf Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [scheduleTime](/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task.FIELDS.schedule_time) will be reset to the time that [tasks.run](/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/run#google.cloud.tasks.v2.CloudTasks.RunTask) was called plus the retry delay specified in the queue's [RetryConfig](/tasks/docs/reference/rest/v2/projects.locations.queues#RetryConfig).\n\n[tasks.run](/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/run#google.cloud.tasks.v2.CloudTasks.RunTask) returns `google.rpc.Code.NOT_FOUND` when it is called on a task that has already succeeded or permanently failed.\n\n### HTTP request\n\n`POST https://cloudtasks.googleapis.com/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Task](/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `https://www.googleapis.com/auth/cloud-tasks`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/)."]]