The Gmail connector synchronizes email threads (conversations) from Gmail into your knowledge base.
Authentication
OAuth — requires scope: https://www.googleapis.com/auth/gmail.readonly
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| Label | Selector / Input | Yes | Gmail label to sync from |
| Date Range | Dropdown | No | Time window for emails |
| Exclude Promotions | Toggle | No | Skip promotional emails |
| Exclude Social | Toggle | No | Skip social notifications |
| Search Query | Input | No | Additional Gmail search query |
| Max Threads | Input | No | Limit the number of synced threads |
How It Works
- Search Query Building — Constructs a Gmail search query from label, date range, and exclusions
- Thread Listing — Fetches thread list via Gmail API with page tokens
- Thread Fetching — Gets full thread details including all messages
- Formatting — Each message rendered as
[date] From: sender / To: recipient / Body: ...
Document Format
Thread subject line
[ISO date] From: sender name (email)
To: recipient
Body: message text
[ISO date] From: reply sender
To: recipient
Body: reply textMetadata Tags
| Tag | Type | Description |
|---|---|---|
| Labels | Text | Comma-separated Gmail labels |
| Message Count | Number | Messages in the thread |
| Last Message Date | Date | Date of the most recent message |
| First Message Date | Date | Date of the first message |
Category Exclusions
The connector can automatically exclude:
- Promotions — Marketing emails (
CATEGORY_PROMOTIONS) - Social — Social network notifications (
CATEGORY_SOCIAL)

