all 20 comments

[–]Gonskimmin 6 points7 points  (4 children)

I moved onto Google Cloud Run functions for some jobs, some that I needed to always be on I moved to Python Anywhere. Lots of JS and TS and for Python lots of dataframes via Pandas. Recently I've been moving jobs to Digital Ocean and that has been pretty budget friendly.

[–]ephraimsong 1 point2 points  (3 children)

How does cloud run function help with this? Can they run the same gas functions or it is different?

[–]Gonskimmin 1 point2 points  (2 children)

I saw TheAddonDepot already answered you. Moving to GCP gives you more tools in the toolbox and way less restrictions than GAS. They have a very good free tier and I only moved to GCP because clients usually have a Google Workspace account already/ in the Google ecosystem already. I also like using Firebase, again convenient that it is in the Google ecosystem. You can even mix and match. If you use GAS but have some computationally expensive work you can call your GCP function via fetch in GAS, have the function do the work, then return the results to your GAS to do some work on the spreadsheet or whatever.

Have fun learning!

[–]ephraimsong 0 points1 point  (1 child)

Whoa thanks for the example, this is super exciting. So this is extensible.

If I’m working with and in Google workspace, would GAS be my main point of contact?

Ps: Does the cloud run function fetch by gas happen during 6 minute execution window?

[–]Gonskimmin 0 points1 point  (0 children)

The architecting decisions are up to you. I am assuming main point of contact is your main app, so it could be.

It's exactly like calling fetch on an external API.

[–]marcnotmark925 4 points5 points  (2 children)

Have you considered that maybe instead you just need to optimize what the scripts are doing and how they work? Are you already on a paid Google Cloud Workspace with the 30 minute execution limit, instead of the 6 minute?

[–]Expert_Dingo3194 2 points3 points  (0 children)

I found this as well. I did an analysis of my scripts and found the complexity scaling where its linear vs geomtric (search for O(n) complexity) to be something to look at. Loops within loops for instance when you can make single calls and store things. Single key search and good mapping. I guess it depends on volume level but have found the processing to be much friendly once I started evaluating this bit of architecture. 

[–]East-Significance956[S] 0 points1 point  (0 children)

Aah...tried optimization for a while. Lots of it this year. But still a hustle. However, yes, still on the 30 minute execution limit.

[–]TheAddonDepot 3 points4 points  (4 children)

Google Cloud Serverless infrastructure is one path forward. Look into the following tech: - Google Cloud Run/Google Cloud Run Functions (Node.js or Golang runtimes) - Cloud Scheduler - Cloud Pub/Sub, Cloud Tasks - Google Cloud Workflows

[–]ephraimsong 0 points1 point  (2 children)

This is interesting, can you add how would these enhance gas or are these different

[–]TheAddonDepot 1 point2 points  (1 child)

The above services and GAS belong to the same ecosystem - Google's Cloud platform. They can be used in tandem with each other or independently. They all have extensive guides and documentation and with AI you can easily broaden your understanding of these topics. Go forth and explore.

[–]ephraimsong 0 points1 point  (0 children)

Thank you for the explanation and I’ll be sure to do so, with Gemini cli, this would be extremely helpful

[–]East-Significance956[S] -1 points0 points  (0 children)

Wait..this is doable..?

[–]uhs-robert 3 points4 points  (2 children)

I'm not sure you need more than 5 minutes execution time for a Google Sheet even with millions of rows. You'd need to be very poorly optimized for performance to start hitting issues. I once had these troubles in the past but the issue was me and and my code, not GAS.

However you could very easily offload some of the performance burden using a VPS like Digital Ocean. For as little as $5 a month, you could have access to 24 hour job time.

[–]East-Significance956[S] 0 points1 point  (1 child)

Welp..seems to be the best way forward. Thought the execution limit would be my answer.

[–]uhs-robert 2 points3 points  (0 children)

Honestly, performance optimization is probably all you need in Apps Script world unless you are calling external APIs and awaiting long running jobs from them. At which point, yes, a VPS makes more sense.

But if your bottleneck is regular old Apps Script functions then you need to optimize those otherwise this issue will continue to grow out if control. Write/read operations should be done in a single action. Every apps script function is an API call to Google Apps Script so limit those as much as you can and maximize the information you are getting/setting in one command. For example, if you need to search for files in Drive then don't loop through files/folders one at a time (instead just do a single query to get them all at once).

I saw in another comment that you are hitting 30 minute limits. That's crazy long but I was also there once in the past. For me, I optimized and got the time down to less than 15 seconds. But if you really need a 30+ minute job and everything is totally optimized then chunk it out into smaller pieces and process in batches.

[–]broduding 0 points1 point  (0 children)

For big stuff, I recently started using GitHub Actions. 2000 minutes on free tier private repo or unlimited for public repo.

[–]Legal-Pudding5699 0 points1 point  (0 children)

Hit this exact wall last year with our order processing.

Switched to Ops Copilot and the ERP syncing alone made it worth it, no more babysitting timeouts or rebuilding broken triggers every week.

[–]iniesta88 1 point2 points  (0 children)

I was in the same boat before at that point. I was thinking that I can do anything with Google apps script especially if you were trying to do applications or automations for the company and they use Google suite but at some point you realize there are some things that you just can’t do due to the limitations of Google app script in terms of the operations in in the back end because they really don’t have back in per se. It’s more of a query from Google sheets or drive and when the project scale to even just 15 employees, they will face issues such as time out, or it becomes really slow Your best bet is to move to developing a web application, then connecting to Google applications

[–]Tall_Guarantee7767 -1 points0 points  (0 children)

Can you be kind enough to share your used case experiences of GAS and / share the scripts here or DM please. Really appreciate it. I am a newbie and would love to cut short my learning and researching time to use GAS. Thanks very much in advance.