You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new catalog script — gmail-ai-triage — that uses Gemini (via the Apps Script Vertex AI Service) to automatically read incoming Gmail messages, classify them against a user-defined set of categories, and apply the matching Gmail label. Configuration is a list of { labelName, description } pairs entered via Step 4 of the deploy page. This is the open-source, browser-deployable, single-Google-account answer to the n8n / Lindy / Shortwave AI-triage workflows.
Market Signal
AI email triage is the single most-cited workflow in 2026 no-code automation roundups. The n8n-email-ai-agent repo exists specifically as "AI-powered Gmail email triage workflow … automatically classifies emails, applies labels, and drafts AI responses." Lindy and Gumloop's 2026 Gmail-AI-assistant comparisons rank this exact workflow as their #1 use case. Every alternative requires either a paid SaaS subscription, a self-hosted n8n instance, or a developer-grade setup. None offer "click Deploy in a browser, sign in with Google, done."
User Signal
The current catalog has only label-consuming automations (gmail-to-drive-by-labels). There is a pre-existing assumption that the user already curates their labels manually. Closing the loop by generating the labels in the first place is the obvious next move and the natural pairing for the existing label-archive script. No specific issue requests this yet, but the gap is structurally visible: the catalog has a label consumer and no label producer.
Technical Opportunity
Every architectural piece is already in place:
Catalog-native extensibility is documented in the PRD as a deliberate design ("the deploy page is architected as a script host, not a script-specific UI"). calendar-to-briefing-doc is already cited as proof that adding a new script inherits the deploy/configure flow for free.
The dual-layer pattern (code.gs + src/index.js + injected GAS services) is the documented standard, and the new script would follow it exactly.
Step 4's schema-driven config form already supports adding new field types — a multi-row (labelName, description) editor is a straightforward addition mirroring the existing label-to-folder UI from gmail-to-drive-by-labels.
The Vertex AI Service handles the model call with no extra dependencies.
A time-based trigger every N minutes mirrors the trigger pattern from existing scripts.
Assessment
Dimension
Score
Rationale
Feasibility
high
Pure composition of patterns the project already proves work — no new infrastructure, no new test patterns, no new OAuth scopes beyond what gmail.modify adds
Impact
high
Adds the most-requested AI workflow in the entire adjacent market to the catalog as the third script; pairs naturally with the existing label-archive script to form a complete inbox-management story
Urgency
high
AI Gmail triage is where the no-code automation market is investing in 2026; the open-source GAS catalog is currently absent from this conversation
Adversarial Review
Strongest objection: "Auto-labeling email is a destructive operation against the user's most personal inbox — one bad classification and the user loses trust forever. The blast radius is too high for an automation that runs on a trigger."
Rebuttal: Mitigate at the design level, not by abandoning the feature. (1) Default to dry-run: the first deploy runs in shadow mode for N days, writing what it would have labeled to a Drive Doc instead of touching Gmail. (2) Apply, don't move: only add labels, never remove them, never archive, never delete. (3) User-defined scope: restrict processing to a single source label (e.g. INBOX or a user-chosen filter) rather than the whole mailbox. (4) Explainability: optionally append the model's one-line reason to the email as a label like ai-triage/<reason> so the user can audit. The combination — additive-only labels + opt-in scope + dry-run default — keeps blast radius small while still delivering the feature.
Suggested Next Step
Create a product brief covering: trigger model and quota budget, dry-run mode design, the (labelName, description) schema for SCRIPT_CATALOG, the Vertex AI prompt template, and the test plan for mocking Gmail + Vertex services together. Validate the dry-run output on a real personal inbox before promoting to live mode.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Add a new catalog script —
gmail-ai-triage— that uses Gemini (via the Apps Script Vertex AI Service) to automatically read incoming Gmail messages, classify them against a user-defined set of categories, and apply the matching Gmail label. Configuration is a list of{ labelName, description }pairs entered via Step 4 of the deploy page. This is the open-source, browser-deployable, single-Google-account answer to the n8n / Lindy / Shortwave AI-triage workflows.Market Signal
AI email triage is the single most-cited workflow in 2026 no-code automation roundups. The n8n-email-ai-agent repo exists specifically as "AI-powered Gmail email triage workflow … automatically classifies emails, applies labels, and drafts AI responses." Lindy and Gumloop's 2026 Gmail-AI-assistant comparisons rank this exact workflow as their #1 use case. Every alternative requires either a paid SaaS subscription, a self-hosted n8n instance, or a developer-grade setup. None offer "click Deploy in a browser, sign in with Google, done."
User Signal
The current catalog has only label-consuming automations (
gmail-to-drive-by-labels). There is a pre-existing assumption that the user already curates their labels manually. Closing the loop by generating the labels in the first place is the obvious next move and the natural pairing for the existing label-archive script. No specific issue requests this yet, but the gap is structurally visible: the catalog has a label consumer and no label producer.Technical Opportunity
Every architectural piece is already in place:
calendar-to-briefing-docis already cited as proof that adding a new script inherits the deploy/configure flow for free.code.gs+src/index.js+ injected GAS services) is the documented standard, and the new script would follow it exactly.(labelName, description)editor is a straightforward addition mirroring the existing label-to-folder UI fromgmail-to-drive-by-labels.Assessment
gmail.modifyaddsAdversarial Review
Strongest objection: "Auto-labeling email is a destructive operation against the user's most personal inbox — one bad classification and the user loses trust forever. The blast radius is too high for an automation that runs on a trigger."
Rebuttal: Mitigate at the design level, not by abandoning the feature. (1) Default to dry-run: the first deploy runs in shadow mode for N days, writing what it would have labeled to a Drive Doc instead of touching Gmail. (2) Apply, don't move: only add labels, never remove them, never archive, never delete. (3) User-defined scope: restrict processing to a single source label (e.g.
INBOXor a user-chosen filter) rather than the whole mailbox. (4) Explainability: optionally append the model's one-line reason to the email as a label likeai-triage/<reason>so the user can audit. The combination — additive-only labels + opt-in scope + dry-run default — keeps blast radius small while still delivering the feature.Suggested Next Step
Create a product brief covering: trigger model and quota budget, dry-run mode design, the
(labelName, description)schema forSCRIPT_CATALOG, the Vertex AI prompt template, and the test plan for mocking Gmail + Vertex services together. Validate the dry-run output on a real personal inbox before promoting to live mode.Proposed by the BMAD Analyst (Mary) on 2026-04-07.
Workflow run
Beta Was this translation helpful? Give feedback.
All reactions