> ## 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.

# New Email

> Start a workflow when a new message arrives in a Gmail inbox.

The **New Email** trigger starts a workflow when the connected Gmail account
receives a new inbox message. It can limit runs to subjects containing specific
text and provides parsed message bodies, attachments, and headers.

## Configuration

| Field              | Type           | Required | Description                                                   |
| ------------------ | -------------- | -------- | ------------------------------------------------------------- |
| **Google Account** | Google account | Yes      | Gmail inbox to watch.                                         |
| **Subject Filter** | String         | No       | Required text within the subject. Matching is case-sensitive. |

Leave **Subject Filter** empty to accept every qualifying new inbox message.
The trigger only dispatches messages addressed to the watched mailbox.

## Trigger data

| Output             | Type              | Description                                          |
| ------------------ | ----------------- | ---------------------------------------------------- |
| **Message ID**     | String            | Gmail ID of the message.                             |
| **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.                     |
| **Is Reply?**      | Boolean           | Whether the message has an `In-Reply-To` header.     |
| **Attachments**    | List of files     | Files downloaded from the message.                   |
| **Headers**        | Object of strings | Lowercase email-header names mapped to their values. |

<Note>
  Message formats vary. **Plain Text**, **HTML**, sender name, or attachments
  can be empty when the source message does not contain them.
</Note>

## Example: triage a support inbox

Set **Subject Filter** to `[Support]`, then pass **Plain Text** through **Remove
Reply Text** before classifying the message. Use the cleaned text and
classification as inputs to **Draft Reply**. Removing quoted conversation
history first helps the classifier and draft focus on the customer's newest
message.

## Troubleshooting

<AccordionGroup>
  <Accordion title="A matching email did not trigger">
    The filter is case-sensitive. Confirm the message arrived in the watched
    account's Inbox after the trigger was configured and that the subject
    contains the exact filter text.
  </Accordion>

  <Accordion title="A message sent by the workflow did not trigger">
    WorkflowDog-authored mail sent back to the same watched account is excluded
    from this incoming trigger to avoid self-triggering loops.
  </Accordion>
</AccordionGroup>
