Prerequisites
- A Google Cloud project with the Gmail API enabled
- A Pub/Sub topic configured for Gmail push notifications
- OAuth 2.0 credentials (client ID and secret)
Setup
/api/email/oauth/callback)gmail-api-push@system.gserviceaccount.com) publish access to the topicGOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_PUBSUB_TOPIC=projects/your-project/topics/gmail-notifications
How it works
- Gmail sends push notifications to the Pub/Sub topic when new emails arrive
- The cloud receives the webhook and queues an event
- The service picks up the event via SSE stream
- The service fetches the email content via the Gmail API
- The email is processed through the standard LLM agent pipeline
Gmail integration requires the cloud component even in hybrid mode, since OAuth tokens and webhooks are managed through the cloud API.