Skip to content

Gmail

Module for complete Gmail operations: listing, sending, replying, drafts and email management. Includes multiple sub-nodes for different operations.

  • Google OAuth credential configured with Gmail permissions (gmail.modify or gmail.compose)

Lists inbox emails with optional filters.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
maxResultsnumberNoMaximum number of emails (1-100). Default: 10
labelIdsselectNoFolder/label: Inbox, Sent, Drafts, Spam, etc.
querytextNoGmail search filter
includeBodybooleanNoInclude full email body. Default: false

Filter examples (query):

  • from:user@gmail.com — emails from a sender
  • is:unread — unread only
  • subject:invoice — with “invoice” in the subject
  • is:unread from:bank@mail.com — combine filters
  • has:attachment — with attachments
  • after: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
}
]
}

Shortcut to list only unread emails (pre-configures is:unread and includeBody: true).

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
maxResultsnumberNoMaximum count. Default: 10
querytextNoAdditional filter (already includes is:unread)
includeBodybooleanNoInclude full body. Default: true

Gets a specific email by its ID with all details.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
messageIdtextNoEmail ID (direct or {{id}})
messageIdKeytextNoField with the ID. Default: id
formatselectNoFormat: Full, Metadata only, Minimal

Sends an email with support for attachments, CC, BCC and HTML format.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
totextYesRecipient(s) separated by comma
subjecttextYesEmail subject
bodyrich_textYesMessage body (HTML by default)
attachmentstextareaNoAttachment 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
}
}

Replies to an existing email maintaining the conversation thread.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
originalMessageIdtextNoOriginal email ID (direct or {{id}})
originalMessageIdKeytextNoField with the original ID. Default: originalMessageId
replyBodytextareaYesReply content
isHtmlbooleanNoBody is HTML. Default: false

Typical flow:

[List Unread] -> [Iterator] -> [AI Agent responds] -> [Reply Email]
each email generates response {{id}} of original email

Creates an email draft in Gmail without sending it.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
totextYesRecipient(s)
subjecttextYesSubject
bodytextareaYesMessage body
isHtmlbooleanNoBody is HTML. Default: false

Lists all Gmail labels/folders (INBOX, SENT, custom labels, etc.).

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account

Marks an email as read or unread.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
messageIdtextNoEmail ID (direct or {{id}})
messageIdKeytextNoField with the ID. Default: messageId
markAsReadselectNoMark as read / unread. Default: read

Moves an email to the Gmail trash.

FieldTypeRequiredDescription
credentials_idcredentialsYesGoogle OAuth account
messageIdtextNoEmail ID (direct or {{id}})
messageIdKeytextNoField with the ID. Default: messageId
[Cron trigger every 5min] -> [List Unread] -> [Iterator] -> [AI Agent] -> [Reply Email] -> [Mark as Read]
[HTTP Trigger] -> [Create Draft] -> [Notify via Slack]
form data draft ready for review
[List Emails query:"has:attachment"] -> [Get Email] -> [Process attachment] -> [Upload to Drive]
ErrorCauseSolution
Recipient (to) is required”To” field is emptyFill in the recipient
Subject is required”Subject” field is emptyFill in the subject
originalMessageId is requiredNo email specified to reply toPass the ID with {{id}} from a previous node
messageId is requiredNo email specified to mark/deletePass the email ID
Insufficient PermissionThe account lacks Gmail permissionsReconnect the account with Gmail permissions
  • Google Calendar - Manage calendar events
  • Google Drive - Manage files in Drive
  • Google Sheets - Operate with spreadsheets