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
- Send (
Properties
Common
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|---|---|---|---|---|---|
| Resource | resource | options | No | message | Message (message) | — |
| Operation | operation | options | No | send | Send (send), Read All (readAll) | resource = message |
Message → Send
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|---|---|---|---|---|---|
| To (Recipients) | toRecipients | string | Yes | '' | Comma-separated list of primary recipient email addresses | resource = message, operation = send |
| Email Subject | subject | string | No | '' | Free text | resource = message, operation = send |
| Message | bodyContent | string | No | '' | Free text (message body) | resource = message, operation = send |
| Advanced Email Options | additionalFields | object | No | {} | Collection (see below) | resource = message, operation = send |
additionalFields collection options:
| Property | Key | Type | Required | Default | Possible values |
|---|---|---|---|---|---|
| BCC (Hidden Recipients) | bccRecipients | string | No | '' | Comma-separated list of BCC email addresses |
| CC (Carbon Copy Recipients) | ccRecipients | string | No | '' | Comma-separated list of CC email addresses |
| Body Content Format | bodyContentType | options | No | text | HTML (html), Text (text) |
| Reply-To Address | replyTo | string | No | '' | Email address recipients should reply to |
Message → Read All
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|---|---|---|---|---|---|
| Output | output | options | No | simple | Simplified (simple), Raw (raw), Select Included Fields (fields) | resource = message, operation = readAll |
| Limit | limit | number | Yes | 100 | Max number of results to return | resource = message, operation = readAll |
| Fields | fields | checkbox | Yes | [] | id, threadId, labelIds, snippet, historyId, internalDate, payload, sizeEstimate, raw, classificationLabelValues | resource = message, operation = readAll, output = fields |
| Filters | userFilters | object | No | {} | Collection (see below) | resource = message, operation = readAll |
userFilters collection options:
| Property | Key | Type | Required | Default | Possible values |
|---|---|---|---|---|---|
| Filter By | filterBy | options | No | filters | Filters (filters), Search (search) |
| Search | search | string | No | '' | Gmail search query (e.g. from:user@example.com subject:hello); shown when filterBy = search |
| Filters | filters | object | No | {} | Nested collection (see below); shown when filterBy = filters |
userFilters.filters nested collection options:
| Property | Key | Type | Required | Default | Possible values |
|---|---|---|---|---|---|
| Read Status | readStatus | options | No | unread | Unread and read messages (both), Unread messages only (unread), Read messages only (read) |
| Received After | receivedAfter | dateTime | No | '' | ISO date string or millisecond timestamp |
| Received Before | receivedBefore | dateTime | No | '' | ISO date string or millisecond timestamp |
| Sender | sender | string | No | '' | Sender name or email to filter by |
| Has Attachment | hasAttachment | boolean | No | false | true / false |
| Label | label | string | No | '' | Label name (e.g. INBOX, SENT, IMPORTANT) |
Notes
- Requires a Gmail credential; the credential ID is read from
credentials.idand resolved to an OAuth bearer token. A missing token raisesWorkflow error, credentials missing. - All requests go to
https://gmail.googleapis.com/gmail/v1/users/mewithAuthorization: Bearer <token>. Errors throwGmail API request failed (<status>): <message>. - Send builds an RFC 2822 message, base64url-encodes it, and calls
POST /messages/sendwith{ 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 totext. Output:{ success: true, messageId, threadId, labelIds }. - Read All first calls
GET /messageswithmaxResults = limitand an optionalqsearch query built from the filters, then fetches each message viaGET /messages/{id}. Format peroutput:rawrequestsformat=raw;simple/fieldsrequestformat=full.simplereturns a simplified shape,fieldsfilters to the selected keys client-side (Gmail does not support server-side field selection),rawreturns the full message. Output:{ success: true, data: [...] }(emptydataarray when no messages match).