
Google Workspace List
CertifiedList Gmail messages
Google Workspace List
List Gmail messages
Lists message IDs with optional Gmail search, label filters, and spam/trash inclusion. Fetch type controls output: FETCH (default) returns all, FETCH_ONE first only, STORE writes to kestra:// file, NONE outputs nothing.
type: io.kestra.plugin.googleworkspace.mail.ListExamples
List all messages in inbox
id: list_messages
namespace: company.team
tasks:
- id: list_messages
type: io.kestra.plugin.googleworkspace.mail.List
clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
maxResults: 10
List unread messages
id: list_unread_messages
namespace: company.team
tasks:
- id: list_unread
type: io.kestra.plugin.googleworkspace.mail.List
clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
query: is:unread
labelIds:
- INBOX
maxResults: 50
fetchType: STORE
Get first message only
id: get_first_message
namespace: company.team
tasks:
- id: get_first
type: io.kestra.plugin.googleworkspace.mail.List
clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
fetchType: FETCH_ONE
maxResults: 1
Properties
clientId *Requiredstring
OAuth client ID
Google OAuth 2.0 client ID for the Gmail project
clientSecret *Requiredstring
OAuth client secret
Google OAuth 2.0 client secret
refreshToken *Requiredstring
OAuth refresh token
Refresh token obtained via OAuth consent; used to mint access tokens
accessToken string
OAuth access token
Optional access token; if absent, one is fetched from the refresh token
fetchType string
FETCHSTOREFETCHFETCH_ONENONEFetch strategy
FETCH (all), FETCH_ONE (first only), STORE (write all to file), NONE (no output). Default FETCH.
includeSpamTrash booleanstring
falseInclude spam and trash
Whether to include SPAM and TRASH messages
labelIds array
Label filters
Label IDs to restrict search (INBOX, SENT, UNREAD, etc.)
maxResults integerstring
100Maximum results
Max messages to return (default 100, capped at 500)
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
query string
Gmail search query
Gmail search syntax (e.g., is: unread, from: sender@example.com, subject: important)
readTimeout integerstring
120The read timeout for the request (in seconds)
scopes array
["https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.readonly","https://www.googleapis.com/auth/gmail.send"]The OAuth scopes to use
List of OAuth 2.0 scopes required for the operation
Outputs
message
Single message (when fetchType is FETCH_ONE)
Gmail message representation
List of attachments in the message
Gmail message attachment
The attachment ID
The attachment data as a base64url encoded string
The filename of the attachment
The MIME type of the attachment file
The size of the attachment in bytes
The BCC recipient email addresses
The CC recipient email addresses
The sender email address
The parsed headers of the message
The ID of the last history record that modified this message
The immutable ID of the message
date-timeThe internal message creation timestamp
List of IDs of labels applied to this message
The entire email message in an RFC 2822 formatted and base64url encoded string
Estimated size in bytes of the message
A short part of the message text
The message subject
The HTML body of the message
The plain text body of the message
The ID of the thread the message belongs to
The recipient email addresses
messages array
List of messages (when fetchType is FETCH)
Gmail message representation
List of attachments in the message
Gmail message attachment
The attachment ID
The attachment data as a base64url encoded string
The filename of the attachment
The MIME type of the attachment file
The size of the attachment in bytes
The BCC recipient email addresses
The CC recipient email addresses
The sender email address
The parsed headers of the message
The ID of the last history record that modified this message
The immutable ID of the message
date-timeThe internal message creation timestamp
List of IDs of labels applied to this message
The entire email message in an RFC 2822 formatted and base64url encoded string
Estimated size in bytes of the message
A short part of the message text
The message subject
The HTML body of the message
The plain text body of the message
The ID of the thread the message belongs to
The recipient email addresses
nextPageToken string
Token for retrieving next page of results
resultSizeEstimate integer
Total estimated number of results
uri string
uriURI of the stored messages file (when fetchType is STORE)