Stay organized with collections
Save and categorize content based on your preferences.
Forces a task to run now. 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, 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. The dispatched task is returned. That is, the task that
is returned contains the 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 schedule_time will be reset to the time that
RunTask was called plus the retry delay specified in the queue's
RetryConfig. RunTask returns NOT_FOUND when it is called on a task that
has already succeeded or permanently failed.
Arguments
Parameters
name
string
Required. The task name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
[[["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-04 UTC."],[],[],null,["# Method: googleapis.cloudtasks.v2.projects.locations.queues.tasks.run\n\nForces a task to run now. When this method is called, Cloud Tasks will\ndispatch the task, even if the task is already running, the queue has\nreached its RateLimits or is PAUSED. This command is meant to be used\nfor manual debugging. For example, RunTask can be used to retry a failed\ntask after a fix has been made or to manually force a task to be\ndispatched now. The dispatched task is returned. That is, the task that\nis returned contains the status after the task is dispatched but before\nthe task is received by its target. If Cloud Tasks receives a successful\nresponse from the task's target, then the task will be deleted;\notherwise the task's schedule_time will be reset to the time that\nRunTask was called plus the retry delay specified in the queue's\nRetryConfig. RunTask returns NOT_FOUND when it is called on a task that\nhas already succeeded or permanently failed.\n\nArguments\n---------\n\nRaised exceptions\n-----------------\n\nResponse\n--------\n\nIf successful, the response contains an instance of [`Task`](/workflows/docs/reference/googleapis/cloudtasks/v2/Overview#Task).\n\nSubworkflow snippet\n-------------------\n\nSome fields might be optional or required.\nTo identify required fields, refer to the [API documentation](https://cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/run). \n\n### YAML\n\n```yaml\n- run:\n call: googleapis.cloudtasks.v2.projects.locations.queues.tasks.run\n args:\n name: ...\n body:\n responseView: ...\n result: runResult\n```\n\n### JSON\n\n```json\n[\n {\n \"run\": {\n \"call\": \"googleapis.cloudtasks.v2.projects.locations.queues.tasks.run\",\n \"args\": {\n \"name\": \"...\",\n \"body\": {\n \"responseView\": \"...\"\n }\n },\n \"result\": \"runResult\"\n }\n }\n]\n```"]]