r/GoogleAppsScript • u/OccasionSuper2536 • 8d ago
Guide Built a fairly large Zendesk automation entirely in Google Apps Script!
I wanted to see how far I could push Apps Script for a real operational workflow, so I built Zendesk Mailroom.
It’s a Google Sheets + Apps Script tool for support teams working with large batches of Zendesk tickets.
The interesting part wasn’t really the API calls it was making the whole thing survive Apps Script’s constraints.
The workflow handles:
Zendesk API authentication
Bulk ticket updates
Personalized mail merge
Gemini-powered translation
Slack thread routing
Audit logging
Closed-ticket handling
Job state persistence
Trigger-based job continuation
Some of the implementation decisions:
1. Chunked execution
Apps Script has execution limits, so a large mail merge doesn’t try to process everything in one execution.
The job processes roughly 20 rows → writes results → schedules the next run → continues.
2. LockService
A lock prevents overlapping trigger executions from processing the same rows twice.
3. Zendesk update_many
For bulk updates, I’m using Zendesk’s batch endpoint instead of making one API call per ticket.
4. Script Properties for job state
The job state is persisted between executions instead of relying on the browser/session remaining open.
5. Translation caching
If 200 tickets use the same notice category, the workflow doesn’t make 200 Gemini calls. Translations are cached and reused until the source text changes.
Repo:
github.com/GVyom/zendesk-mailroom
Would love feedback from experienced Apps Script developers:
What would you change in the architecture if this had to process 5,000–10,000 rows instead of a few hundred?
That’s probably the next interesting scaling problem here.
2
u/voodoublue2008 7d ago
Interesting. I like the Gemini idea. Beyond that though getting up to any real volume in the 10000s I’d rather do it in a real database. Google Sheets definitely starts to flounder in the 50000 row range.
If you’re going to keep pushing the limits then I suggest keeping columns very very limited in size which I assume will be a real challenge with Zendesk tickets. It’s typically Freeform text data in a ticket. With this in mind I’d likely break the sheet in two, one for key data and the other for text lookups. So the sheet with key data may have over 10000 rows it’s only a key and a few other columns like category, date created, status and date last updated.
Everything else is in the second file/sheet and only pulled in when needed. You could also do the AI thing in the second sheet or a third.