Skip to main content

Gmail Trigger

Type ID: gmailTrigger  ·  Kind: Trigger  ·  Trigger style: poll  ·  Ports: 1 in, 1 out (0 in when used as the workflow's root trigger)

Polls the Gmail API on an interval and triggers the workflow when new emails matching the configured filters are received.

Credentials​

Gmail

Properties​

PropertyKeyTypeRequiredDefaultPossible valuesApplies when
Poll IntervalpollIntervalMsnumberYes60000Interval in milliseconds to check for new emails (minimum 60 seconds)Always
EventeventoptionsYesmessageReceivedmessageReceived (Message Received)Always
OutputoutputoptionsNosimplesimple (Simplified), raw (Raw), fields (Select Included Fields)Always
FieldsfieldscheckboxYes[]id, threadId, labelIds, snippet, historyId, internalDate, payload, sizeEstimate, raw, classificationLabelValuesoutput = fields
Include AttachmentsincludeAttachmentsbooleanNofalseDownload message attachments and return them as binary dataAlways
FiltersfiltersobjectNo{}See sub-tableAlways
OptionsoptionsobjectNo{}See sub-tableAlways

filters (object)​

PropertyKeyTypeRequiredDefaultPossible values
Read StatusreadStatusoptionsNounreadboth (Unread and read messages), unread (Unread messages only), read (Read messages only)
SendersenderstringNo''Email address to match (from:)
Subject ContainssubjectContainsstringNo''Text the subject must contain (subject:)
Has AttachmenthasAttachmentbooleanNofalseOnly return messages with attachments
LabellabelstringNoINBOXGmail label, e.g. INBOX, SENT, IMPORTANT

options (object)​

PropertyKeyTypeRequiredDefaultPossible values
Mark as ReadmarkAsReadbooleanNofalseMark emails as read after triggering
Max Emails Per PollmaxEmailsnumberNo10Max emails processed per poll (clamped to 1-50)

Notes​

  • If no emails match the filters within the poll window, the node returns null and the workflow does not trigger.
  • readStatus, label, sender, subjectContains, and hasAttachment combine into a single Gmail search query; matches are further checked against the precise poll window since Gmail's date filter is day-granular.
  • Emits one item containing emails (array) and a summary (count, subjects, senders, pollInterval, polledAt).
  • If markAsRead is set, matched emails have their UNREAD label removed (best-effort); if includeAttachments is set, attachments are downloaded into the item's binary data.