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

# Gmail Trigger

> Trigger automations when Gmail events occur (e.g., new emails, labels).

## Overview

Use the Gmail Trigger to kick off your deployed crews when Gmail events happen in connected accounts, such as receiving a new email or messages matching a label/filter.

> [!TIP]
>
> Make sure Gmail is connected in Tools & Integrations and the trigger is
> enabled for your deployment.

## Enabling the Gmail Trigger

1. Open your deployment in CrewAI AMP
2. Go to the **Triggers** tab
3. Locate **Gmail** and switch the toggle to enable

![Enable or disable triggers with toggle](https://mintcdn.com/crew-ai-platform-docs/yxGoL_P6iQdNCtRQ/images/platform/trigger-selected.png?fit=max\&auto=format\&n=yxGoL_P6iQdNCtRQ\&q=85\&s=800bbc196acb12fa43b6daba669f9ef5)

## Example: Process new emails

When a new email arrives, the Gmail Trigger will send the payload to your Crew or Flow. Below is a Crew example that parses and processes the trigger payload.

```python theme={null}
@CrewBase
class GmailProcessingCrew:
    @agent
    def parser(self) -> Agent:
        return Agent(
            config=self.agents_config['parser'],
        )

    @task
    def parse_gmail_payload(self) -> Task:
        return Task(
            config=self.tasks_config['parse_gmail_payload'],
            agent=self.parser(),
        )

    @task
    def act_on_email(self) -> Task:
        return Task(
            config=self.tasks_config['act_on_email'],
            agent=self.parser(),
        )
```

The Gmail payload will be available via the standard context mechanisms.

### 로컬에서 테스트

CrewAI CLI를 사용하여 Gmail 트리거 통합을 로컬에서 테스트하세요:

```bash theme={null}
# 사용 가능한 모든 트리거 보기
crewai triggers list

# 실제 payload로 Gmail 트리거 시뮬레이션
crewai triggers run gmail/new_email_received
```

`crewai triggers run` 명령은 완전한 Gmail payload로 크루를 실행하여 배포 전에 파싱 로직을 테스트할 수 있게 해줍니다.

> [!WARNING]
>
> 개발 중에는 `crewai triggers run gmail/new_email_received`을 사용하세요
> (`crewai run`이 아님). 배포 후에는 크루가 자동으로 트리거 payload를 받습니다.

## Monitoring Executions

Track history and performance of triggered runs:

![List of executions triggered by automation](https://mintcdn.com/crew-ai-platform-docs/PsPgimrfKBcwyL9_/images/platform/list-executions.png?fit=max\&auto=format\&n=PsPgimrfKBcwyL9_\&q=85\&s=e50eb9069617ac9207f2ce7325d037df)

## Troubleshooting

* Ensure Gmail is connected in Tools & Integrations
* Verify the Gmail Trigger is enabled on the Triggers tab
* `crewai triggers run gmail/new_email_received`로 로컬 테스트하여 정확한 payload 구조를 확인하세요
* Check the execution logs and confirm the payload is passed as `crewai_trigger_payload`
* 주의: 트리거 실행을 시뮬레이션하려면 `crewai triggers run`을 사용하세요 (`crewai run`이 아님)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.