Caching is a critical strategy for optimizing performance in Google Apps Script properties, especially when dealing with slow APIs or heavy computations. The built-in CacheService provides a simple key-value store, but its documentation leaves several โedge casesโ and failure scenarios vague. While the documentation states a maximum value size of 100KB, it doesnโt explicitly detail what happens when you hit the Apps Script CacheService key length limit or throw odd types at it. In this post, weโll write a script to empirically test these limits … and explore how the service behaves under stress.
Google Workspace alum Justin Poehnelt (whose open-source work many in the community will recognise from the Google Workspace CLI (gws)) has shared a great investigation in Apps Script CacheService Limits. As noted by Justin, while the official CacheService documentation states some of the limits like key value size and the 1,000 cacheable item limit, it leaves out some important details. One finding I think every Apps Script developer should know about is the mechanics of cache eviction when you go over 1,000 items. When you reach this limit, rather than one-in, one-out, CacheService will drop approximately 100 of the oldest items.
For developers who use other caching tools like Redis or Memcached, which primarily rely on Least Recently Used (LRU) where frequently accessed keys stay alive, another key finding is that CacheService uses First-In, First-Out (FIFO). This means CacheService throws away your oldest data even if you are regularly using it in your script. Iโm sure most developers are defensively using CacheService to cache values if not found. To keep “hot” keys from aging out of the queue, Justin shares a function in his post to manually remove and re-insert them.
What I really like about Justinโs post is the empirical approach, writing a small test harness to verify how the Apps Script runtime behaves in practice rather than taking standard cache behaviour for granted. As more developers use the Gemini side panel in the Apps Script IDE or AI coding assistants to vibe-code Workspace automations, having Justinโs posts and ones like it hopefully nudge these tools in the right direction regarding this nuanced behaviour. Understanding these runtime quirks upfront can save a lot of head-scratching when debugging intermittent cache misses in production.
Follow the source link for the full walkthrough and test outputs.
In this project, the goal was to build a clean and practical CI/CD setup for Google Apps Script using GitHub Actions… Instead of stopping at a minimal demo, the project was developed into a working example with a real Apps Script automation flow, a GitHub Actions pipeline, a validation step before deployment, a web app health response, and spreadsheet bootstrap logic.
Weโve covered CI/CD pipelines with GitHub actions before in AppsScriptPulse, but given the advent of AI developer tools, like Google Antigravity, this comprehensive walkthrough and companion GitHub repository from Shivaji Bodkhe is very timely. A couple of architectural choices in Shivajiโs template are particularly worth highlighting, especially for engineering teams seeking to standardize their internal tooling:
Pre-Deployment Validation: Rather than treating clasp push as a final deployment step, GitHub Actions separates execution into distinct validate and deploy jobs. There are some nice additions in the validation step including enforcing V8 runtime and Cloud Logging.
Credential Handling: Managing clasp credentials in CI often presents security friction. Shivajiโs workflow isolates authentication by storing the contents of ~/.clasprc.json in GitHub Secrets. During the deployment phase, the workflow injects this file and generates a fresh .clasp.json using the secret APPS_SCRIPT_SCRIPT_ID.
As developers increasingly adopt agentic coding assistants like Google Antigravity, having versioned code becomes essential. Beyond individual developer workflows, this pattern opens up powerful opportunities for enterprise governance and team collaboration:
Centralized Deployments Without Shared Credentials: Internal automations and domain-wide Workspace Add-ons can be owned by a dedicated service identity (such as [email protected]). Contributors and AI agents submit improvements via standard GitHub Pull Requests, which are deployed without needing direct edit permissions to the script or access to the account credentials.
Custom Guardrails: Teams can easily extend Shivajiโs validation step by adding TypeScript checks with @types/google-apps-script or lint rules.
Pipelines like this illustrate how standard software engineering hygiene can be applied directly to Workspace development. Teams looking to move beyond manual browser deployments can fork Shivajiโs sanitized template as a starting foundation. You can inspect the full workflow configuration and template source code on GitHub: shivajibodkhe/google-apps-script-cicd-template
Before we jump in a quick backstory, if nothing else to prove this entire post wasnโt written with Gemini assistance. Just over a year ago I was fortunate to be a Workspace Studio tester (or Flows as was it called then). I was particularly excited by the ability of Extending Google Workspace Flows with Custom Steps using Google Apps Script. As Workspace Studio moved through the Gemini Alpha program to general availability, custom steps disappeared. This is very understandable given Workspace Studio was a new product and Google wanted to make sure users got to access a stable platform. The great news Google has now launched Automate workflows with custom starters and steps, third-party integrations, and webhooks in Workspace Studio.
With custom steps officially back I thought it was revisit an integration I had been experimenting with combining Workspace Studio with AppSheet. The code for this solution is published in the AppSheet Custom Steps for Google Workspace Studio repo and in this post, we’ll walk through:
Why connect Workspace Studio to AppSheet?
A Real-World Example: Intelligent IT Ticket Triage with Gemini & AppSheet
How custom steps are structured in Apps Script (appsscript.json)
The secret sauce: Dynamic schema discovery via Custom Resources
Handling Single vs. Multiple Results: A Two-Tier Approach
Testing & Deployment with Clasp (and the Admin Setting gotcha)
How this project was built using AI coding agents with .agents/ skills
Why Connect Workspace Studio and AppSheet?
Google Workspace Studio is great for automations across Google Workspace allowing you to use Gemini assistance. AppSheet serves as a no-code application platform making it easy to create solutions for your business data. AppSheet Enterprise customers can already use Gemini AI automations to extract, categorise and summarize data, but getting data from a Workspace automation into AppSheet often required intermediary webhooks, custom API scripts, or relying on Google Workspace integrations to Sheets, Forms and Gmail.
With my custom Studio steps, powered by the AppSheet REST API, you have the ability to extend your apps capabilities using the growing list of Workspace Studio starter steps integrating with your AppSheet app to:
Add Rows: Directly push structured records into AppSheet tables.
Update Rows: Modify records and trigger AppSheet bot workflows in real time.
Find Rows: Run AppSheet formula expressions (such as FILTER("Technicians", [On Call] = TRUE)) and feed those records back into downstream Studio steps.
A Real-World Example: Intelligent IT Ticket Triage with Gemini & AppSheet
To see how this works in practice, let’s look at a common scenario, an automated IT helpdesk flow using a slightly modified version of the AppSheet standard IT Ticketing template.
In the IT Ticketing app the schema includes:
The Tickets table tracks issues (Issue ID, First Name, Last Name, Email, Description, Symptom, Assigned Tech, Date Created, Resolved).
The Technicians table tracks staff (Name, Department, IT Email, On Call boolean, and Can Cover skills: General Issues, Network, Website, Apps). The primary key for this table is IT Email.
The Symptoms table stores the allowed categories (Name, Department), used as an AppSheet Ref dropdown in the app.
Rather than forcing users to fill out a form manually or relying on rigid routing rules, we can combine Workspace Studio’s Gmail starter, Gemini steps, and our AppSheet custom steps into an autonomous triage pipeline:
[ Gmail Starter: New Support Email ]
โ
โผ
[ Step 2 : Find Rows (Fetch On-Call Technicians) ]
โ
โผ
[ Step 3: Find Rows (Fetch the apps Symptoms list) ]
โ
โผ
[ Step 4: Extract (Gemini extracts the required data for our app) ]
โ
โผ
[ Step 5: Add Rows (Create Ticket with Assigned Tech) ]
Step-by-Step Flow Breakdown
Starter (Gmail): Studio listens for incoming emails sent to [email protected] or flagged with [IT Support] in the subject line.
AppSheet Custom Step (Find Rows):
Studio queries the Technicians table with the selector:FILTER("Technicians", [On Call] = TRUE)
AppSheet Custom Step (Find Rows):
Studio queries the Symptoms table for the current list
Gemini Extract (Smart Triage):
Studio passes both the cleaned ticket details, the on-call technician records and our apps symptoms list to Gemini:
AppSheet Custom Step (Add Rows):
Studio inserts the new record into Tickets.
The step outputs addedRow, immediately exposing newly generated fields (like Ticket ID or calculated dates) for the rest of the flow.
This pattern demonstrates the true power of combining Workspace Studio and AppSheet. Studio orchestrates Workspace events and AI reasoning, while AppSheet provides validated, related business data.
The Anatomy of a Workspace Studio Custom Step
Under the hood, a Workspace Studio custom step is an extension of the Google Workspace Add-on architecture defined in appsscript.json.
Each step declares its inputs, outputs, and two primary Apps Script callback functions:
onConfigFunction: Renders the configuration card displayed in the Studio sidebar when a user selects your step.
onExecuteFunction: Receives input variable bindings at runtime, executes the business logic, and returns output variables back to the flow.
Here is an extract from appsscript.json defining the “Add Rows” step, featuring both bulk JSON outputs and the Dynamic Custom Resource (addedRow):
Notice that addedRow has a dataType pointing to appsheet_row_resource. At the top level of addOns.flows, we declare this custom resource alongside a dynamic definition provider:
One challenge with database integrations in no-code flow builders is usability. Asking users to hand-write raw JSON payloads or use secondary “Extract” steps to parse out field names isn’t straightforward.
Initially, I tried adding interactive buttons in the configuration card (e.g. a “Fetch Columns” button). However, Google Workspace Studio does not currently display interactive CardService action buttons or in-place card replacement widgets.
Whilst it is not possible to dynamically add input fields to a step, you can dynamically expose the outputs using Dynamic Custom Resources. With Dynamic Custom Resources, you can dynamically update the schemas to define individual column variables automatically.
How it Works Behind the Scenes
Design-Time Schema Introspection (onDynamicAppSheetRowDefinition): When the user configures the step in Studio (entering their App ID, Access Key, and Table Name), Studio calls onDynamicAppSheetRowDefinition(e). Apps Script queries AppSheet using TOP(FILTER("Table", TRUE), 1) to discover existing column headers, registering each as an individual ResourceField:
Step Execution & Caching (onExecuteFunction): When the step runs, it executes the AppSheet API operation, caches the row data in CacheService under a unique UUID ("row_find_" + Utilities.getUuid()), and returns a resource reference variable alongside the standard JSON output:
Runtime Value Resolution (onDynamicAppSheetRowProvider): When a downstream step references a chip like Step 2 > First row > IT Email, Studio calls onDynamicAppSheetRowProvider(e) with the resourceId. The provider grabs the cached row and returns the requested column values on the fly.
Handling Single vs. Multiple Results: A Two-Tier Approach
When building steps that interact with databases, you inevitably face a question: What happens if the query returns one row versus ten rows versus zero rows?
In Google Workspace Studio’s currently, custom resources strictly mandate "cardinality": "SINGLE":
“The output variable has a dataType with the property resourceType. The value of cardinality must be SINGLE.”
Because Studio does not yet support repeated arrays of custom resource chips, our custom steps implement a two-tier output design:
Contains the full JSON array [ {...}, {...} ] of all matching rows.
rowCount
Integer (SINGLE)
Conditionals & branching
The total number of rows found (0, 1, 5, etc.).
Add Rows
addedRow
Dynamic Custom Resource (SINGLE)
Single record added
Exposes column chips of the newly created row (useful for generated IDs or computed columns).
addedRows
String (JSON Array) (SINGLE)
Bulk additions
Full JSON array of all rows inserted.
Update Rows
updatedRow
Dynamic Custom Resource (SINGLE)
Single record updated
Exposes column chips of the updated record.
updatedRows
String (JSON Array) (SINGLE)
Bulk updates
Full JSON array of all updated rows.
How Flows Use This in Practice:
Single Record Workflows: Use firstRow, addedRow, or updatedRow chips directly in downstream steps (Gmail, Google Docs, Slack, Chat) without any formula or extraction step. If 0 rows match, chips safely resolve to empty strings ("").
Multi-Record Collections: Pass foundRows (JSON string) directly into the rowsData input of another step or iterate over the collection using Studio list actions.
Conditional Logic: Add a Studio branch on rowCount > 0 to safeguard downstream actions when records might not exist.
Testing & Deployment with Clasp
Because Studio custom steps run on Google Workspace Add-on infrastructure, testing is fast:
Install the Test Deployment: Open the Apps Script project, go to Deploy > Test deployments, select Google Workspace Add-on, and click Install.
Use in Studio: Head to studio.workspace.google.com, add a step to any flow, and search for “AppSheet Utilities for Studio”.
[!IMPORTANT] Admin Setting Required for Google Workspace Accounts: As announced in the Google Workspace Updates, custom steps are OFF by default for Google Workspace accounts.
If you see a lock icon stating “๐ Access to these steps is restricted by your Workspace admin”, have a domain admin navigate to: Google Admin Console > Apps > Google Workspace > Settings for Workspace Studio > Custom steps settings Turn custom steps ON and check “Allow unpublished (test) custom steps”.
AI-Assisted Development with .agents/
An interesting aspect of developing for newly released or evolving APIs like Workspace Studio is that public LLMs often have knowledge cutoffs or hallucinate manifest formats and Card Service specifications.
To build this project efficiently, the repository includes a curated .agents/ directory containing specialized runbooks, rules, and reference specs:
Contract Parity: Enforces that input/output IDs in appsscript.json match Code.js execution handlers.
Real-time API Adaptation: When testing revealed that Studio sidebar cards don’t render interactive card buttons, the agent used the reference docs to quickly pivot to native Dynamic Custom Resources (dynamicResourceDefinitionProvider).
Platform Constraints: Encodes crucial platform invariantsโlike the requirement that dataType.resourceType outputs mandate "cardinality": "SINGLE"โsaving hours of trial and error.
AppSheet Selectors: Pre-validated AppSheet formula expressions (FILTER, SELECT, TOP) for REST API calls.
When working with tools like Gemini Code Assist or AI coding agents, these in-repo skills guide the model to write accurate, production-ready code on the first attempt and navigate rapid API evolutions.
Summary and Next Steps
Having custom steps and starters back in Workspace Studio opens up huge possibilities for developers. Google Apps Script acts as the glue code, letting you build custom integrations for internal systems, specialized SaaS platforms, or databases like AppSheet.
I built a web application used by more than 3,000 people. The backend was Google Apps Script. It ran for almost two years while we kept improving the application. We eventually moved it to AWS โ not because Apps Script couldnโt handle the application, but because changes around Googleโs authentication model gave us the opportunity to move to a more conventional backend and database architecture. Hereโs how I built it, what problems we ran into, and why we didnโt build a traditional backend from the beginning.
In Pulse weโve featured a couple of examples and tips on scaling Apps Script Web Apps. One of the most extensive solutions weโve shared is Zig Mandelโs open-source Apps Script Website Integration Framework. Partha Sahoo has recently shared how his team used Google Sheets and Google Apps Script to develop a client facing frontend for over 3,000 users. The model they adopted is one Iโve not seen before. Itโs a clever distributed model which combines a central database and script library with individual Google Sheets and Web Apps for each client. With this model workloads are shared across individual web apps:
There are some clever features in this solution which you can get an overview of in Parthaโs post. A couple I would like to highlight are:
Exponential Backoff Polling: To stay comfortably below Apps Scriptโs quotas, the frontend avoided aggressive continuous polling. The client would initially poll every 5 minutes and if there were no changes to the data scaled down via exponential backoff to 30 minutes.
Central Library Multi-Tenancy: To avoid the burden of maintaining hundreds of individual web app deployments, core business logic lives in a versioned central Apps Script library (paired with a staging library for testing). This allowed Sahoo to ship bug fixes and feature rollouts fleet-wide instantly without redeploying individual client projects.
After nearly two years in production, the platform migrated to AWS. As Partha explains, the move was not driven by Apps Script reaching an operational bottleneck, but by evolving Google Workspace authentication policies, which made a conventional cloud backend more practical for long-term compliance. As noted in Parthaโs post, the migration of the Apps Script code to AWS was easily refactored with AI assistance.
Weโre in interesting times. On the one hand the beta Gemini side panel in the Apps Script Editor makes it easy to deploy web apps, on the other tools like Google AI Studio make it easy to vibe code applications to run in Googleโs cloud infrastructure. Both introduce new risks, but also opportunities.
File format conversion in Google Apps Script ranges from simple string manipulations to multi-stage pipeline workflows. Depending on your source format and required output, the optimal solution might be a quick service workaround, a native Drive API call or a dedicated library capable of handling indirect conversions and OCR.
The Lightweight Approach: Converting HTML to Plain Text
At the simplest end of the spectrum, you can convert markup into plain text without writing custom regular expressions or importing heavy third-party parsers.
A clever technique shared by Kanshi Tanaike in his guide on converting HTML to plain text uses the Gmail Service. You pass the HTML string into GmailApp.createDraft() and retrieve the formatted plain text using getPlainBody().
Code Example: HTML Conversion via Temporary Gmail Draft
/**
* Converts an HTML string to plain text using a temporary Gmail draft.
*/
function convertHtmlToPlainText() {
const htmlContent = '<div><h1>Quarterly Summary</h1><p>Project completed on <b>Schedule</b>.</p></div>';
// Create a temporary draft to utilise Gmail's HTML parser
const draft = GmailApp.createDraft('', '', '', { htmlBody: htmlContent });
const plainText = draft.getMessage().getPlainBody();
// Immediately delete the draft to clean up
draft.deleteDraft();
Logger.log(plainText);
// Output:
// Quarterly Summary
// Project completed on Schedule.
}
This clever workaround executes quickly and avoids manual string parsing. It is ideal when cleaning up web scraper output, preparing logs or stripping HTML tags from user input but comes with the downside of requiring a Gmail authorisation scope.
Direct Drive API Conversions
The Drive API provides a direct conversion mechanism. For example, by passing an HTML blob to Drive.Files.create(), Google Drive can convert this into a fully formatted Google Doc. You can then open the generated document using DocumentApp to extract clean text or manipulate document elements before trashing the temporary file.
Code Example: Converting HTML to a Doc and Extracting Text
To use this method, enable the Drive API under Services in the Apps Script editor (using Drive API v3).
/**
* Converts an HTML string into a Google Doc via Drive API,
* extracts the plain text from the Doc body, and trashes the file.
*/
function convertHtmlToDocAndExtractText() {
const htmlContent = '<h1>Project Summary</h1><p>The roll-out was successful across all regions.</p>';
const blob = Utilities.newBlob(htmlContent, MimeType.HTML);
const fileMetadata = {
name: 'Temporary Converted Doc',
mimeType: MimeType.GOOGLE_DOCS
};
// Create a Google Doc from the HTML blob using Drive API v3
const file = Drive.Files.create(fileMetadata, blob, { supportsAllDrives: true });
// Open the created Doc and extract text content
const doc = DocumentApp.openById(file.id);
const extractedText = doc.getBody().getText();
Logger.log(extractedText);
// Output:
// Project Summary
// The roll-out was successful across all regions.
// Trash the temporary Google Doc to maintain a clean Drive
DriveApp.getFileById(file.id).setTrashed(true);
}
This pattern provides a reliable way to turn web markup into native document elements or extract structured text while preserving structural hierarchy.
The Heavy-Duty Approach: Multi-Step Conversions and OCR
Direct API calls work well when Google Drive natively supports the source and target MIME type pairing. However, problems arise when there is no direct conversion path – for instance, converting a Microsoft Word file (.docx) directly into a PDF, or converting an image into editable text via Optical Character Recognition (OCR).
Path Resolution:ย The library evaluates the source MIME type and the target MIME type.
Direct Conversion:ย If a direct route exists (e.g. Google Doc to PDF), it executes the transformation immediately.
Indirect Pipeline:ย If no direct route exists (e.g. Word document to PDF), it automatically determines the intermediate steps. It first converts the Word file to an intermediate Google Doc, then exports that Google Doc as a PDF, before cleaning up temporary files.
OCR Processing:ย For image formats (.png, .jpg), it passes the file through Drive API’s OCR engine to extract embedded text directly into a Google Doc.
This approach removes the manual work of tracking MIME compatibility matrices and chaining multiple Drive API requests manually.
Summary
Matching your conversion method to the task keeps your Google Apps Script projects lean and reliable. For rich document generation and extraction, Drive API conversions offer structured flexibility.
Have you ever woken up to a massive Google Cloud bill because a developer accidentally left a cluster… Tagged with googlecloud, appsheet, finops, cloudbilling.
Weโve probably all been there, creating and forgetting a test Google Cloud project. Here is a nice solution published by Google Developer Expert Aryan Irani knitting together various Google Cloud / Workspace services. In a guide Aryan walks through how to set up an event-driven workflow, using Cloud Pub/Sub to help prevent unwanted Google Cloud spend right from your phone. Instead of waiting for an email notification, this system uses Google Sheets, AppSheet and Google Cloud Functions to monitor your budget and give you a push notification and easy way to shut down a project.
If you want to simplify this architecture further you can replace the webhook target with a Google Apps Script function. By using the auto-generated Cloud Resource Manager client library from the Google API Client Library Generator for Apps Script, you can programmatically shut down the entire target project directly from your app. Configuring the single cloud-platform OAuth scope in your script manifest allows you to delegate security control directly to Google Cloud IAM roles. Moving the project to a soft-delete state instantly stops all active billing across all services, databases and compute instances, providing a complete emergency stop-switch.
This project is a fantastic example of using low-code tools to solve real infrastructure problems. You can read the full step-by-step tutorial and learn how to configure this for your own projects.
Fix slow JDBC in Google Apps Script V8. Learn the native SQL JSON trick to boost throughput from 3 to 142 records/sec and bypass the 30-min timeout.
We have regularly featured solutions for connecting external databases to Google Workspace using the JDBC service. Our most recent example include a guide on connecting PostgreSQL to Apps Script [JDBC Guide, February 2026]. While this guide help establish connections, developers running large-scale synchronisations under the modern V8 engine frequently encounter severe performance drops. A detailed post from Pablo Felip analyses this runtime performance gap and provides a helpful workaround that can reduce execution times by over 98%.
Standard database queries in Google Apps Script suffer from severe performance degradation when using the JDBC service because the V8 runtime adds significant latency. To resolve this, Pablo highlights how developers can offload data processing to the database server by using native SQL features like FOR JSON PATH or JSON aggregation functions to bundle query results into a single, efficient JSON string. This approach dramatically reduces the processing, allowing the Apps Script code to fetch data as chunks and use V8’s native JSON parsing to reconstruct the table in memory. By using this approach, developers can achieve massive speed improvements and stay well within execution time limits.
Head over to Pablo’s blog to read the complete post, view the underlying benchmark metrics and see if this approach can speed up your database synchronisation workflows!
If, like me, you’ve often struggled with the pain of coding user interfaces with the CardService in Google Workspace, things are about to change. Using the new, open Agent2UI (A2UI) specification, agents can autonomously decide how to structure and render their own native interfaces in real time.
In a recent Pulse post, The Evolution of Google Chat: Exploring the New Wave of Developer Quickstarts, we highlighted a new Google tutorial that implements Agent2UI (A2UI) inside Google Chat. This guide shows you how to build a hybrid solution using Apps Script as a secure, lightweight gateway to Python-based agents running on the Vertex AI Agent Engine.
The Architecture: Apps Script as the Orchestrator
A common challenge when working with modern AI toolkits like the Agent Development Kit (ADK) is that they are not designed to run natively inside Apps Script. The quickstart bridges this divide by turning Apps Script into a lightweight, secure orchestration layer.
Instead of running heavy processing directly inside the script, Apps Script handles the Google Chat event, manages secure server-to-server authentication, and sends the payload out to an agent running on the Vertex AI Agent Engine.
Under the Hood
A look at the script provided in the quickstart shows how the Python backend passes UI layout instructions back to the Workspace front-end. When a user asks a question, the Python script processes the request, calls any backend tools and returns a single text stream structured like this:
When this response is returned to Google Apps Script, it triggers the extractA2UIParts() function which splits this raw payload on the ---a2ui_JSON--- separator. The text before the delimiter (e.g., “Hello! I found the profile…”) is taken and posted straight to the user and the raw JSON array after the delimiter is to make the card.
Something to keep in mind is that this framework is not yet a wholesale replacement for the entire CardService library, as you will see in the script it uses a basic render to convert the A2UI JSON into CardService elements:
switch (Object.keys(component)[0]) {
case 'Text':
const textParagraph = CardService.newTextParagraph();
textParagraph.setText(extractTextValue(component["Text"].text, dataModel));
widgetWithIds.push({ id: c.id, widget: textParagraph });
break;
case 'Image':
const image = CardService.newImage();
image.setImageUrl(extractTextValue(component["Image"].url, dataModel));
widgetWithIds.push({ id: c.id, widget: image});
break;
case 'Button':
// Maps inline labels or child text components to TextButtons
// and packages them into a trailing ButtonSet...
break;
default:
console.warn(`Could not render component: ${JSON.stringify(c)}`);
}
This means that for the time being, the script example is only able to handle basic UI elements rather than handling heavy, structured data-entry flows.
Future Directions
While the quickstart provides a foundational v0.8 entry point for developers, community members are already looking at how A2UI responses can be used in Google Workspace interfaces.
An excellent example of this is Curtis Krygierโs open-source a2ui-catalogue project. Curtis has started a component library designed to build agent-driven interfaces for Google Workspace starting with Google Meet and Google Chat.
Instead of trying to bundle complex, pre-composed UI elements on the backend, Curtis advocates for a substrate model:
Atomic Philosophy: Developers define a fixed visual vocabulary of atomic “primitives” once on the client side (such as TypeScript Lit web components).
Token Efficiency: The AI agent reasons entirely within this stable vocabulary. It passes raw state updates rather than inventing presentation layouts on every conversational turn. This reduces token overhead and eliminates slow backend container redeployment loops.
Interchangeability: By completely decoupling primitives from the transport layer, the exact same v0.9 component tree can reflow dynamically across completely different containers. A layout originally designed for a fullscreen stage in a Google Meet iframe can seamlessly stack and reflow to fit inside a compact Google Chat card or side panel.
Summary
For Google Workspace developers, the base A2UI Agent quickstart serves as an excellent hands-on starting point to experiment with agent integrations in Google Workspace. The underlying frameworks are evolving rapidly, as are the solution wrappers like a2ui-catalogue. Given a speed of change don’t expect a completely frictionless, single-click deployment out of the box, and youโll likely need to lean into a little “Gemini-powered” fault finding should sort things out.
Have you ever used Google Workspace Studio? If so, you might have seen its “Google Drive Folder” trigger that instantly reacts to new files. It is an excellent feature for no-code automation, however, it has its limitations in what you can do in subsequent Studio steps.
If you are interested in this capability but would like to do more, I’ve just published an example repo which explores Google Drive events which is currently in the Developer Preview as part of the new Workspace Events API. With this you can subscribe to real-time changes including file uploads to specific folders, which opens opportunities for programmatically interacting with Google Drive and other services.
A Practical Application: Enterprise Data Pipelines
For me one of the most valuable applications for this capability lies within enterprise data pipelines. In many corporate environments, business users lack direct access to Google Cloud Storage buckets which are often used in data pipelines and instead they rely entirely on Google Drive for file sharing and collaboration.
By subscribing to folder events, developers can automatically trigger the movement or digestion of data the exact moment a user drops a new file into a designated Drive folder. This creates a seamless, automated bridge between user-facing storage interfaces and backend processing systems.
Architectural Highlights from the Demo
To demonstrate this Iโve published a complete proof of concept in theย Google Drive to Google Sheets Notification Add-on Tutorial. This is a basic Google Workspace Add-on which lets users โsubscribeโ to a Google Drive folder and get realtime updates to a Google Sheet. The example replicates what is possible already with Workspace Studio, but the idea is once you know how to set up a subscription you can do anything you want with that file. The example, unusually for me, has zero Apps Script meaning for chunkier data problems you can easily scale on Google infrastructure. If you look at the codebase, hopefully there are several design patterns that are useful for Workspace developers:
Infrastructure as Code (IaC):ย Rather than configuring the Google Cloud project services manually via the console, the repository includes Terraform configuration files to automatically provision the necessary Pub/Sub topics, service accounts, and IAM bindings required for secure message delivery. Using a โInfrastructure as Codeโ makes it easy to โapplyโ updates to your project.
Built-in Resilience:ย The Terraform configuration explicitly sets up a dead-letter topic. If your Event Processor fails to handle a file notification, the message routes to this secondary queue, ensuring no data events are lost during temporary outages or bugs.
Decoupled Execution:ย The example also separates user interaction from backend processing. An Add-on Handler manages user authorisation and API subscription creation meanwhile, a dedicated Node Cloud Function acts as a secure Event Processor, picking up messages asynchronously via Pub/Sub to prevent timeout issues.
The 3 Gotchas We Are Solving
The Drive API already has aย watchย endpoint but there three common obstacles that the new Workspace Events API gracefully solves:
The “Blind Ping”:ย When watching a folder with the legacyย files.watch, the notification only tells you that the folder’s contents changed; it does not explicitly tell youย whichย file was added. You are therefore forced to perform a secondary query to find the new file. The new Workspace Events API solves this by handing you the exact ID of the newly added file directly in the payload.
The Public URL Requirement:ย Standard webhooks require a public HTTPS URL and domain verification. By routing our events through Google Cloud Pub/Sub, this approach allows you to receive notifications privately and securely.
The Empty Payload:ย Google typically sends legacy notification data hidden within HTTP headers, which can be difficult to parse in certain environments, such as Apps Script. This is less of a concern in the shared example as we are using only Cloud Run Functions.
Summary
Hopefully, the demo is helpful showcasing what is possible using the Google Workspace Events API and Infrastructure as Code architectures. If there are any hints or tips I have missed, feel free to drop them in the comments below.
Understanding and spotting trends in organic YouTube traffic based on specific queries can often be a manual and time-consuming process. To solve this, the Google Marketing Solutions team has published an open-source repository for a tool called YouTube Topic Insights. Developed by Google Customer Solutions Engineer Francesco Landolina, the project transforms raw video data into actionable summaries by combining the data-gathering capabilities of the YouTube Data API with the video and language understanding of Gemini models.
For Google Apps Script developers interested in building scalable tools, this repository is a fantastic example of using Vertex AI at scale. It orchestrates complex, long-running processes directly from a Google Sheet and pairs them with Vertex AI batch prediction. In this post we will highlight some interesting infrastructure setup and the pattern used to bypass common Apps Script execution limits.
Project architecture and setup
The solution is divided into two main components that make it easier to setup and process the data:
GCP Infrastructure as Code: The necessary cloud environment is defined using Terraform infrastructure as code. This makes the deployment easier by enabling required APIs like Vertex AI and the YouTube Data API. While the Terraform script attempts to set up the OAuth Consent Screen using the google_iap_brand resource, you will need to configure the OAuth Consent Screen manually within the Google Cloud Console as the official Terraform documentation notes that the underlying IAP OAuth Admin APIs were permanently shut down on March 19, 2026.
Google Apps Script: The brain of the operation lives within a Google Sheet. It calls the YouTube API to find videos, prepares and submits analysis jobs to Vertex AI batch prediction, fetches the completed results, and writes the human-readable insights back into the spreadsheet interface.
For developers setting this up, the repository includes a Quick Start template. The script automatically handles the initialisation of the spreadsheet structure when first opened, creating the necessary configuration and logging sheets in a safe, non-destructive way.
Overcoming the execution limit with Vertex AI batch prediction
As you can imagine, analysing hundreds of videos using a LLM is going to be a compute-heavy task. If you attempt to process these synchronously in a simple loop, you will quickly hit the execution limit for Google Apps Script.
To get around this, the solution uses Vertex AI batch prediction (see Batch inference with Gemini). Instead of waiting for Gemini to process each video, the script initiates an asynchronous batch job and uses a chained-trigger system to poll for completion. Once the batch job completes, the script retrieves this context, parses the JSON response from Gemini, and writes the summarised data back to the Google Sheet.
Summary
The YouTube Topic Insights solution is an excellent example of how to build complex applications using Vertex AI Batch Prediction. It provides practical solutions for managing asynchronous tasks, interacting with advanced Vertex AI features.
If you are interested in exploring the code further or setting up the tool for your own research, you can find the complete source code and deployment instructions in the YouTube Topic Insights GitHub repository.