AACFlow

Gmail Connector

Sync email threads from Gmail into your knowledge base

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

FieldTypeRequiredDescription
LabelSelector / InputYesGmail label to sync from
Date RangeDropdownNoTime window for emails
Exclude PromotionsToggleNoSkip promotional emails
Exclude SocialToggleNoSkip social notifications
Search QueryInputNoAdditional Gmail search query
Max ThreadsInputNoLimit the number of synced threads

How It Works

  1. Search Query Building — Constructs a Gmail search query from label, date range, and exclusions
  2. Thread Listing — Fetches thread list via Gmail API with page tokens
  3. Thread Fetching — Gets full thread details including all messages
  4. 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 text

Metadata Tags

TagTypeDescription
LabelsTextComma-separated Gmail labels
Message CountNumberMessages in the thread
Last Message DateDateDate of the most recent message
First Message DateDateDate of the first message

Category Exclusions

The connector can automatically exclude:

  • Promotions — Marketing emails (CATEGORY_PROMOTIONS)
  • Social — Social network notifications (CATEGORY_SOCIAL)

On this page

Start building today
Trusted by over 100,000 builders.
The SaaS platform to build AI agents and run your agentic workforce.
Get started