0
votes

I have a Google Sheets budgeting spreadsheet that uses the javascript functionality to automatically add a new sheet for each week (based on the current date when the spreadsheet is opened). I have been using iterations of this script for years now.

Just recently the script started timing out on me. [EDIT: In the past I have used this same script to add and update multiple sheets at a time. Now I can't seem to add even one sucessfully.] However, if I open the script editor and run the function from there, it works perfectly. In the execution log I can see that a trigger execution times out at about 30sec, but an editor execution works every time, and takes about 40sec.

While typing this, I noticed on Google's quotas there is a 30sec runtime limit per custom function. Why is it different when triggered from the editor?

1
From here: "The limits shown below are provided solely to assist you in testing scripts. All limits are subject to elimination, reduction, or change at any time, without notice." I think that's them saying "because we said so."Calculuswhiz
Hmm. . . yeah. . .Aaronfuzion
Is your script in V8 runtime version?Mateo Randwolf
It wasn't, but when I noticed that it wasn't finishing properly, I opened the editor and saw the V8 message, and I switched over. So as of the time of the OP, yes, it was in V8. It seems to be behaving the same way in V8 as it was before I switched.Aaronfuzion

1 Answers

0
votes

According to the offical quota limitations Apps Script scripts (i.e those run from the script editor or with a trigger like onEdit() ) have a timeout limitation of 6 minutes per execution while custom functions just have a timeout limitation of 30 seconds per execution.

These custom functions are Apps Script functions created to be used in the SpreadSheet as formulas and therefore they run differently and have a different timeout time per execution.

I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)