Gmail
Description
Section titled “Description”Module for complete Gmail operations: listing, sending, replying, drafts and email management. Includes multiple sub-nodes for different operations.
Requirements
Section titled “Requirements”- Google OAuth credential configured with Gmail permissions (
gmail.modifyorgmail.compose)
Available Sub-nodes
Section titled “Available Sub-nodes”1. List Emails
Section titled “1. List Emails”Lists inbox emails with optional filters.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| maxResults | number | No | Maximum number of emails (1-100). Default: 10 |
| labelIds | select | No | Folder/label: Inbox, Sent, Drafts, Spam, etc. |
| query | text | No | Gmail search filter |
| includeBody | boolean | No | Include full email body. Default: false |
Filter examples (query):
from:user@gmail.com— emails from a senderis:unread— unread onlysubject:invoice— with “invoice” in the subjectis:unread from:bank@mail.com— combine filtershas:attachment— with attachmentsafter:2024/01/01 before:2024/12/31— date range
Output:
{ "emails": [ { "id": "18abc123", "threadId": "18abc120", "from": "Juan <juan@gmail.com>", "to": "yo@gmail.com", "subject": "Factura Enero", "date": "Mon, 15 Jan 2024 10:30:00 +0000", "snippet": "Adjunto la factura...", "body": "Texto completo del email...", "htmlBody": "<html>...</html>", "isUnread": true } ]}2. List Unread Emails
Section titled “2. List Unread Emails”Shortcut to list only unread emails (pre-configures is:unread and includeBody: true).
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| maxResults | number | No | Maximum count. Default: 10 |
| query | text | No | Additional filter (already includes is:unread) |
| includeBody | boolean | No | Include full body. Default: true |
3. Get Email
Section titled “3. Get Email”Gets a specific email by its ID with all details.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| messageId | text | No | Email ID (direct or {{id}}) |
| messageIdKey | text | No | Field with the ID. Default: id |
| format | select | No | Format: Full, Metadata only, Minimal |
4. Send Email
Section titled “4. Send Email”Sends an email with support for attachments, CC, BCC and HTML format.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| to | text | Yes | Recipient(s) separated by comma |
| subject | text | Yes | Email subject |
| body | rich_text | Yes | Message body (HTML by default) |
| attachments | textarea | No | Attachment file paths |
Attachment format:
- One path per line:
/path/to/file.pdf - Variable with array:
{{attachments}} - Comma-separated:
/path/file1.pdf, /path/file2.xlsx
Output:
{ "sentEmail": { "id": "18abc456", "threadId": "18abc456", "labelIds": ["SENT"], "attachmentCount": 2 }}5. Reply Email
Section titled “5. Reply Email”Replies to an existing email maintaining the conversation thread.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| originalMessageId | text | No | Original email ID (direct or {{id}}) |
| originalMessageIdKey | text | No | Field with the original ID. Default: originalMessageId |
| replyBody | textarea | Yes | Reply content |
| isHtml | boolean | No | Body is HTML. Default: false |
Typical flow:
[List Unread] -> [Iterator] -> [AI Agent responds] -> [Reply Email] each email generates response {{id}} of original email6. Create Draft
Section titled “6. Create Draft”Creates an email draft in Gmail without sending it.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| to | text | Yes | Recipient(s) |
| subject | text | Yes | Subject |
| body | textarea | Yes | Message body |
| isHtml | boolean | No | Body is HTML. Default: false |
7. List Labels
Section titled “7. List Labels”Lists all Gmail labels/folders (INBOX, SENT, custom labels, etc.).
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
8. Mark as Read
Section titled “8. Mark as Read”Marks an email as read or unread.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| messageId | text | No | Email ID (direct or {{id}}) |
| messageIdKey | text | No | Field with the ID. Default: messageId |
| markAsRead | select | No | Mark as read / unread. Default: read |
9. Trash Email
Section titled “9. Trash Email”Moves an email to the Gmail trash.
| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Google OAuth account |
| messageId | text | No | Email ID (direct or {{id}}) |
| messageIdKey | text | No | Field with the ID. Default: messageId |
Usage Example
Section titled “Usage Example”Auto-reply to unread emails
Section titled “Auto-reply to unread emails”[Cron trigger every 5min] -> [List Unread] -> [Iterator] -> [AI Agent] -> [Reply Email] -> [Mark as Read]Create draft for review
Section titled “Create draft for review”[HTTP Trigger] -> [Create Draft] -> [Notify via Slack] form data draft ready for reviewProcess attachments
Section titled “Process attachments”[List Emails query:"has:attachment"] -> [Get Email] -> [Process attachment] -> [Upload to Drive]Common errors
Section titled “Common errors”| Error | Cause | Solution |
|---|---|---|
Recipient (to) is required | ”To” field is empty | Fill in the recipient |
Subject is required | ”Subject” field is empty | Fill in the subject |
originalMessageId is required | No email specified to reply to | Pass the ID with {{id}} from a previous node |
messageId is required | No email specified to mark/delete | Pass the email ID |
Insufficient Permission | The account lacks Gmail permissions | Reconnect the account with Gmail permissions |
Related Nodes
Section titled “Related Nodes”- Google Calendar - Manage calendar events
- Google Drive - Manage files in Drive
- Google Sheets - Operate with spreadsheets