Jump to a Section

Overview

The first time that you add a Gmail card to a flow, you are prompted to create a connection. Connecting your account will enable you to save your account information and reuse that connection the next time you build a flow with the connector. Note that you can create multiple connections and manage them from your Settings page.

  1. Enter a Connection Nickname for your Gmail account. The nickname can be the actual name of the account, a Gmail calendar title, or a generic nickname.
  2. In the OAuth window, enter your Gmail account and password information.
  3. On the event card, authorize access to your Gmail account by clicking Allow.
  • Gmail Errors

    General

    For information on specific errors returned from the Gmail API, see the Gmail API reference.

    For possible service outages, check the status of the Gmail API.

    Authentication

    For issues connecting to your Gmail account, go to Settings > Accounts. Locate the account and then click Reauthorize. Or, delete the account and then add it again.

    We are constantly aggregating more data about errors, so if this article doesn’t help solve your problem, check back soon.

Events

  • Label Added or Removed

    Trigger a flow when a label is applied to or removed from a message in your inbox. For more information, refer to Gmail’s documentation.

    Unless otherwise indicated, field types are text. Note that senders and recipients are formatted as - Name <email@email.com>.

    Output

    • Labels
      • Label Added: title of the new label
      • Label Removed: title of the removed label
    • Email
      • Message ID: unique ID of the message
      • Thread ID: unique ID of the message thread (new, non-threaded messages have the same message and thread IDs)
      • Subject: subject line of the email
      • To: recipient of the email
      • Text Body: text in the body of the message
      • HTML Body: HTML formatted body of the message
      • From: sender of the email
      • CC (list of text): list of carbon copied recipients
      • BCC (list of text): list of blind carbon copied recipients
      • Attachment IDs (list of text): list of unique IDs of the email attachments
      • Labels (list of text): list of categories attributed to the message (for example, Unread, Important, or Category_Personal)
    • Context
      • Execution ID: unique ID of the flow instance
  • New Email

    Trigger a flow when you recieve a new email. For more information, refer to Gmail’s documentation.

    Unless otherwise indicated, field types are text. Note that senders and recipients are formatted as - Name <email@email.com>.

    Output

    • Email
      • Message ID: unique ID of the message
      • Thread ID: unique ID of the message thread (new, non-threaded messages have the same message and thread IDs)
      • To: recipient of the email
      • From: sender of the email
      • Text Body: text in the body of the message
      • HTML Body: HTML formatted body of the message
      • CC (list of text): list of carbon copied recipients
      • BCC (list of text): list of blind carbon copied recipients
      • Labels (list of text): list of categories attributed to the message (for example, Unread, Important, or Category_Personal)
      • Attachment IDs (list of text): list of unique IDs of the email attachments
        • filename: name of the attachment
        • attachmentID: unique ID of the attachment
        • messageID: Message ID of the email (see above)
        • type: file type (for example, .png or .jpeg)

Actions

  • Download Attachment

    Download an attachment from an email. For additional information, refer to Gmail’s documentation.

    Unless otherwise indicated, field types are text.

    Input

    • Download
      • File Name: name of the attachment
      • Attachment ID: unique ID of the attachment
      • Message ID (string): unique ID of the message containing the attachment

    Note: To find message and attachment IDs, open the message and click More (to the right of Reply). In the drop-down menu, select Show original.

    Output

    • Attachment
      • File Content (file): content of the downloaded attachment
      • File Name: name of the downloaded attachment
      • Size: size of the attachment
      • File type: type of attachment (for example, .png, .jpg, or .pdf)
  • Read Email

    Read a message received in Gmail. Pair this action card with an earlier event or action, such as New Email.

    Unless otherwise indicated, field types are text. Note that senders and recipients are formatted as - Name <email@email.com>.

    Input

    • Read
      • Message ID: unique ID of the message

    Output

    • Email
      • Thread ID: unique ID of the message thread (new, non-threaded messages have the same message and thread IDs)
      • Subject: subject heading of the message
      • Text Body: text in the body of the message
      • HTML Body: HTML formatted body of the message
      • From: sender of the email
      • CC (list of text): list of carbon copied recipients
      • Attachment IDs (list of text): list of unique IDs of the email attachments
        • filename: name of the attachment
        • attachmentID: unique ID of the attachment
        • messageID: Message ID of the email (see above)
        • type: file type (for example, .png or .jpeg)
      • Labels (list of text): list of categories attributed to the message (for example, Unread, Important, or Category_Personal)
  • Search Emails

    Search for an email or multiple emails. For more information, refer to Gmail’s Documentation.

    Unless otherwise indicated, field types are text.

    Options

    • Result Set (drop-down)
      • First matching email: return the first email message that meets the search criteria
      • All matching emails: return all email messages that match the search criteria

    Input

    • Search
      • Query: return only the messages that match the specified query (supports the same query format as the Gmail search box, such as “from:someuser@example.com rfc822msgid:somemsgid@example.com is:unread”. More Info
      • With Label IDs: labels to include in message filtering (such as Important, Starred, or Spam)
      • Max Result Size (number): specify the maximum number of emails to retrieve when All Matching Emails is selected
      • Page Token (string): retrieve a specific page of results in the list

    Output

    • Result for First Matching Email

      • Message ID: unique ID of the message
      • Subject: subject of the message
      • Text Body: text in the body of the message
    • Result for All Matching Emails

      • Emails (list): list of email objects returned from the search
  • Send Email

    Send email from a Gmail account. You can choose HTML, which enables you to format the email message, or plain text.

    If the recipient is always the same, type the email address directly into the To input field. If the recipient changes each time the flow runs, map an input from a previous action or function card.

    Unless otherwise indicated, field types are text.

    Options

    • Body is HTML? (drop-down): indicate whether the body of the email is HTML or plain text

    Input

    • Email
      • To (list of text): email addresses of the message recipients (format multiple addresses in a list of individual emails or as a single text string separated by commas or semicolons)
      • CC (list of text): list of carbon copied recipients
      • Subject: subject of the message
      • Body: content of the message (plain text or HTML depending on the the Options setting)

    Output

    • Email
      • MessageID: unique ID of the email generated by Gmail
  • Send Email with Attachment

    Send email with an attachment from a Gmail account. You can add an attachment by mapping a File Type output from an action that generates or returns a file.

    Unless otherwise indicated, field types are text.

    Options

    • Body is HTML? (drop-down): indicate whether the body of the email is HTML or plain text (if you are using the Compose function to create the body of your email, select No)

    Input

    • Email
      • To (list of text): email addresses of the message recipients (format multiple addresses in a list of individual emails or as a single text string separated by commas or semicolons)
      • Subject: subject of the message
      • Body: content of the message (plain text or HTML depending on the the Options setting)
    • File
      • File Name: name of the file to attach
      • File Content: file to attach

    Output

    • Email
      • MessageID: unique ID of the email generated by Gmail