# Gmail
URL: /reference/blocks/trigger-gmail
Type: reference
Description: Trigger workflow when new emails are received in Gmail
Keywords: gmail, trigger/gmail, triggers, google, block, workflow builder
`trigger/gmail` — Trigger workflow when new emails are received in Gmail.

Where it appears [#where-it-appears]

The **Gmail** block is a trigger — it starts a workflow. Add it from the **Triggers** group in the Workflow Builder.

Fields [#fields]

| Field             | Type   | Required | Default | Description                                                                                                     |
| ----------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| `pollingInterval` | select | Yes      | `5min`  | How often Stylo checks the Gmail inbox for new messages. Options: `1min`, `5min`, `15min`, `30min`, `1hour`.    |
| `searchQuery`     | text   | No       | —       | Gmail search syntax to filter which incoming emails trigger the workflow. Leave empty to fire on any new email. |
| `markAsRead`      | toggle | No       | `false` | When enabled, matched emails are marked as read in Gmail after triggering the workflow.                         |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<Gmail.field>`.

| Name        | Type    | Description                                                           |
| ----------- | ------- | --------------------------------------------------------------------- |
| `triggered` | boolean | Whether trigger fired                                                 |
| `timestamp` | string  | Trigger timestamp                                                     |
| `email`     | json    | Email data (object — fields: `subject`, `from`, `to`, `body`, `date`) |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "trigger/gmail",
  "config": {
    "pollingInterval": "5min",
    "markAsRead": false
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Requires a connected Google integration. Calls fail if that integration is disconnected or its authorization has expired.
* Required field (`pollingInterval`) must be set, or the block fails validation before it runs.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)
* [Integrations](/integrations)