Skip to content

Gmail

Node: gmail · Full type: n8n-nodes-base.gmail · Version: 2.2

Credentials

googleApi (alias: @google) / gmailOAuth2 (alias: @gmail)

CREDENTIAL @google = googleApi "My Gmail"

Operations

Resource: message

addLabels

Parameter Type Default Details
messageId string "" required
labelIds multiOptions [] required

delete

Parameter Type Default Details
messageId string "" required

get

Parameter Type Default Details
messageId string "" required
simple boolean true
options collection {} keys: dataPropertyAttachmentsPrefixName, downloadAttachments

getAll

Parameter Type Default Details
returnAll boolean false
limit number 50
simple boolean true
filters collection {} keys: includeSpamTrash, labelIds, q, readStatus, receivedAfter, receivedBefore, ...
options collection {} keys: dataPropertyAttachmentsPrefixName, downloadAttachments

markAsRead

Parameter Type Default Details
messageId string "" required

markAsUnread

Parameter Type Default Details
messageId string "" required

removeLabels

Parameter Type Default Details
messageId string "" required
labelIds multiOptions [] required

reply

Parameter Type Default Details
messageId string "" required
emailType options "html" required; text, html
emailType options "html" required; text, html
message string "" required
options collection {} keys: appendAttribution, attachmentsUi, bccList, ccList, senderName, replyTo, ...

send

Parameter Type Default Details
sendTo string "" required
subject string "" required
emailType options "html" required; text, html
emailType options "html" required; text, html
message string "" required
options collection {} keys: appendAttribution, attachmentsUi, bccList, ccList, senderName, replyTo, ...

sendAndWait

Parameter Type Default Details
sendTo string "" required
subject string "" required
message string "" required
responseType options "approval" approval, freeText, customForm
defineForm options "fields" fields, json
jsonOutput json "[
{
"fieldLabel": "Name",
"..."
formFields fixedCollection {} groups: values
formFields fixedCollection {} groups: values
approvalOptions fixedCollection {} groups: values
options collection {} keys: limitWaitTime, appendAttribution
options collection {} keys: messageButtonLabel, responseFormTitle, responseFormDescription, responseFormButtonLabel, responseFormCustomCss, limitWaitTime, ...

Resource: label

create

Parameter Type Default Details
name string "" required
options collection {} keys: labelListVisibility, messageListVisibility

delete

Parameter Type Default Details
labelId string "" required

get

Parameter Type Default Details
labelId string "" required

getAll

Parameter Type Default Details
returnAll boolean false
limit number 50

Resource: draft

create

Parameter Type Default Details
subject string "" required
emailType options "text" required; html, text
message string "" required
options collection {} keys: attachmentsUi, bccList, ccList, fromAlias, replyTo, threadId, ...

delete

Parameter Type Default Details
messageId string "" required

get

Parameter Type Default Details
messageId string "" required
options collection {} keys: dataPropertyAttachmentsPrefixName, downloadAttachments

getAll

Parameter Type Default Details
returnAll boolean false
limit number 50
options collection {} keys: dataPropertyAttachmentsPrefixName, downloadAttachments, includeSpamTrash

Resource: thread

addLabels

Parameter Type Default Details
threadId string "" required
labelIds multiOptions [] required

delete

Parameter Type Default Details
threadId string "" required

get

Parameter Type Default Details
threadId string "" required
simple boolean true
options collection {} keys: returnOnlyMessages

getAll

Parameter Type Default Details
returnAll boolean false
limit number 50
filters collection {} keys: includeSpamTrash, labelIds, q, readStatus, receivedAfter, receivedBefore

removeLabels

Parameter Type Default Details
threadId string "" required
labelIds multiOptions [] required

reply

Parameter Type Default Details
threadId string "" required
messageId options ""
emailType options "text" required; text, html
message string "" required
options collection {} keys: attachmentsUi, bccList, ccList, senderName, replyToSenderOnly, replyToRecipientsOnly

trash

Parameter Type Default Details
threadId string "" required

untrash

Parameter Type Default Details
threadId string "" required

Common Parameters

Parameter Type Default Details
authentication options "oAuth2" oAuth2, serviceAccount

Parameter Details

options children:

Parameter Type Default Details
dataPropertyAttachmentsPrefixName string "attachment_"
downloadAttachments boolean false

filters children:

Parameter Type Default Details
includeSpamTrash boolean false
labelIds multiOptions []
q string ""
readStatus options "unread" both, unread, read
receivedAfter dateTime ""
receivedBefore dateTime ""
sender string ""

formFields children:

values group:

Parameter Type Default Details
fieldName string "" required
fieldLabel string "" required
fieldLabel string "" required
fieldName string ""
fieldType options "text" required; checkbox, html, date, dropdown, email, file, hiddenField, number, ... (12 total)
elementName string ""
fieldName string ""
placeholder string ""
defaultValue string ""
defaultValue dateTime ""
defaultValue string ""
defaultValue string ""
fieldValue string ""
fieldOptions fixedCollection {...} required; groups: values
fieldOptions fixedCollection {...} required; groups: values
fieldOptions fixedCollection {...} required; groups: values
multiselect boolean false
limitSelection options "unlimited" exact, range, unlimited
numberOfSelections number 1
minSelections number 0
maxSelections number 1
html string "

" | | | multipleFiles | boolean | true | | | acceptFileTypes | string | "" | | | requiredField | boolean | false | |

approvalOptions children:

values group:

Parameter Type Default Details
approvalType options "single" single, double
approveLabel string "Approve"
buttonApprovalStyle options "primary" primary, secondary
disapproveLabel string "Decline"
buttonDisapprovalStyle options "secondary" primary, secondary

Example

NODE "gmail" @google AS "Gmail" {
  resource: "message",
  operation: "get",
  messageId: {{ $json.messageId }},
  subject: {{ $json.subject }},
  message: {{ $json.message }}
}