r/GoogleAppsScript • u/hudson4351 • Sep 23 '25
Question Runtime limitation / trigger question
I am brand new to writing Google Apps scripts and just learned about the 6 minute runtime limit imposed on scripts called from all free accounts. I've also learned about working around it by having the script save state and set a trigger to execute again in the future.
My question is: is there a mandatory "waiting period" before I can have my script called again by the trigger? Or can I let my script run for 6 minutes, then save state and set a trigger for a few seconds later, then run for another 6 minutes, then save state and set a trigger for a few seconds later, etc.?
View all comments
Show parent comment
2
u/hudson4351 Sep 25 '25
My script is written to calculate the size of all messages associated with each label. Given the 6-minute runtime limit, it isn't possible to do this calculation on my mailbox in a single run, so I index the labels and messages, run the script for a few minutes, save the last processed index and size data, set a trigger, and then have the script pick up where it left off on the next execution.