GEMINI LABJP
FLASH36 — Gemini 3.6 Flash, shipped July 21, uses about 17% fewer output tokens than 3.5 Flash at a lower price, with fewer stray code edits and execution loopsCYBER — Gemini 3.5 Flash Cyber is a lightweight model focused on finding, validating, and patching vulnerabilitiesCOMPUTER — Computer use is now available as a built-in client-side tool through the Gemini API and Gemini EnterpriseSPARK — Gemini Spark began rolling out in Japanese on July 16, starting with Google AI Ultra subscribersPARALLEL — Spark now processes multiple reference sources in parallel, and handles a wider range of image edits across Docs, Sheets, and SlidesSTUDENT — Students 18 and older in four countries, Japan included, get a free upgrade to Google AI Pro with NotebookLM and 2TB of storageFLASH36 — Gemini 3.6 Flash, shipped July 21, uses about 17% fewer output tokens than 3.5 Flash at a lower price, with fewer stray code edits and execution loopsCYBER — Gemini 3.5 Flash Cyber is a lightweight model focused on finding, validating, and patching vulnerabilitiesCOMPUTER — Computer use is now available as a built-in client-side tool through the Gemini API and Gemini EnterpriseSPARK — Gemini Spark began rolling out in Japanese on July 16, starting with Google AI Ultra subscribersPARALLEL — Spark now processes multiple reference sources in parallel, and handles a wider range of image edits across Docs, Sheets, and SlidesSTUDENT — Students 18 and older in four countries, Japan included, get a free upgrade to Google AI Pro with NotebookLM and 2TB of storage
Articles/Workspace
Workspace/2026-03-29Advanced

Gemini × Google Workspace Add-ons Development Guide — From Building Custom AI Side Panels to Marketplace Launch

A comprehensive guide to building custom AI side panels with Google Workspace Add-ons and Gemini API — from implementation to Marketplace publication and monetization.

gemini102workspace8add-onsapps-script10marketplaceside-panelmonetization21api12

Premium Article

Setup and context — Why Workspace Add-ons × Gemini?

For organizations that rely on Google Workspace daily, having AI assistance available directly from the side panel in Docs, Sheets, or Gmail represents a massive productivity boost. As of 2026, the Google Workspace Add-ons SDK supports rich UI components through Card Service v2, and when combined with the Gemini API, you can build context-aware intelligent assistants right in the side panel.

This article walks you through the complete journey — from the foundational architecture of Google Workspace Add-ons to building a Gemini API-powered AI side panel, designing OAuth scopes, navigating the security review process, and finally publishing and monetizing your add-on on the Google Workspace Marketplace. We provide production-ready code throughout, so by the time you finish reading, you should be ready to publish your own add-on.

This article assumes familiarity with Apps Script basics and a working knowledge of the Gemini API. For building cross-product workflows with Apps Script, check out "[Building Cross-Product AI Workflows with Gemini API and Apps Script]((/articles/gemini-workspace/gemini-apps-script-cross-product-ai-workflow)."

Understanding Workspace Add-ons Architecture

Google Workspace Add-ons use Apps Script or HTTP endpoints as the backend to display custom UI in the side panel of Google Workspace applications (Gmail, Docs, Sheets, Slides, Calendar).

Host Apps and Triggers

Add-ons define trigger functions for each "host app." For example, when a user opens an email in Gmail or a document in Docs, the corresponding trigger function fires and generates the Card UI for the side panel.

  • Homepage Trigger: The home screen displayed when the user clicks the add-on icon
  • Contextual Trigger: Screens that auto-display based on context (opening an email, selecting a document, etc.)
  • Action Callback: Functions invoked on button clicks or form submissions

Card Service v2 UI Components

Card Service v2 provides these key components:

  • CardBuilder: Root container for cards
  • CardSection: Section dividers with headers
  • TextParagraph / DecoratedText: Text display
  • TextInput / SelectionInput: User input forms
  • ButtonSet / TextButton / ImageButton: Action buttons
  • Grid / GridItem: Grid layouts
  • Divider: Section separators

By combining these components, you can build chat-like interfaces, form input screens, analytics dashboards, and more — all within the side panel.

Manifest File (appsscript.json) Structure

{
  "timeZone": "America/New_York",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "oauthScopes": [
    "https://www.googleapis.com/auth/gmail.readonly",
    "https://www.googleapis.com/auth/documents.currentonly",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/userinfo.email"
  ],
  "addOns": {
    "common": {
      "name": "Gemini AI Assistant",
      "logoUrl": "https://example.com/logo.png",
      "layoutProperties": {
        "primaryColor": "#4285F4"
      },
      "homepageTrigger": {
        "runFunction": "onHomepage"
      }
    },
    "gmail": {
      "contextualTriggers": [{
        "unconditional": {},
        "onTriggerFunction": "onGmailMessage"
      }]
    },
    "docs": {
      "homepageTrigger": {
        "runFunction": "onDocsHomepage"
      }
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "onSheetsHomepage"
      }
    }
  }
}

The oauthScopes design directly affects whether your add-on passes the security review. Always follow the principle of least privilege — when a currentonly scope is available, prefer it over the full-access equivalent (e.g., documents.currentonly instead of documents).

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Master implementation patterns for integrating the Workspace Add-ons SDK with Gemini API
Understand the full process from OAuth scope design to security review and Marketplace submission
Gain practical know-how for building subscription billing models and optimizing revenue
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Workspace2026-07-10
Resuming Large Gemini Files API Uploads Across the Apps Script 6-Minute Limit
Sending a few hundred megabytes from Drive to the Gemini Files API through Apps Script means fighting a 6-minute execution cap and payload limits. Here is how to decompose resumable upload into start, upload, query and finalize so a killed run never loses progress.
Workspace2026-06-29
When Apps Script Time-Driven Triggers Quietly Run Out: Consolidating Gemini Automations into One Dispatcher
Apps Script caps you at 20 triggers per user and a daily total trigger-runtime budget. Here is how to stop your Gemini automations from silently dying as you add more, using a single dispatcher, a schedule table, and an external heartbeat.
Workspace2026-05-27
Replying to 11 Languages of Google Play Reviews With Gemini Without Sounding Like a Bot
After two major Android updates, I had to clear a backlog of unanswered Google Play reviews in Japanese, English, Traditional Chinese, Korean, Thai, Italian, Russian, Persian, Ukrainian, and Polish. This is the operations design I settled on for using Gemini as a translation and vocabulary partner without losing the human temperature.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →