I am using the API through Google Drive, and it’s working, but it’s giving me errors at about 5 minutes of processing time. I’m getting these:
Error Exceeded maximum execution time
and
Function execution has timed out. Restart the debugger to continue debugging.
In the five minutes, it processes anywhere from 20-65 images (resize, center, white background, soft shadow, snap to edge, 5% padding, no border.)
I was under the impression I could do considerably more images at one times. I’m not worried about speed - I realize it’s doing several AI enhancements to each image, but the “saving time and money” concept is not present if I have to sit at my desk watching for the error message, and not able to set it to process while I attend to other duties, go to lunch, or whatever.
My goal is to process 5,000 images in a day, but not have to babysit them.
Ideas?
Hi there,
Thanks for flagging this.
For context, Google Apps Script has a 6-minute maximum execution time limit per function call. Are you using the Google Sheets template from our guide, or a custom script?
Thanks in advance for the added context
I am using the script created in the sandbox, pulling them images from a folder in Google drive and dumping the processed photos in to a second folder in Google drive.
Is there a better way to edit a larger quantity of photos while walking away for longer than six minutes and letting it just work in the background?
A few best practice recommendations:
- Split processing into smaller batches (e.g. 20–50 images per run).
- Use a time-driven trigger in Apps Script (e.g. every 10 minutes) so it auto-runs repeatedly.
- Use the “resume” logic in the PhotoRoom tutorial so you don’t lose your place if the script times out.
Perhaps a few other alternatives to explore:
- A standalone Apps Script as in the Drive-based template
- Zapier automation if you prefer no-code
- Or a Python/cloud script (no timeout limits)
Let us know if you have further questions!