Gmail Trigger logo

Gmail Trigger

OrganizationPopular
vellum-ai
gmail-trigger

Beta. Act on new Gmail as it arrives: get pinged only for urgent mail, digest newsletters, forward invoices — any standing instruction, across one or several accounts.

Overview

Publishervellum-ai
Repositoryvellum-assistant
Skill namegmail-trigger
Stars
1.3K
Forks
186
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by vellum-ai on GitHub. Read the source before you install it.

Installation

Install the Gmail Trigger AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vellum-ai/vellum-assistant.git /tmp/vellum-assistant
mkdir -p .claude/skills
cp -r /tmp/vellum-assistant/skills/gmail-trigger .claude/skills/gmail-trigger
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gmail Trigger in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gmail Trigger on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gmail Trigger is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Gmail Triggers (Beta)

Polls the user's Gmail inbox on a cron and escalates to the assistant only when a new message arrives — an empty poll spends zero LLM tokens. Installing it means creating a script-mode schedule that runs the schedule's own copy of the shipped poll script. Schedule mechanics (script mode, the schedules/<id>/ convention, waking the agent loop) are documented in the included schedule skill.

Why this instead of a watcher

A watcher could only be configured through its prompt and its cadence. This one is a script that belongs to the schedule, so the assistant can change anything about how it behaves by simply editing the script. And because it runs as a schedule, its runs, errors, and cost all show up on the Schedules page in the app.

Setup

1. Ensure Google is connected

The trigger reads Gmail through the user's Google OAuth connection with Gmail read access. Check with:

bash
assistant oauth status google

If no connection is found, load the vellum-oauth-integrations skill — it evaluates whether managed or your-own mode is appropriate and guides the user through connecting. Managed (proxy) and your-own OAuth both work — poll.ts calls Gmail via assistant oauth request, which resolves either automatically.

2. Choose the accounts to watch

If oauth status shows more than one active Google connection, ask the user which inboxes to watch and pass one --account <email> flag per chosen inbox. With a single connection the flag can be omitted. One schedule watches all chosen accounts and delivers one combined digest.

3. Collect the action prompt

Ask the user what should happen when new email arrives — e.g. "notify me only about emails needing a reply" or "summarize newsletters, flag anything from my boss". If the user doesn't care, omit the flag and the default applies: summarize what's new and flag anything urgent.

4. Ask about the first sync

By default the trigger starts from now and never escalates pre-existing email. Ask the user whether the first sync should instead include recent mail; if yes, append --lookback <duration> (90m/4h/2d/1w).

5. Create the schedule

Create a recurring script-mode schedule (default cadence every 15 minutes unless the user asks for a different one) whose command runs the schedule's own copy of the poll script with the flags chosen above:

bun "$VELLUM_WORKSPACE_DIR/schedules/$__SCHEDULE_ID/poll.ts" --account you@example.com --action-prompt 'Summarize new email; flag anything urgent'

Pass timeout_ms: 900000 — the poll's runtime includes the woken assistant turn. Single-quote the action prompt (the command runs through sh). All configuration lives in this command string, so it is visible in the schedule and editable later with assistant schedules update <id> --script "...".

6. Copy the poll script into the schedule's directory

Read the schedule id from the create result, then:

bash
mkdir -p "$VELLUM_WORKSPACE_DIR/schedules/<id>"
cp "$VELLUM_WORKSPACE_DIR/skills/gmail-trigger/scripts/poll.ts" "$VELLUM_WORKSPACE_DIR/schedules/<id>/poll.ts"

The schedule owns this copy — customizations made to it are never touched by skill upgrades. poll.ts self-provisions its state on first run; create nothing else.

7. Verify

bash
assistant schedules execute <id>
assistant schedules runs <id> --limit 1

The first run records {"ok":true,"new":0,"accounts":[{"account":"you@example.com","baselined":true,...}]}; later empty polls record "new":0 without baselined.

How it works

  • Deterministic poll, LLM only on new mail. poll.ts syncs incrementally with Gmail's History API via assistant oauth request --provider google (no raw token in the script). Each mailbox's watermark is a Gmail historyId, advanced only past history records actually processed, so a truncated poll resumes where it left off. No model call on an empty poll.
  • Per-mailbox state. Watermarks and dedup are keyed by the email address Gmail reports for the connection, in SQLite under schedules/<id>/state/. Accounts baseline, advance, fail, and recover independently — one broken connection doesn't stop the others, and an account switch behind the schedule starts cleanly instead of misreading another mailbox's watermark.
  • At-most-once escalation. Each account's watermark and reported-message ledger commit before the digest is escalated, so a retried or restarted run never escalates the same message twice; a failed wake surfaces as a failed run instead of a duplicate digest. The ledger is script-local bookkeeping — nothing is written to Gmail, and read/unread state is untouched.
  • Expiry recovery. Gmail keeps history for roughly a week. If a stored historyId has expired, that account re-baselines and catches up with a one-day inbox search; the ledger absorbs the overlap.
  • Fenced escalation. New mail wakes a fresh conversation with the digest passed via --external-content (fenced as untrusted data, never instructions); the user's action prompt goes in --hint as the trusted framing. The digest carries full metadata for the 50 newest messages across all accounts (sorted by internalDate) plus per-account totals.
  • Self-contained. Built-ins + the assistant CLI only — no dependencies.

Managing it

  • Change cadence: update the schedule's expression.
  • Add or remove a watched account: edit the schedule's command string (--account flags).
  • Customize behavior: edit the schedule's copy of poll.ts directly.
  • Update to a newer shipped script: re-copy poll.ts from the skill directory into schedules/<id>/, re-applying any custom edits.
  • Pause / resume: disable / enable the schedule.
  • Remove: delete the schedule; optionally clean up its schedules/<id>/ directory.
  • If polls start failing on auth, try assistant oauth ping google (often refreshes an expired token); if that fails, load the vellum-oauth-integrations skill to reconnect.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Gmail Trigger AI skill do?

Beta. Act on new Gmail as it arrives: get pinged only for urgent mail, digest newsletters, forward invoices — any standing instruction, across one or several accounts.

Why use Gmail Trigger on TypingMind?

Because you install it once and use it with any model. Gmail Trigger is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gmail Trigger in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/vellum-ai/vellum-assistant/tree/main/skills/gmail-trigger. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Gmail Trigger?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gmail Trigger?

As many as you like. As long as a model supports skills, you can use Gmail Trigger with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gmail Trigger AI skill free?

Yes. It is published on GitHub by vellum-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇