text
stringlengths
0
59.1k
After configuring credentials, you need to specify which emails to monitor.
<video controls loop muted playsInline style={{width: '100%', height: 'auto'}}>
<source src="https://cdn.voltagent.dev/console/trigger/gmail/gmail-configuration.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
Select the credential you created and configure the monitoring settings:
- **Label Filter (Optional)**: Provide a Gmail label name or ID to narrow which emails should trigger the workflow. Leave empty to monitor the entire inbox.
The trigger polls Gmail every 60 seconds to check for new messages. When new emails matching your criteria are found, VoltOps executes your configured target.
## Add Target to Activate Binding
After configuring your Gmail trigger, you need to add a target (agent or workflow) to activate the binding. For detailed instructions on:
- Adding targets to activate bindings
- Mapping trigger data to agent inputs
- Testing triggers with sample payloads
- Deploying and monitoring triggers
See the [Add Target to Activate Binding section](https://voltagent.dev/automations-docs/triggers/overviewusage/#step-3-add-target-to-activate-binding). These steps are the same for all trigger providers.
## Event Types
Gmail triggers support the following event type:
### New Email
Detect new emails in the configured Gmail account and optional label or search filter.
- **Delivery Method**: Polling
- **Event ID**: `gmail-new-email`
## Configuration Parameters
After setting up authentication in **Step 1 (Connection)**, configure the trigger options in **Step 2 (Configuration)**.
### Label Filter (Optional)
Provide a Gmail label name or ID to narrow which emails should trigger the workflow. Leave empty to monitor the entire inbox.
**Example:** `label:Support`
To find label IDs, see [Gmail API Labels documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list).
## Payload Structure
VoltOps wraps Gmail message data in a standardized format. The payload structure includes metadata about the trigger and the complete Gmail message information.
### Wrapper Format
All Gmail events delivered by VoltOps follow this structure:
```json
{
"provider": "gmail",
"message": {
"id": "18d3e7f8c9b2a1e6",
"threadId": "18d3e7f8c9b2a1e6",
"labelIds": ["INBOX", "UNREAD"],
"snippet": "This is a preview of the email content...",
"payload": {
"headers": [
{
"name": "From",
"value": "sender@example.com"
},
{
"name": "To",
"value": "recipient@example.com"
},
{
"name": "Subject",
"value": "Email Subject Line"
},
{
"name": "Date",
"value": "Wed, 13 Nov 2024 10:30:00 -0800"
}
],
"parts": [
{
"mimeType": "text/plain",
"body": {
"data": "Base64-encoded email body content"
}
}
]
},
"sizeEstimate": 3452,
"historyId": "123456",
"internalDate": "1699896600000"
},
"pollAtAt": "2024-11-13T18:30:00.000Z"