GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing hub.windmill.dev — Gmail integration | Windmill Hub What you can do with GmailComplete, deployable projects built around Gmail — the fastest way to get something real running. Set up in 2 steps1 Connect from the Resources pageOpen 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 scriptFork the send email script below, or drop the approval step into a flow. ScriptsBuilding blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow. 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 FlowsMulti-step workflows that already wire Gmail to something else. Trigger flows from GmailGmail 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 typeThe shape of the credential every script on this page expects. gmailView raw schema →
Often combined withIntegrations that appear alongside Gmail in hub flows and projects. QuestionsWhat 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 instanceAn 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. |