
Google Workspace Get
CertifiedFetch a Gmail message by ID
Google Workspace Get
Fetch a Gmail message by ID
Retrieves one message with chosen format (minimal, full, raw, metadata). Defaults to full; requires OAuth Gmail scopes.
type: io.kestra.plugin.googleworkspace.mail.GetExamples
Get a message by ID
id: get_gmail_message
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: 1
- id: get_message
type: io.kestra.plugin.googleworkspace.mail.Get
clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
messageId: "{{ outputs.list_messages.messages[0].id }}"
Get message with specific format
id: get_message_metadata
namespace: company.team
tasks:
- id: get_full_message
type: io.kestra.plugin.googleworkspace.mail.Get
clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
messageId: "1a2b3c4d5e6f7890"
format: full
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
messageId *Requiredstring
Message ID
Gmail message ID to fetch
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
format string
fullMessage format
minimal, full, raw, or metadata; defaults to full
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
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
Retrieved message
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