> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Message by ID

> Retrieve Gmail message content and optionally download its attachments.

The **Get Message by ID** action retrieves one Gmail message. It accepts either
Gmail's internal message ID or an RFC 822 `Message-ID`, making it useful with
Gmail triggers as well as IDs received from other mail systems.

## Quick start

<Steps>
  <Step title="Connect Gmail">
    Choose an account that can read the message.
  </Step>

  <Step title="Provide the identifier">
    Connect a Gmail **Message ID**, or supply an RFC 822 message ID such as a
    value from an email's `Message-ID` header.
  </Step>

  <Step title="Choose attachment behavior">
    Enable **Download Attachments** only when later actions need the files.
  </Step>

  <Step title="Use the content">
    Prefer **Plain Text** for text processing and **HTML** when preserving the
    message's formatting.
  </Step>
</Steps>

## Inputs

| Input                    | Type           | Required | Description                                                    |
| ------------------------ | -------------- | -------- | -------------------------------------------------------------- |
| **Third-party account**  | Google account | Yes      | Account used to read the message.                              |
| **Message ID**           | String         | Yes      | Gmail ID or RFC 822 message ID.                                |
| **Download Attachments** | Boolean        | No       | Whether to download attached files and expose **Attachments**. |

RFC 822 IDs are looked up across the mailbox, including Spam and Trash. Gmail
IDs are loaded directly.

## Outputs

| Output             | Type          | Description                                         |
| ------------------ | ------------- | --------------------------------------------------- |
| **Message ID**     | String        | Canonical Gmail message ID.                         |
| **Thread ID**      | String        | Gmail conversation ID.                              |
| **Sender Name**    | String        | Parsed sender display name, when present.           |
| **Sender Address** | String        | Parsed sender email address, when present.          |
| **Subject**        | String        | Message subject.                                    |
| **Plain Text**     | String        | Plain-text MIME content, when present.              |
| **HTML**           | String        | HTML MIME content, when present.                    |
| **Attachments**    | List of files | Downloaded files when attachment downloading is on. |

<Note>
  **Attachments** is conditional. Turning off **Download Attachments** removes
  that output from the node and avoids downloading file bodies.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Invalid Message ID">
    Use the Gmail ID returned by a Gmail action or trigger, or a complete RFC
    822 `Message-ID`. The connected account must contain the message.
  </Accordion>

  <Accordion title="Plain Text or HTML is empty">
    A message can contain only one of those MIME formats. Use the format the
    sender supplied, or add fallback logic when processing varied mail.
  </Accordion>
</AccordionGroup>
