Skip to content

Google Workspace development

Google Apps Script Guides and Examples

A curated collection of 27 practical guides from building with Apps Script: runtime behavior, APIs, storage, authentication, Gemini, MCP, security, and production automation.

Start with the core guides below, or browse by problem. Every article includes working code, implementation details, or measurements from real projects.

Start here

The broadest guides for HTTP requests, storage, AI, and external databases.

  • UrlFetchApp: The Unofficial Documentation

    The unofficial guide to Google Apps Script UrlFetchApp. Master authentication, fetchAll for parallelism, web scraping, and debugging "Address Unavailable".

  • Apps Script Storage Benchmarks

    Benchmarks comparing CacheService, PropertiesService, and Firestore in Apps Script, including speed measurements and when each storage option fits.

  • Using Gemini in Apps Script

    Use Apps Script's Vertex AI advanced service to call Gemini for text, images, structured output, search grounding, and multi-turn chat.

  • PostgreSQL from Google Apps Script

    Connect Apps Script to PostgreSQL via JDBC, including connection strings, JSONB and UUID workarounds, transactions, and PostGIS.

Core platform and runtime

Understand Apps Script's runtime, HTTP client, storage, caching, web apps, and WebAssembly support.

  • UrlFetchApp: The Unofficial Documentation

    The unofficial guide to Google Apps Script UrlFetchApp. Master authentication, fetchAll for parallelism, web scraping, and debugging "Address Unavailable".

  • Apps Script V8 Runtime Limitations

    A comparison of the WinterCG minimum common web APIs and Apps Script's V8 runtime, including UrlFetchApp and sleep workarounds.

  • Promises, async and await in Google Apps Script

    Understand async/await and Promises in Google Apps Script. Learn why most APIs remain synchronous and how WebAssembly is the exception.

  • Apps Script and WebAssembly - A comprehensive guide

    You can use WebAssembly with Google Apps Script! This post will cover how to do that and provide a comprehensive guide on how to get started.

  • Apps Script Storage Benchmarks

    Benchmarks comparing CacheService, PropertiesService, and Firestore in Apps Script, including speed measurements and when each storage option fits.

  • Apps Script CacheService Limits

    Unofficial Apps Script CacheService findings: key and value limits, FIFO batch eviction, edge cases, and practical cache patterns.

  • Memoization in Apps Script

    A generic Apps Script memoization helper that hashes a function and arguments, stores results in CacheService, and explains its limits.

  • google.script.run vs. doGet/doPost

    Compare google.script.run vs doGet/doPost endpoints for Apps Script web apps. Choose the best method for simple apps or complex frameworks like React/Vue.

AI and agents

Use Gemini, Vertex AI, MCP, and Model Armor from Apps Script.

  • Using Gemini in Apps Script

    Use Apps Script's Vertex AI advanced service to call Gemini for text, images, structured output, search grounding, and multi-turn chat.

  • Building a MCP Client in Google Apps Script

    Learn how to communicate with Model Context Protocol (MCP) servers using Apps Script and UrlFetchApp. Incorporate the MCP client into Vertex AI tool calling.

  • Using Vertex AI in Apps Script

    How to use the Vertex AI API in Apps Script to make predictions on your data or use it in any of your other Google Workspace processes.

  • Generating Text with Gemini Pro in Apps Script

    A short Apps Script example that calls the Gemini Pro REST API to generate text, then reads the response candidate text.

  • Protect Gmail AI Agents with Model Armor

    Use Model Armor in an MCP tool handler to block prompt injection and redact sensitive Gmail content before it reaches an AI agent.

Data, authentication, and integrations

Connect databases, manage credentials and OAuth scopes, and work with Drive, Docs, and Forms.

Automation, add-ons, and field notes

Practical automations, add-on architecture, performance measurements, and conference material.