schedule_delay_seconds – The number of seconds after the current time at which to attempt orretry the task. Should only be set ifschedule_time is not set.
schedule_time – The time when the task is scheduled to be attempted or retried. Should onlybe set ifschedule_delay_seconds is not set.
dispatch_deadline_seconds – The deadline for requests sent to the worker. If the worker doesnot respond by this deadline then the request is cancelled and the attempt is marked asaDEADLINE_EXCEEDED failure. Cloud Tasks will retry the task according to theRetryConfig. The default is 10 minutes. The deadline must be in the range of 15seconds and 30 minutes (1800 seconds).
task_id –
The ID to use for the enqueued task. If not provided, one will be automaticallygenerated.
If provided, an explicitly specified task ID enables task de-duplication.Task IDs should be strings that contain only letters ([A-Za-z]), numbers ([0-9]),hyphens (-), and underscores (_) with a maximum length of 500 characters. If a task’sID is identical to that of an existing task or a task that was deleted or executedrecently then the call will throw an error with codefunctions/task-already-exists.Another task with the same ID can’t be created for ~1hour after the original task wasdeleted or executed.
Because there is an extra lookup cost to identify duplicate task IDs, setting IDsignificantly increases latency.
Also, note that the infrastructure relies on an approximately uniform distributionof task IDs to store and serve tasks efficiently. For this reason, using hashed stringsfor the task ID or for the prefix of the task ID is recommended. Choosing task IDs thatare sequential or have sequential prefixes, for example using a timestamp, causes anincrease in latency and error rates in all task commands.
Push IDs from the Firebase Realtime Database make poor IDs because they are based ontimestamps and will cause contention (slowdowns) in your task queue. Reversed push IDshowever form a perfect distribution and are an ideal key. To reverse a string in PythonusereversedString=someString[::-1]
headers –
HTTP request headers to include in the request to the task queue function. Theseheaders represent a subset of the headers that will accompany the task’s HTTP request.Some HTTP request headers will be ignored or replaced:Authorization,Host,Content-Length,User-Agent and others cannot be overridden.
[[["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 2025-03-12 UTC."],[],[]]