Skip to main content

Gmail

Type ID: gmail  ·  Kind: Action  ·  Trace: TOOL

Send and read emails using the Gmail API.

Credentials

Gmail

Resources & operations

  • Message (message)
    • Send (send) — Send a message
    • Read All (readAll) — Read all messages

Properties

Common

PropertyKeyTypeRequiredDefaultPossible valuesShown when
ResourceresourceoptionsNomessageMessage (message)
OperationoperationoptionsNosendSend (send), Read All (readAll)resource = message

Message → Send

PropertyKeyTypeRequiredDefaultPossible valuesShown when
To (Recipients)toRecipientsstringYes''Comma-separated list of primary recipient email addressesresource = message, operation = send
Email SubjectsubjectstringNo''Free textresource = message, operation = send
MessagebodyContentstringNo''Free text (message body)resource = message, operation = send
Advanced Email OptionsadditionalFieldsobjectNo{}Collection (see below)resource = message, operation = send

additionalFields collection options:

PropertyKeyTypeRequiredDefaultPossible values
BCC (Hidden Recipients)bccRecipientsstringNo''Comma-separated list of BCC email addresses
CC (Carbon Copy Recipients)ccRecipientsstringNo''Comma-separated list of CC email addresses
Body Content FormatbodyContentTypeoptionsNotextHTML (html), Text (text)
Reply-To AddressreplyTostringNo''Email address recipients should reply to

Message → Read All

PropertyKeyTypeRequiredDefaultPossible valuesShown when
OutputoutputoptionsNosimpleSimplified (simple), Raw (raw), Select Included Fields (fields)resource = message, operation = readAll
LimitlimitnumberYes100Max number of results to returnresource = message, operation = readAll
FieldsfieldscheckboxYes[]id, threadId, labelIds, snippet, historyId, internalDate, payload, sizeEstimate, raw, classificationLabelValuesresource = message, operation = readAll, output = fields
FiltersuserFiltersobjectNo{}Collection (see below)resource = message, operation = readAll

userFilters collection options:

PropertyKeyTypeRequiredDefaultPossible values
Filter ByfilterByoptionsNofiltersFilters (filters), Search (search)
SearchsearchstringNo''Gmail search query (e.g. from:user@example.com subject:hello); shown when filterBy = search
FiltersfiltersobjectNo{}Nested collection (see below); shown when filterBy = filters

userFilters.filters nested collection options:

PropertyKeyTypeRequiredDefaultPossible values
Read StatusreadStatusoptionsNounreadUnread and read messages (both), Unread messages only (unread), Read messages only (read)
Received AfterreceivedAfterdateTimeNo''ISO date string or millisecond timestamp
Received BeforereceivedBeforedateTimeNo''ISO date string or millisecond timestamp
SendersenderstringNo''Sender name or email to filter by
Has AttachmenthasAttachmentbooleanNofalsetrue / false
LabellabelstringNo''Label name (e.g. INBOX, SENT, IMPORTANT)

Notes

  • Requires a Gmail credential; the credential ID is read from credentials.id and resolved to an OAuth bearer token. A missing token raises Workflow error, credentials missing.
  • All requests go to https://gmail.googleapis.com/gmail/v1/users/me with Authorization: Bearer <token>. Errors throw Gmail API request failed (<status>): <message>.
  • Send builds an RFC 2822 message, base64url-encodes it, and calls POST /messages/send with { raw }. Recipients are parsed from comma-separated strings; CC/BCC/Reply-To are only added when present. Body defaults to a single space if empty; content type defaults to text. Output: { success: true, messageId, threadId, labelIds }.
  • Read All first calls GET /messages with maxResults = limit and an optional q search query built from the filters, then fetches each message via GET /messages/{id}. Format per output: raw requests format=raw; simple/fields request format=full. simple returns a simplified shape, fields filters to the selected keys client-side (Gmail does not support server-side field selection), raw returns the full message. Output: { success: true, data: [...] } (empty data array when no messages match).