appscript.dev
Beginner 8 steps

Gmail automation from scratch

Go from your first trigger to a self-running inbox: capture leads, sort mail, send digests, and stay under Gmail's limits.

This path takes you from “I’ve never written a trigger” to a Gmail inbox that mostly runs itself. Work through the steps in order — each one builds on the last.

By the end you’ll have a working setup that captures leads into a sheet, labels and files mail automatically, nudges you about unanswered threads, and sends in bulk without tripping Gmail’s quotas.

You only need a Google account and the Apps Script editor. Every example uses the same Northwind Studios setup, so the pieces fit together as one system rather than eight unrelated scripts.

  1. 1
    Triggers explained: simple, installable, and time-based

    When to use each type of Apps Script trigger and the gotchas to avoid.

    Start here — every Gmail automation runs on a trigger. Learn which kind to use and why.

  2. 2
    Get or create a sheet by name

    A reusable helper that returns a tab by name and creates it if missing — so your Northwind scripts never crash on a renamed sheet.

    A tiny helper you'll reuse constantly once mail starts flowing into sheets.

  3. 3
    Build a Gmail-to-Sheet lead inbox

    Log every inquiry email landing in support@ as a structured row in a Leads sheet.

    Your first real build — turn incoming email into structured rows you can act on.

  4. 4
    Auto-categorize emails by project keyword

    Apply Gmail labels from a keyword map stored in a Sheet, so every email lands under the right project tag.

    Add labels automatically so the inbox sorts itself.

  5. 5
    Send a weekly digest of unreplied emails

    Surface inbox threads you haven't answered in a single Monday-morning summary.

    Close the loop — surface what still needs a reply instead of chasing it by hand.

  6. 6
    Archive newsletters automatically after seven days

    Sweep read promotional mail on a daily schedule to keep the inbox clean.

    Keep the inbox clean on autopilot.

  7. 7
    Send reliable email at scale

    Avoid Gmail spam folders and quota limits when Northwind sends thousands of emails.

    Before you send in volume, learn the patterns that keep delivery reliable.

  8. 8
    Throttle bulk sends to stay under Gmail quotas

    Batch and pace large merges across days using script properties and a daily-cap counter.

    Finish by staying inside Gmail's daily limits so nothing silently fails.