When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached itsRateLimitsor isPAUSED.
This command is meant to be used for manual debugging. For example,tasks.runcan 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 thestatusafter 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'sscheduleTimewill be reset to the time thattasks.runwas called plus the retry delay specified in the queue'sRetryConfig.
tasks.runreturnsgoogle.rpc.Code.NOT_FOUNDwhen it is called on a task that has already succeeded or permanently failed.
HTTP request
POST https://cloudtasks.googleapis.com/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run
The responseView specifies which subset of theTaskwill be returned.
By default responseView isBASIC; 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 forFULLrequirescloudtasks.tasks.fullViewGoogle IAMpermission on theTaskresource.
Response body
If successful, the response body contains an instance ofTask.
[[["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-09-05 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/v2beta3/projects.locations.queues#RateLimits) or is [PAUSED](/tasks/docs/reference/rest/v2beta3/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/v2beta3/projects.locations.queues.tasks/run#google.cloud.tasks.v2beta3.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/v2beta3/projects.locations.queues.tasks#Task.FIELDS.schedule_time) will be reset to the time that [tasks.run](/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks/run#google.cloud.tasks.v2beta3.CloudTasks.RunTask) was called plus the retry delay specified in the queue's [RetryConfig](/tasks/docs/reference/rest/v2beta3/projects.locations.queues#RetryConfig).\n\n[tasks.run](/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks/run#google.cloud.tasks.v2beta3.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/v2beta3/{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/v2beta3/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/)."]]