GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Windmill Hub
  • Discord
  • Discussions
  • Windmill
  • Login
  • Windmill docs

This view

  • Original page
  • New address

GeezerVison is showing hub.windmill.dev — Gmail integration | Windmill Hub

What you can do with Gmail

Complete, deployable projects built around Gmail — the fastest way to get something real running.

Support engine

Drafts replies to your support inbox into Gmail drafts, ready for you to send.

Sales engine

Finds leads matching your ICP, drafts an email to the ones worth writing to, and leaves them in Gmail drafts.

Set up in 2 steps

1

Connect from the Resources page

Open Resources, click Add a resource/API and pick gmail under Instance-configured OAuth APIs. Click Connect and sign in with the Google account the mail should be sent from, then name the resource and save it.

2

Run your first script

Fork the send email script below, or drop the approval step into a flow.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Send Email with Service Account

Script gmail Verified

Send Email

Script gmail Verified

List Send-As Aliases

Script gmail Verified

List Labels

Script gmail Verified

Get Send-As Alias

Script gmail Verified

Get Profile

Script gmail Verified

Download Attachment

Script gmail Verified

Delete Label

Script gmail Verified

Create Label

Script gmail Verified

New Email

Script· trigger gmail Verified

Search Messages

Script gmail Verified

Modify Labels

Script gmail Verified

Get Thread

Script gmail Verified

Get Message

Script gmail Verified

Create Draft

Script gmail Verified

Suspend/resume a flow by sending approval URL via email

Script· approval gmail Verified

Flows

Multi-step workflows that already wire Gmail to something else.

All flows →
+1

Ban a user, notify them by email, and us by Slack

Flow postgresql slack +1 Verified

Trigger flows from Gmail

Gmail is not only a destination. These inbound paths are supported today.

New email (scheduled poll)

The New Email trigger script returns the messages matching a search query since its last run; it needs gmail.readonly or gmail.modify. To run it, open a flow, add a trigger and choose Scheduled Poll, then pick the trigger script and an interval. The steps after it run once per new item, and each flow keeps its own cursor.

Instant push (Pub/Sub in your own Google Cloud project)

Gmail pushes only to a Pub/Sub topic in your own Google Cloud project, which is why the trigger above polls. For instant delivery, call users.watch on your topic (renew it daily) and attach Windmill's GCP Pub/Sub trigger (self-hosted Enterprise) to a subscription. Each notification carries only a historyId, so the handler calls users.history.list.

Resource type

The shape of the credential every script on this page expects.

gmail

View raw schema →
FieldTypeRequiredWhat it is
tokenstringYes

Often combined with

Integrations that appear alongside Gmail in hub flows and projects.

Anthropic 2 GitHub 2 Apollo 1 Discord 1 PostgreSQL 1 Slack 1

Questions

What can Windmill do with my mailbox?

Whatever scope you tick when connecting. The default, gmail.send, only sends; reading, search and the new-email trigger need gmail.readonly, drafts gmail.compose, labels gmail.modify or gmail.labels, and gmail.modify covers every script. Each script names its scope.

Can I create the resource by hand instead of connecting?

No: Google access tokens last about an hour, and only the OAuth flow gets the refresh token that renews them, which is why this page has no CLI lane. For a credential that does not expire, use Send Email with Service Account (Google Workspace, below) or send through the smtp resource.

Can I send from a shared Workspace mailbox with a service account?

Yes, with the Send Email with Service Account script, which needs no OAuth connection and no token refresh: it signs a JWT with the service account key on every run and impersonates the mailbox you pass as delegated_user. 1) In Google Cloud, create a service account, enable the Gmail API on its project and download a JSON key. 2) In the Google Admin console (super admin), open Security > Access and data control > API controls > Domain-wide delegation, click Add new, and enter the service account's client ID (the numeric client_id in the key) with the scope https://www.googleapis.com/auth/gmail.send. 3) In Windmill, create a google_service_account resource from the key. To keep the key in a secret store, put private_key in a secret variable (for example one backed by Vault) and set the field to $var:<path>. Delegation only works for mailboxes in your Workspace domain, not @gmail.com accounts; if the client ID or scope is missing, the token request fails with unauthorized_client.

There is no Connect button on my instance

An instance admin has to add a Google OAuth client once, under Instance settings → Auth/OAuth/SAML → OAuth. Until then, send mail through the smtp resource.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.