The AgentivUse cases

Operations · An afternoon

A shared inbox that sorts itself

An agent that sorts the shared Gmail inbox into reply, action and FYI, drafts the replies and logs every decision in a Sheet

The problem

A shared info@ or ops@ inbox gets a hundred emails a day and the person on duty reads all of them to find the twenty that need something. Replies go out late, tasks hide in threads, and nobody can say afterwards what was handled or why.

Architecture

  1. Channel
    • Shared Gmail inbox
    • Classify emails button
  2. Agent
    • Apps Script Gmail add-on
    • Gemini with a fixed prompt
  3. Tools
    • Gmail labels and drafts
    • Google Sheets log
  4. Human
    • Person sends every reply
    • Person moves tasks to board

Where the data stays: Mail stays in Gmail and decisions in a restricted Sheet; Gemini runs in your own Google Cloud project.

Design flow

  1. Collect unread emails from the last 7 days
  2. Gemini sorts: reply, action or FYI
  3. Matching Gmail label applied
  4. Draft reply for needs-response emailsOnly sometimes
  5. Email, category and reason logged
  6. Person reviews drafts before sendingHuman checkpoint

Setup

Total time: 2 h 5 min our estimate

  1. 20 min

    Done when: In your own Google Cloud project the Gemini (Vertex AI), Gmail and Sheets APIs show as enabled.

  2. 30 min

    The test deployment installs the add-on for the account you are signed in with, so build and install it as the shared inbox account.

    Done when: The project is linked to the Cloud project number, holds every .gs file from the Email Classifier sample, and Constants.gs has your PROJECT_ID and name.

  3. 15 min

    Done when: The consent screen exists with audience Internal and your support and contact email.

  4. 10 min

    Done when: Email Classifier appears in Gmail's right sidebar and its Create labels button has added the three labels.

  5. 30 min

    Done when: After Classify emails, the linked Sheet has a row per unread email with category and reason, and you agree with the sorting of a morning's mail.

  6. 20 min

    The sample has basic error handling only: add retries and watch API rate limits before you run it every day.

    Done when: Every needs-response draft was read, edited or deleted by the person on duty, and nothing left Gmail without them.

Ticks are saved on this browser.

Download the kit (zip)

Risks and data

Data

Subjects and bodies sent to the model may carry customer personal data. Run it in your own Google Cloud project with an Internal consent screen, restrict the log Sheet to the team that owns the inbox, and leave out mailboxes that handle HR or health matters.

How it goes wrong

An urgent email filed as FYI waits unseen, or a batch stops halfway on a rate limit or an unhandled error. The Sheet logs every email with its category and reason, so a scan of the FYI rows catches mis-sorts, a short log shows a broken run, and nothing goes out because a person sends every reply.

Data protection. This use case touches personal data, so check the rules where you operate (for example GDPR, PDPA). Email bodies sent to Gemini may contain customer personal data. Run it inside your own Google Cloud project under your Workspace terms, restrict access to the log Sheet, and exclude mailboxes that handle HR or health matters.

How the agent works

  1. It starts

    On a schedule, or when the duty person clicks a button in the Gmail side panel, the agent collects unread emails from the last seven days and sends the subject and body of each to Gemini with a fixed prompt.

  2. The agent works

    Each email is classified as needs-response, action-required or for-your-info and gets the matching Gmail label. For needs-response emails the agent writes a draft reply in Gmail; for action-required ones it logs the task. Every email, its category and the reason are appended to a Google Sheet so the team can audit the decisions.

  3. The result

    A person reviews the drafts before sending and moves tasks to the task board; the agent never sends mail.

Worked example

Google's own Apps Script samples repository ships this as the Email Classifier add on: it processes unread emails from the last seven days, classifies each into needs-response, action-required or for-your-info, applies the label, generates draft replies for the needs-response group and logs each email's details, classification and reason to a Google Sheet. A sibling sample in the same repository labels emails with an upset tone using Gemini on Vertex AI. Google notes the sample has only basic error handling, so harden it before daily use.

Apps Script can call the Claude or OpenAI API with the same prompt in place of Gemini, and Make, n8n or Zapier can run the same Gmail to Sheets flow without code.

Join the Agent OS Club

Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.

Founding offer, ends 31 December 2026 or at member 100

Join the Agent OS Club

Building this for an organization? Learn more at theagentiv.com

Sources

Published: 2026-10-16

Related use cases

Find the people your network misses

Prospective fellowship candidates found in public news and web sources, extracted, summarised, filtered by a quality threshold and sorted by the foundation's own assessment criteria by Claude into a reviewer app, so a team of 13 reviewed over 20,000 candidates in a year

OperationsEffort: A project
ClaudeAlso works with:OpenAIGemini

A foundation, an accelerator, an award or a recruiter finds candidates through whoever its network happens to recommend, and knows it is missing people who never cross that network. Widening the search by hand means someone reading thousands of articles, so it never happens.

Thai official letters right first time

Thai official letters and Word documents drafted, rendered and checked by an open source skill for Claude Code and claude.ai, with every fact the owner did not give marked for the signer to fill in and no emblem, number or signature added by the AI

OperationsEffort: An afternoonThailand
Claude CodeClaudeAlso works with:OpenAI Codex

A Thai SME writes to government offices, banks and large customers in the formal formats they expect: หนังสือภายนอก, บันทึกข้อความ, หนังสือรับรอง, รายงานการประชุม. Getting the margins, fonts, Thai digits and salutations right takes an admin hours, and Word still breaks Thai words in the middle at the end of a line, so a document that looks fine on screen prints badly.

Inventory dashboard, no developer needed

Inventory dashboard for more than a thousand miniatures built with ChatGPT by a two owner gift shop, fed by the inventory tools it already uses, so bestsellers stay in stock and the owners place every reorder

OperationsEffort: About a week
ChatGPTAlso works with:Claude

A gift shop that sells miniatures carries more than a thousand small products, and nobody can see at a glance which bestsellers are about to run out. A commissioned dashboard would have cost around USD 50,000 by one owner's estimate, and stock checks took hours.