r/GoogleAppsScript • u/AwayPiano • Jan 20 '26
Question Timeout alternatives
Hi all, hope you are doing fine.
At work we have this important process that runs periodically from AppScripts (don't judge, it is what it is). A couple of days ago, we saw a decrease in the run time limit to 6 minutes which affects A LOT this process. I saw you could ask Google for an increase in this limit...
I just wanted to ask if someone went through this process of changing the limit/quota, if there is an alternative that doesn't involve restructuring the code or changing to another language/platform, or what else could we do?
Thank you so much.
4
u/arnoldsomen Jan 20 '26
I don't know what to call it, but what I did was to do batching. It may not work depending on your process.
Basically, my script constantly monitors how much time has passed. At around 5 minutes, it completes the last item then sets a trigger that runs after about a minute to continue processing the next item. So the script should also be able to know what was the last item processed.
2
u/WicketTheQuerent Jan 20 '26
Where did you see that an increase in the script execution time limit can be requested to Google?
2
u/TheAddonDepot Jan 20 '26 edited Jan 20 '26
It has been years since Google rolled back script execution time on paid Google Workspace accounts from 30 minutes to 6 minutes (around 2018 I believe).
I imagine they had been lax with the constraint to give users time to update their code. It appears that grace period is now over, with more and more paid/business-grade Google Workspace account users reporting timeout errors.
You can try requesting for more execution time, but there's no guarantee they'll grant it.
Next best bet is to optimize the code if possible. There are a number strategies you can employ, but we'd need to know more about your use case in order to make viable recommendations.
If all else fails you have the option of migrating to a Google Cloud Run Function; you get up to 1 hour of execution time and 2 million requests per month for ingress under the free tier. You also get the option to configure the number of concurrent invocations the Cloud Run Function can handle (whereas GAS doPost/doGet triggers are limited to 30). But you'll need to enable billing on a GCP project to use it, and if you go over the free tier quotas your account will get charged.
2
u/aledesousa Jan 20 '26
The name of what you need is "chaining." It's basically what someone mentioned here, calling it "batching." Ask an AI to help you, describe the problem, and say you need a chaining strategy. Basically, it's about monitoring so that the script finishes before 6 minutes and automatically creating a trigger to reprocess in 10 seconds. You might need to use properties like memory to save where the last execution was and resume from where it left off.
5
u/Ok_Persimmon_1826 Jan 20 '26
I have the same issue, scripts that were working last week, are no longer working today, they give an "Exceeded maximum execution time". My account is Workspace, it should've been 30' process time limit. Anyone else notice this change?
4
u/covalent_blond Jan 20 '26
All of my timed scripts broke too this week. Insane that Google would push such a huge detrimental change with no warning!
4
u/jpoehnelt Jan 21 '26
The team has identified unexpected behavior regarding this issue and is currently working to mitigate it.
https://issuetracker.google.com/issues/477036017#comment13
Note: I am on the Google Workspace Developer Relations team. I am
jp...@google.comin this issue tracker, please don't email me though :)3
u/darthvidrider Jan 21 '26
This hit me hard too yesterday. I'm now going script by script and rebuilding it to iterate on loops with automated triggers so that each run will be less than 6 minutes. Crap.
3
u/WicketTheQuerent Jan 20 '26 edited Jan 21 '26
Here is an issue posted today in the official issue tracker.
Apps Script execution time incorrectly limited to 6 minutes for Workspace accounts . So far, it has 43 "+1" votes
---
UPDATE: The above-linked issue has a status of Won't fix (Intended Behavior).
NEW UPDATE: The issue was reopened. The new status is Assigned.
1
u/SavingsPoem1533 Jan 20 '26
Is your script running through the entire data set to look for criteria for the trigger?
I have a log for lot numbers for product and my label printer automatically prints out a new lot #, but it goes through every row to check for a specific column and then spits out the lot # that is "unprocessed"
I used to do this every 5 minute trigger but it was eating up the quota so I set up the trigger to run during specific times of the business day.
1
u/everythingabili Jan 20 '26
Here's how to FIX this (sorta)...
https://static.everythingability.opalstacked.com/OpinionatedAppsScriptExport/examples/running-long-running-scripts.html
1
u/microbitewebsites Jan 20 '26
I also noticed my scripts need to be triggered a few times before they run, I thought maybe it is my best internet connection / browser, or slow macbook air.
1
u/[deleted] Jan 20 '26
[removed] — view removed comment