Gmail actions

Make Raw Request

Executes a custom request. Refer to the official Gmail REST API documentation.

Configuration

Don’t throw error on 404 Response

An optional boolean. Treat 404 HTTP responses not as an error; defaults to false.

Input Metadata

URL

A required string. Path of the resource relative to the base URL (https://gmail.googleapis.com/gmail/v1/). For example, /users/me/messages.

Method

A required string. HTTP verb to use in the request, one of GET, POST, PUT, PATCH, DELETE.

Request Body

An optional object. Body of the request to send.

Output Metadata

Status Code

A required number. HTTP status code of the response.

HTTP headers

A required object. HTTP headers of the response.

Response Body

An optional object. HTTP response body.

Delete Email By ID

Delete the specified message by providing its ID. Depending on the configuration, a message will either be permanently deleted or moved to the trash.

Soft delete (move email to trash) requires one of the following OAuth scopes:

Configuration Fields

Immediately and permanently delete the specified message

An optional checkbox. If selected, the message will be permanently deleted; by default, the message will be moved to trash.

Emit strategy when no email found

An optional dropdown. Specifies the output when no email is found by the provided ID. Options include:

Emit nothing

Emit nothing; just skips an execution.

In a real flow execution, there will be no error, just an execution skip.
Emit an empty object {}

Emit an empty object. For example, {}.

Throw an error

Throw an error with the text No email found by provided ID. This is the default option if nothing else is selected.

Input Metadata

ID

A required string. The ID of the email to delete. For example:

{
  "id": "18a4a8ab45841745"
}

Output Metadata

ID

An optional string. The ID of the deleted email.

Get Email by ID

Search for mail by a provided ID.

Configuration Fields

Omit attachments

An optional checkbox. If selected, attachments will not be presented in the output metadata.

Allow criteria to be omitted

An optional checkbox. In case the checkbox is unselected, an error will be thrown when the object ID is missing in metadata. If selected, an empty object will be returned instead of throwing an error.

Allow Zero Results

An optional checkbox. In case the checkbox is unselected, an error will be thrown when no objects are found. If selected, an empty object will be returned instead of throwing an error.

Input Metadata

ID

A required/optional string. The ID of the mail to look up. This is required if Allow criteria to be omitted is unchecked.

Output Metadata

id

A required string. Mail ID from Gmail.

subject

A required string. Subject of the mail.

from

A required object. Sender information, contains two fields:

name

A optional string. Sender name.

address

A required string. Sender email.

to

A required array of objects. recipients information, each record is represented by an object with two fields:

name

A optional string. recipient name.

address

A required string. recipient email.

cc

An optional array of objects. recipients in copy information, each record is represented by an object with two fields:

name

A optional string. recipient name.

address

A required string. recipient email.

date

A required string. When the message was received.

text

A optional string. Plaintext version of the message if it has at least one text/plain node.

html

A optional string. HTML version of the message if it has at least one text/html node or plaintext version of the message in HTML format.

attachments

An optional array of objects. Provided if the message has attachments and (Omit attachments) is unchecked. Each record contains the following fields:

name

A optional string. Name of the file if present.

contentType

A required string. File content type.

contentType

A required string. File content type.

size

A required string. File size.

url

A required string. URL to internal platform storage for this file.

Known limitations

The component operates smoothly with attachments up to 15MB by default. However, if you intend to work with larger files, it is advisable to create or increase the environment variable EIO_REQUIRED_RAM_MB, which serves as the memory usage limit for the component, initially set at 256MB.

Search emails

Retrieve emails based on specified criteria. There will be one API request to retrieve a page and one additional API request for each email. This trigger collects emails from all folders, including Sent.

Configuration Fields

Emit Behavior

An optional dropdown. The default is Emit individually. Defines the way result objects will be emitted:

  • Emit page

  • Emit individually

  • Emit all.

Expert Mode for Filter Expression

A checkbox. If checked, any filter expression can be entered in the metadata field Filter Expression for advanced users.

Number of search terms

An optional string. Text field to specify a number of search terms (positive integer number [1-99] or 0). Requires the Expert Mode for Filter Expression checkbox to be cleared.

Omit attachments

An optional checkbox. If selected, attachments will not be presented in the output metadata.

Input Metadata

If the configuration field Expert Mode for Filter Expression is selected
Filter Expression

A required string for advanced users. Enter any filter expression in the metadata field. For example:

subject:(dinner movie) AND is:unread AND in:anywhere
If the configuration field Expert Mode for Filter Expression is cleared

This depends on the configuration field Number of search terms. If the value is N, the component will generate N search terms and N-1 logical operators. If the value is 0, the component will collect all messages without filtering.

Example for Number of search terms set to 2:

{
  "sTerm_1": {
    "fieldName": "is",
    "fieldValue": "unread"
  },
  "link_1_2": "AND",
  "sTerm_2": {
    "fieldName": "in",
    "fieldValue": "anywhere"
  }
}

If the selected Emit Behavior is Emit page, an additional field will be added:

Page Size

A maximum of 500, defaults to 100. Indicates the number of emails per page.

Output Metadata

The output metadata structure depends on the selected Emit behavior field:

If Emit behavior field is Emit page or Emit all

An object with property results that contains an array of emails with the same structure as in Get Email by ID.

If Emit behavior field is Emit individually

Email information will fulfill the whole message with the same structure as in Get Email by ID.

Send Email

Send an email.

Be aware of Google usage limits to avoid exceeding them.

Input Metadata

Subject

A required string. Subject of the email.

To

A required array of objects. The recipients' information, each record is represented by an object with two fields:

Name

An optional string. recipient name.

Address

A required string. recipient email.

Cc

An optional array of objects. The recipients in copy information, each record is represented by an object with two fields:

Name

A optional string. recipient name.

Address

A optional string. recipient email.

Bcc

An optional array of objects. Recipients in hidden copy information, each record is represented by an object with two fields:

Name

An optional string. Recipient name.

Address

An optional string. Recipient email.

Text

An optional string. One of Text or HTML is required string. Plaintext version of the message.

HTML

An optional string. One of Text or HTML is required string. HTML version of the message.

Attachments

An optional array of objects. An array of attachments. Currently, only an external link to a file on the Internet is supported. Each record contains the following fields:

File Name

A required string. Name of the file if present.

Attachment URL

A required string. URL to the file location (either an external URL or Maester URL).

Incoming Message Sample:

{
  "to": "mail@gmail.com,mail2@gmail.com,mail3@gmail.com",
  "cc": "mail@gmail.com",
  "replyTo": "mail@gmail.com",
  "subject": "Hello Test 🚀",
  "text": "This email is sent from the integration tests",
  "html": "<p>🙋🏻‍♀️ &mdash; This is a <b>test email</b> from <a href='https://example.com'>Test HTML</a>.</p>",
  "attachments": [
    {
      "filename": "sample.pdf",
      "url": "https://filesamples.com/samples/document/pdf/sample2.pdf"
    },
    {
      "filename": "order.json",
      "url": "http://maester-service.platform.svc.cluster.local:3002/objects/1da027b7-8dfb-44f9-8ec8-486792ca023e?storage_type=maester"
    }
  ]
}

Output Metadata

id

A required string. The immutable ID of the message.

threadId

A required string. The ID of the thread the message belongs to.

labelIds

A required array of strings. List of IDs of labels applied to this message.

Get New Emails

This operation allows you to retrieve emails within a specified time range. The process involves one API request to fetch a page and an additional API request for each individual email. The retrieval encompasses all folders, including the Sent folder.

Configuration Fields

Emit Behavior

Anoptional Dropdown. The default is: Emit individually. This setting determines how result objects will be emitted, with options for either emitting a page collectively or emitting each email individually.

Page Size

An optional number. The default is: 100 The maximum is 500. Specifies the size of pages to be fetched per request.

Start Time

An optional String. The timestamp to commence polling from (inclusive) in ISO 8601 Date Time UTC format (YYYY-MM-DDThh:mm:ssZ). The default value is the beginning of time (January 1, 1970, at 00:00).

End Time

An optional String. The timestamp to conclude polling (exclusive) in ISO 8601 Date Time UTC format (YYYY-MM-DDThh:mm:ssZ). The default value is the execution time of the flow.

Omit Attachments

An optional checkbox. If selected, attachments will not be included in the output metadata.

Include SPAM and TRASH

An optional checkbox. If selected, messages from SPAM and TRASH will be included in the results.

Input Metadata

There is no input metadata in this action.

Output Metadata

The output metadata structure depends on the selected Emit behavior field:

If Emit behavior is set to Emit page

The output is an object with the property results, which contains an array of emails with the same structure as described in Get Email by ID.

If Emit behavior is set to Emit individually

The email information will fill the entire message with the same structure as described in Get Email by ID.