[Solved] How to solve execution time issue of AppScripts for non-G suite users?


There are two things you can do:

  1. If you deploy your script as a WebApp, you can execute it as “You” – that is the user from a GSuite domain who has an execution limit of 30 min.

  2. Design your script in a different way.

  • Instead of waiting 10 minutes with Utilities.sleep(), incorporate a time-driven trigger
  • You can do so with the trigger builder
  • This means – end the current function and specify that the continuation of the script (embedded in the second function) will start running 10 minutes later
  • The time inbetween will not count as execution time and will not lead to a timeout.

Sample:

function myFirstFunction(){
// do something
//now set-up the trigger:
    ScriptApp.newTrigger("mySecondFunction").timeBased().after(10*60*1000).create();
}

// will be called after the amount of seconds specified in `after()`
function mySecondFunction(){
//now implement the rest of your code
}

3

solved How to solve execution time issue of AppScripts for non-G suite users?