Gmail Node
Automate email workflows in Google Gmail — send, read, organize, and manage messages, drafts, labels, and threads using OAuth2 authentication.
Authentication: All operations require a
credentialId referencing a stored OAuth2 credential in the BizFirst Credentials Manager. OAuth tokens are never exposed in workflow configuration. The required Gmail API scope varies by operation: gmail.send, gmail.modify, or gmail.readonly.
Resources
Authentication
All Gmail node operations authenticate via OAuth2. Credentials are stored in the BizFirst Credentials Manager and referenced by a credentialId (Guid). Never expose raw tokens in workflow configuration.
| Field | Type | Description |
|---|---|---|
credentialId | Guid required | ID of the stored Gmail OAuth2 credential in the BizFirst Credentials Manager. |
| OAuth Scope | Used By |
|---|---|
https://www.googleapis.com/auth/gmail.send | message/send, message/reply, draft operations, thread/reply |
https://www.googleapis.com/auth/gmail.modify | message/trash, message/untrash, message/markAsRead, message/markAsUnread, message/addLabel, message/delete, label CRUD, thread label ops |
https://www.googleapis.com/auth/gmail.readonly | message/get, message/getMany, draft/get, draft/getMany, label/get, label/getMany, thread/get, thread/getMany |
Gmail API Rate Limits
| Operation | Quota Units | Notes |
|---|---|---|
| Global limit | 250 units/user/second | Applies across all Gmail API calls |
| messages.send | 100 units | Personal: 500/day; Workspace: 2,000/day |
| messages.get | 5 units | Per message fetch |
| messages.list | 5 units | Per list request, regardless of page size |
| labels.* | 1 unit | Cheap — safe for frequent use |
| threads.* | 5–10 units | Varies by operation type |
Daily Send Limits: Personal Gmail accounts are limited to 500 messages/day. Google Workspace accounts allow up to 2,000 messages/day. Design automated send workflows with throttling to stay within limits.
Gmail Search Query Syntax
filterQ field: Operations that support
filterQ accept Gmail's full search query syntax. Test queries in the Gmail web UI before using in automation.
| Operator | Example | Description |
|---|---|---|
from: | from:client@example.com | Filter by sender |
to: | to:support@myco.com | Filter by recipient |
subject: | subject:Invoice | Filter by subject line |
has:attachment | has:attachment | Only messages with attachments |
after: | after:2024/01/01 | Messages received after date |
before: | before:2024/12/31 | Messages received before date |
label: | label:INBOX | Filter by label name |
is:unread | is:unread | Only unread messages |
is:starred | is:starred | Only starred messages |
| Combination | from:vendor@co.com subject:Invoice after:2024/06/01 | Multiple operators are ANDed |
Node Policies & GuardRails
| Policy | Rule |
|---|---|
| Credential Storage | Store OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration |
| API Quota Management | Gmail API enforces 250 units/user/second — batch multiple list operations carefully and implement backoff on 429 responses |
| Recoverable Deletion | Use message/trash instead of message/delete for recoverable deletion; delete only after legal/GDPR confirmation |
| PII Protection | Do not log email bodies in workflow execution history — email content contains PII and may violate data protection regulations |
| Send Rate Limiting | Throttle automated send operations — Gmail enforces 500 messages/day for personal accounts, 2,000/day for Google Workspace |
| Test Isolation | Test all Gmail workflows in a dedicated test account before connecting a production inbox |
| Query Validation | Validate filterQ search queries in the Gmail web UI before deploying automated workflows |
Common Use Case Patterns
- Customer Onboarding: Trigger on new user registration →
message/sendwelcome email →message/addLabelwith "Onboarded" label - Support Inbox Automation: IMAP trigger →
message/getto parse content → route by subject →message/replywith acknowledgment →message/markAsRead - Invoice Processing:
message/getManywithfilterQ: "subject:Invoice has:attachment"→ extract attachment → process in accounting system - Draft Review Workflow: Compose email in workflow →
draft/create→ pause for human review → on approval, send draft via API - Label-Based Routing:
label/createproject labels →message/addLabelbased on sender/subject rules → team routes inbox by label