Overview
The Google Workspace integration allows you to connect your Gmail account and Google Calendar to Twenty. Once connected, you can:- Sync emails automatically with related contacts and companies
- View email threads directly in contact and company records
- Send emails from within Twenty
- Sync calendar events and meetings
- Schedule meetings with contacts
Prerequisites
Before you begin, make sure you have:- A Google Workspace account or personal Gmail account
- Admin access to your Twenty workspace (for initial setup)
- For self-hosted instances: Google OAuth credentials
Setting Up Google OAuth
For Cloud Users
If you’re using Twenty Cloud, the OAuth integration is already configured. Simply connect your account:Grant Permissions
Review and accept the requested permissions:
- Read and send emails
- Access calendar events
- View contact information
For Self-Hosted Instances
If you’re self-hosting Twenty, you need to set up Google OAuth credentials:Create Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API and Google Calendar API
Configure OAuth Consent Screen
- Navigate to APIs & Services > OAuth consent screen
- Select External user type
- Fill in the application details
- Add the following scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/calendar
Create OAuth Credentials
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application
- Add authorized redirect URIs:
- Copy the Client ID and Client Secret
Email Sync
Once connected, Twenty automatically syncs your Gmail emails:How Email Sync Works
- Automatic matching - Twenty matches email addresses with contacts and companies in your CRM
- Thread grouping - Related emails are grouped into threads for easy navigation
- Real-time sync - New emails are synced within minutes of arrival
- Bidirectional sync - Emails sent from Twenty are saved to your Gmail
Viewing Emails in Twenty
To view emails for a contact or company:- Open the contact or company record
- Navigate to the Emails tab
- View all email threads associated with that record
Sending Emails
To send an email from Twenty:- Open a contact or company record
- Click Send Email in the activity panel
- Compose your message
- Click Send
Required Scopes for Sending Emails:
https://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.compose
Calendar Sync
The Google Calendar integration syncs your calendar events with Twenty:Features
- Two-way sync - Events created in Twenty appear in Google Calendar and vice versa
- Attendee linking - Calendar attendees are automatically linked to contacts
- Meeting scheduling - Schedule meetings directly from contact records
- Availability checking - View your calendar when scheduling meetings
Managing Calendar Events
- Navigate to the Calendar view in Twenty
- Create, edit, or delete events
- Changes sync automatically with Google Calendar
Permissions and Scopes
The Google integration requires the following OAuth scopes:| Scope | Purpose |
|---|---|
gmail.readonly | Read emails from your Gmail account |
gmail.send | Send emails on your behalf |
gmail.compose | Create draft emails |
calendar | Access and manage calendar events |
userinfo.email | Identify your Google account |
Troubleshooting
Emails Not Syncing
If emails aren’t appearing in Twenty:- Check that your Google account is still connected in Settings > Accounts
- Verify that the email addresses match contacts in your CRM
- Check the sync status in account settings
- Try disconnecting and reconnecting your account
Calendar Events Missing
If calendar events aren’t syncing:- Ensure calendar sync is enabled in your account settings
- Check that you’ve granted calendar permissions
- Verify the calendar is not marked as “private” in Google Calendar
Authentication Errors
If you see authentication errors:- The OAuth token may have expired - reconnect your account
- For self-hosted instances, verify your OAuth credentials are correct
- Check that redirect URIs match exactly in Google Cloud Console
Implementation Details
The Google Workspace integration is implemented in the Twenty server codebase:- OAuth flow:
packages/twenty-server/src/engine/core-modules/auth/controllers/google-auth.controller.ts:27 - Email sync:
packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/ - Calendar sync:
packages/twenty-server/src/modules/calendar/calendar-event-import-manager/drivers/google/
Need Help?
Join our Discord community for support and to share feedback.
