Gmail → Notion Sync

Automated email thread synchronization for Half Dozen

🧪
QA Testing Mode Temporary

IP allowlisting is currently disabled for testing purposes. This feature will be enabled in production to restrict dashboard access to authorized IP addresses only.

How It Works

1

Label an Email

In Gmail, apply the "Log to Notion" label to any email thread you want to track.

2

Automatic Sync

Every 5 minutes, the worker scans all connected Gmail accounts for labeled threads.

3

Notion Page Created

A new Interaction page appears in Notion with AI summary, participants, and full thread history.

4

Stay in Sync

New replies automatically append to the Notion page. Date, message count, and summary update live.

Architecture

Gmail OAuth 2.0 Labeled Threads Poll Cloudflare Worker Cron: Every 5 min KV: Thread Tracking AI: Llama 3 8B Create/Update Notion Interactions DB Thread pages Contacts DB Auto-created Multi-User Architecture Each connected Gmail account syncs independently • Tokens stored in KV • Zero npm dependencies

Contact Management

The system automatically categorizes email participants into two groups:

External

Contacts Database

Any email address not from halfdozen.co domain is automatically:

  • Searched in Contacts DB by email
  • Created if not found (Name + Email)
  • Linked to Interaction via Contacts relation
Example: [email protected] → Auto-created Contact
Internal

Owner Multi-Select

Emails from halfdozen.co domain or internal list are:

  • Added to Owner multi-select field
  • Not created as Contact pages
  • Recognized as team members
Internal list: [email protected], [email protected], [email protected]
De-duplication: Contacts are searched by email before creation to prevent duplicates. Each external participant appears once in the Contacts database.

Connected Accounts

Connect New Account View Guide