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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Gmail

> Read, organize, draft, and send Gmail messages from TypeScript automations.

Import Gmail actions and triggers from `automate.ax/gmail`. Actions accept plain
values or compatible signals, so you can pass data from one step directly into
the next. Gmail triggers return signals containing the event data.

```ts theme={null}
import { automation } from "automate.ax"
import { archive, onNewEmail } from "automate.ax/gmail"

export default automation("Archive incoming mail", () => {
  const email = onNewEmail()

  archive({ messageId: email.messageId })
})
```

## Accounts

Gmail operations use a connected Google account. Leave `account` unset to use
the project's default Google account binding, or pass an account binding when
the automation can use more than one Google account. See [Integration
accounts](/concepts/integration-accounts) for authorization and binding
behavior.

## Explore Gmail

<CardGroup cols={2}>
  <Card title="Send and reply" href="/reference/integrations/gmail/actions/send-email">
    Send new messages, replies, forwards, and drafts.
  </Card>

  <Card title="Read and search" href="/reference/integrations/gmail/actions/search-messages">
    Find messages and load their content, threads, or raw source.
  </Card>

  <Card title="Organize messages" href="/reference/integrations/gmail/actions/modify-labels">
    Apply labels and update read, starred, important, spam, and mailbox state.
  </Card>

  <Card title="New email trigger" href="/reference/integrations/gmail/triggers/on-new-email">
    Start an automation when Gmail adds a message to the inbox.
  </Card>
</CardGroup>
