Bot template · Solo business

Gmail inbox triage bot: label, summarize and draft replies for review

by PaperChaseWebb

A Google Apps Script bot that labels new mail, drafts replies in your Drafts folder and emails a morning digest to you. Nothing goes to anyone else.

Preview card for Gmail inbox triage bot
Works withGeminiRuns on your own accounts
Price
$39
Difficulty
Intermediate
Setup
25 min
Format
.md file
$39 one time

gmail-inbox-triage-bot.md · 11 KB · instant download after checkout

Buy now · $39

Want this built for you instead? We can build it for you.

What you end up with

You open your inbox to a short digest and drafts that are already written, then spend minutes approving instead of an hour sorting.

What you get

  • One .md file with the complete Apps Script source (Code.gs) and a single config block
  • Labels: Needs reply, FYI, Receipts, Newsletters, plus Draft ready and Seen
  • Draft replies in your voice, with [CHECK: ...] markers where facts are missing
  • Morning digest sent only to your own address
  • SKIP_DOMAINS list so sensitive senders never reach the model
  • Dry run mode, optional usage log sheet, uninstall steps and an instruction block for your AI coding agent

Who it is for

Founders, consultants and operators who get 50 to 300 real emails a day and lose the important ones under receipts, newsletters and threads that only need an FYI.

Works with

GeminiRuns on your own accounts

Solid chips: the agent is named in this listing's own tools list. Dashed chip: Runs on your own accounts.

Tools needed

Google Apps Scriptruns on a timer inside your Google account
Gmailthe inbox being triaged
OpenAI, Anthropic or Gemini API keyclassifies, summarizes and drafts. Pick one in the config.
You needA Gmail or Google Workspace account
You needAn API key from one model provider

Cost to run: Apps Script is free within Google's quotas. Model API calls are pay per use on your own key, and the script logs usage so you can see it.
Time to result: First digest the next morning

How it works

  1. Create the script

    Open script.google.com, create a project and paste in the files from the template.

    Expected: The project saves with no errors.

  2. Add your key

    Store the model API key in Script Properties, not in the code, and choose the provider in config.

    Expected: Running testConnection() returns a short reply from the model.

  3. Dry run

    Run triage() with DRY_RUN set to true. It writes what it would do to the log without labeling anything.

    Expected: A log of planned labels you can sanity check.

  4. Turn it on

    Set DRY_RUN to false and run installTriggers once.

    Expected: New mail gets labeled within 15 minutes, and a digest arrives each morning.

Preview

Config block
const CONFIG = {
  PROVIDER: 'anthropic',            // 'openai' | 'anthropic' | 'gemini'
  MODEL: 'REPLACE-WITH-CURRENT-MODEL-NAME',
  DRY_RUN: true,                    // log only, change nothing
  LOOKBACK: 'newer_than:2d',
  MAX_THREADS_PER_RUN: 30,
  DRAFT_REPLIES: true,              // drafts only, never sends to anyone
  DIGEST_HOUR: 7,
  SKIP_DOMAINS: ['yourbank.com'],
  LOG_SHEET_ID: ''                  // optional usage log
};

Free preview of the file

gmail-inbox-triage-bot.md (excerpt)11 KB total
# Gmail inbox triage bot

PaperChase bot template, version 1.0. Google Apps Script, runs inside your Google account on a timer. Labels new mail, writes drafts for you to review and emails a morning digest to you only. It never sends anything to anyone else.

## What it does

Every 15 minutes it reads new inbox threads it has not seen, asks the model you choose to classify each one, and:

- applies one label: `Triage/Needs reply`, `Triage/FYI`, `Triage/Receipts` or `Triage/Newsletters`
- for Needs reply threads, saves a draft reply in your voice to Drafts and labels the thread `Triage/Draft ready`
- marks the thread `Triage/Seen` so it is never processed twice

Every morning at the hour you choose it emails you a digest: one line per Needs reply and FYI thread from the last 24 hours, with a link.

Nothing is archived, deleted or sent to other people. You can remove every label it created in one click.

## Contents

1. Before you start: data and quotas
2. Create the project and add your key
3. Source: Code.gs
4. Dry run, then turn it on
5. Tuning the classifier and your voice
6. Instructions for your AI coding agent
7. Uninstall

Worth knowing

  • Email content is sent to the model provider you choose. Read their data use policy, and add sensitive senders to SKIP_DOMAINS.
  • Apps Script has daily quotas. Very large inboxes may need a lower MAX_THREADS_PER_RUN.
  • Drafts are drafts. Read them before sending; the bot can misread tone or miss context from a phone call.

Questions

Can it send replies automatically?

Not as written. The only email it sends is your digest, to your own address. Replies stay in Drafts until you send them.

Does it work with Google Workspace?

Yes, if your admin allows Apps Script. Some organizations restrict scripts or third-party API calls.

Details

Version 1.0 · Updated Oct 15, 2026 · Markdown version of this page
License: Use on your own Google accounts and your team's. Do not resell or republish the template. Download terms

businessgmailapps-scriptemail