Install
Send, reply to, and draft emails in Gmail. Read, search, label, trash, and delete messages and threads, with attachments as binary data. A trigger starts a run for each new email that matches a query. Connect with Google sign-in or a service account.
- Open System, then Nodes.
- Find Gmail and click Install.
- Use the new nodes at once. You do not restart.
How it works
On new email (Gmail) (trigger.gmail) is a trigger node in the Gmail package (@zerodot/gmail): Start a run when a new email matches a search or a label.
A polling trigger. It checks the mailbox on a timer (Check Every, 60 seconds by default). It starts one run for each new email. The first check starts no runs. It only sets the start time.
- Search, Labels, Sender, and Read Status (unread by default) limit the mails.
- Include Spam and Trash adds these folders.
- Include Drafts (off by default) lets drafts start runs. Mail that you sent and that is not in the inbox never starts a run.
- Simplify and Download Attachments work as in the Gmail node. Attachment Prefix (
attachment_by default) sets the start of the binary names. - Action: Mark as read removes
UNREADfrom each mail after the run starts. - Most Mails per Check limits one check. The next check gets the others.
The input of the run is the email. Each mail starts one run only, also when the mail stays unread.
Logins it can use
Scope: https://mail.google.com/. Gmail needs this scope to delete messages for good.
- Gmail OAuth2 (
gmail.oauth2):clientIdandclientSecretof a Google Cloud OAuth client. Sign in with a Google account. zerodot refreshes the token. The client secret and the tokens are secret. - Gmail service account (
gmail.service_account): the JSON key file of a service account, as text, andimpersonatedUser, the email address of the user that the service account acts as. The key is secret. A service account has no mailbox of its own, so you must turn on domain-wide delegation:- In Google Cloud, turn on domain-wide delegation for the service account. Copy its client ID.
- In the Google Workspace admin console, go to Security > API controls > Domain-wide delegation. Add the client ID with the scope
https://mail.google.com/.
Turn on the Gmail API in the Google Cloud project.
Guides and related hubs
Configure webhook URLs, schedules, and polling triggers.
All Email nodesSend transactional emails, manage newsletters, and automate campaigns via SMTP, Resend, Mailgun, Mailchimp, Gmail, and Beehiiv.
Use credentialsAES-256-GCM encrypted API keys and OAuth2 connections.
Compare alternativesCompare zerodot with n8n, Zapier, Windmill, and Activepieces.