r/GoogleAppsScript • u/MarionberryTotal2657 • Jan 24 '26
Unresolved How to bypass the 6min execution limit?
Has anyone found a workaround/solution to this?
8
Upvotes
r/GoogleAppsScript • u/MarionberryTotal2657 • Jan 24 '26
Has anyone found a workaround/solution to this?
7
u/Suspicious_Rice_1898 Jan 24 '26
If you are asking because you recently went from a 30 minute run time to 6 minutes. You should be back up to 30. https://issuetracker.google.com/issues/477036017#comment20
If looping, time your loop and exit at 5 minutes. Record your data and stick the iteration number in a script or user property with PropertyService. End your loop by creating a trigger and start your loop by deleting all the triggers for your loop function. I set up a function to run daily that just created a minute trigger for my loop function. Loop runs and deletes trigger and creates the next trigger at the end.
I was only doing this because I recently went from 30 to 6 minute execution time. I did not finish it all but I found it easier to use appendrow for each iteration of the loop. With 30 minute execution time I was building arrays and writing them at the end of the script. I tried to stringify JSON objects and store them in user scripts but in the end appendrow was best for the script I was working on. If the script wasn't in a sheet container I may have explored that more to see if it was viable.
2
u/Chibrax_3000 Jan 24 '26
It depends on why you need to extend that time.
If, for example, you've made a request to an API that's taking a while to respond, you can store your request parameters in the script's properties, then register a trigger that will query the API again an hour later, and loop through until the issue is resolved.
2
u/dimudesigns Jan 24 '26 edited Jan 24 '26
For personal/consumer accounts the 6-minute execution quota is a strict limit, you cannot modify the quota. There are strategies you can use to work within that constraint like splitting your workloads into smaller batches that can be run within a 6-minute interval. Try using Gemini to explore that option.