The total number of times that the task has received a response from the handler. Since Cloud Tasks deletes the task once a successful response has been received, all previous handler responses were failures. This number does not include failures due to 5XX error codes. Populated via the X-CloudTasks-TaskExecutionCount header.
The "short" name of the task, or, if no name was specified at creation, a unique system-generated id. This is the "my-task-id" value in the complete task name, such as "task_name = projects/my-project-id/locations/my-location/queues/my-queue-id/tasks/my-task-id." Populated via the X-CloudTasks-TaskName header.
The number of times this task has been retried. For the first attempt, this value is 0. This number includes attempts where the task failed due to 5XX error codes and never reached the execution phase. Populated via the X-CloudTasks-TaskRetryCount header.
The schedule time of the task, as an RFC 3339 string in UTC time zone. Populated via the X-CloudTasks-TaskETA header, which uses seconds since January 1 1970.
tasks.TaskContext.auth
The result of decoding and verifying an ODIC token.
Signature:
auth?:AuthData;
tasks.TaskContext.executionCount
The total number of times that the task has received a response from the handler. Since Cloud Tasks deletes the task once a successful response has been received, all previous handler responses were failures. This number does not include failures due to 5XX error codes. Populated via the X-CloudTasks-TaskExecutionCount header.
Signature:
executionCount:number;
tasks.TaskContext.headers
Raw request headers.
Signature:
headers?:Record<string,string>;
tasks.TaskContext.id
The "short" name of the task, or, if no name was specified at creation, a unique system-generated id. This is the "my-task-id" value in the complete task name, such as "task_name = projects/my-project-id/locations/my-location/queues/my-queue-id/tasks/my-task-id." Populated via the X-CloudTasks-TaskName header.
Signature:
id:string;
tasks.TaskContext.previousResponse
The HTTP response code from the previous retry. Populated via the X-CloudTasks-TaskPreviousResponse header
Signature:
previousResponse?:number;
tasks.TaskContext.queueName
The name of the queue. Populated via the X-CloudTasks-QueueName header.
Signature:
queueName:string;
tasks.TaskContext.retryCount
The number of times this task has been retried. For the first attempt, this value is 0. This number includes attempts where the task failed due to 5XX error codes and never reached the execution phase. Populated via the X-CloudTasks-TaskRetryCount header.
Signature:
retryCount:number;
tasks.TaskContext.retryReason
The reason for retrying the task. Populated via the X-CloudTasks-TaskRetryReason header.
Signature:
retryReason?:string;
tasks.TaskContext.scheduledTime
The schedule time of the task, as an RFC 3339 string in UTC time zone. Populated via the X-CloudTasks-TaskETA header, which uses seconds since January 1 1970.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[],null,["# tasks.TaskContext interface\n\nMetadata about a call to a Task Queue function.\n\n**Signature:** \n\n export interface TaskContext \n\nProperties\n----------\n\n| Property | Type | Description |\n|------------------------------------------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [auth](./firebase-functions.tasks.taskcontext.md#taskstaskcontextauth) | AuthData | The result of decoding and verifying an ODIC token. |\n| [executionCount](./firebase-functions.tasks.taskcontext.md#taskstaskcontextexecutioncount) | number | The total number of times that the task has received a response from the handler. Since Cloud Tasks deletes the task once a successful response has been received, all previous handler responses were failures. This number does not include failures due to 5XX error codes. Populated via the `X-CloudTasks-TaskExecutionCount` header. |\n| [headers](./firebase-functions.tasks.taskcontext.md#taskstaskcontextheaders) | Record\\\u003cstring, string\\\u003e | Raw request headers. |\n| [id](./firebase-functions.tasks.taskcontext.md#taskstaskcontextid) | string | The \"short\" name of the task, or, if no name was specified at creation, a unique system-generated id. This is the \"my-task-id\" value in the complete task name, such as \"task_name = projects/my-project-id/locations/my-location/queues/my-queue-id/tasks/my-task-id.\" Populated via the `X-CloudTasks-TaskName` header. |\n| [previousResponse](./firebase-functions.tasks.taskcontext.md#taskstaskcontextpreviousresponse) | number | The HTTP response code from the previous retry. Populated via the `X-CloudTasks-TaskPreviousResponse` header |\n| [queueName](./firebase-functions.tasks.taskcontext.md#taskstaskcontextqueuename) | string | The name of the queue. Populated via the `X-CloudTasks-QueueName` header. |\n| [retryCount](./firebase-functions.tasks.taskcontext.md#taskstaskcontextretrycount) | number | The number of times this task has been retried. For the first attempt, this value is 0. This number includes attempts where the task failed due to 5XX error codes and never reached the execution phase. Populated via the `X-CloudTasks-TaskRetryCount` header. |\n| [retryReason](./firebase-functions.tasks.taskcontext.md#taskstaskcontextretryreason) | string | The reason for retrying the task. Populated via the `X-CloudTasks-TaskRetryReason` header. |\n| [scheduledTime](./firebase-functions.tasks.taskcontext.md#taskstaskcontextscheduledtime) | string | The schedule time of the task, as an RFC 3339 string in UTC time zone. Populated via the `X-CloudTasks-TaskETA` header, which uses seconds since January 1 1970. |\n\ntasks.TaskContext.auth\n----------------------\n\nThe result of decoding and verifying an ODIC token.\n\n**Signature:** \n\n auth?: AuthData;\n\ntasks.TaskContext.executionCount\n--------------------------------\n\nThe total number of times that the task has received a response from the handler. Since Cloud Tasks deletes the task once a successful response has been received, all previous handler responses were failures. This number does not include failures due to 5XX error codes. Populated via the `X-CloudTasks-TaskExecutionCount` header.\n\n**Signature:** \n\n executionCount: number;\n\ntasks.TaskContext.headers\n-------------------------\n\nRaw request headers.\n\n**Signature:** \n\n headers?: Record\u003cstring, string\u003e;\n\ntasks.TaskContext.id\n--------------------\n\nThe \"short\" name of the task, or, if no name was specified at creation, a unique system-generated id. This is the \"my-task-id\" value in the complete task name, such as \"task_name = projects/my-project-id/locations/my-location/queues/my-queue-id/tasks/my-task-id.\" Populated via the `X-CloudTasks-TaskName` header.\n\n**Signature:** \n\n id: string;\n\ntasks.TaskContext.previousResponse\n----------------------------------\n\nThe HTTP response code from the previous retry. Populated via the `X-CloudTasks-TaskPreviousResponse` header\n\n**Signature:** \n\n previousResponse?: number;\n\ntasks.TaskContext.queueName\n---------------------------\n\nThe name of the queue. Populated via the `X-CloudTasks-QueueName` header.\n\n**Signature:** \n\n queueName: string;\n\ntasks.TaskContext.retryCount\n----------------------------\n\nThe number of times this task has been retried. For the first attempt, this value is 0. This number includes attempts where the task failed due to 5XX error codes and never reached the execution phase. Populated via the `X-CloudTasks-TaskRetryCount` header.\n\n**Signature:** \n\n retryCount: number;\n\ntasks.TaskContext.retryReason\n-----------------------------\n\nThe reason for retrying the task. Populated via the `X-CloudTasks-TaskRetryReason` header.\n\n**Signature:** \n\n retryReason?: string;\n\ntasks.TaskContext.scheduledTime\n-------------------------------\n\nThe schedule time of the task, as an RFC 3339 string in UTC time zone. Populated via the `X-CloudTasks-TaskETA` header, which uses seconds since January 1 1970.\n\n**Signature:** \n\n scheduledTime: string;"]]