Overview
CrewAI supports integration with Google Workspace applications including Calendar, Gmail, Drive, Sheets, Slides, Docs, and Contacts. This guide walks you through setting up OAuth credentials in Google Cloud Console to enable these integrations.Prerequisites
- A Google Cloud account with billing enabled
- Access to create projects in Google Cloud Console
- Admin access to configure OAuth consent screen
Google Cloud Console Setup
Step 1: Create or Select a Project
- Navigate to Google Cloud Console
- Click the project dropdown in the top navigation bar
- Either select an existing project or click New Project
- If creating a new project:
- Enter a project name (e.g., “CrewAI Integrations”)
- Select your organization (if applicable)
- Click Create
Step 2: Configure OAuth Consent Screen
- In the Google Cloud Console, navigate to APIs & Services > OAuth consent screen
- Select the User Type:
- Click Create
- Fill in the required fields:
- App name: Enter your application name (e.g., “CrewAI”)
- User support email: Select your email address
- App logo: (Optional) Upload your company logo
- App domain: Add your application domain
- Developer contact information: Enter your email address
- Click Save and Continue
Step 3: Configure Scopes
- On the Scopes page, click Add or Remove Scopes
- Add the scopes required for your integrations (see Required Scopes below)
- Click Update then Save and Continue
Step 4: Add Test Users (Internal Apps)
If you selected Internal user type, all users in your organization can access the app. If you selected External and the app is in testing mode:- Click Add Users
- Enter the email addresses of users who need to test the integration
- Click Add then Save and Continue
Enable Required APIs
Enable the APIs for the Google services you want to integrate:- Navigate to APIs & Services > Library
- Search for and enable each required API:
For Google Slides integration, you also need to enable the Google Sheets API and Google Drive API as Slides uses these for certain operations.
Create OAuth 2.0 Credentials
Step 1: Create OAuth Client ID
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application as the application type
- Enter a name for the client (e.g., “CrewAI OAuth Client”)
Step 2: Configure Redirect URIs
Add the authorized redirect URI. Default configuration (NGINX with shared hostname):path: "/"):
Step 3: Save Credentials
- Click Create
- A dialog will display your Client ID and Client Secret
- Store these securely — you’ll need them for CrewAI configuration
Required Scopes per Integration
The following table lists all OAuth scopes required for each Google integration. These scopes should be added to your OAuth consent screen configuration.Google Calendar
Google Contacts
Gmail
Gmail Triggers
Gmail Triggers enable real-time email notifications. It requires a Google Cloud service account for Pub/Sub management.Required Google Cloud APIs
Service Account Requirements
You need to configure two service accounts: 1. Your Service Account (Customer-created) Create a service account in your Google Cloud project withroles/pubsub.admin:
This is the service account whose credentials you provide in
oauth.secrets.google.gmail.triggers.serviceAccountCredentials.
2. Gmail API Service Account (Google-managed)
Gmail uses its internal service account to publish notifications to your Pub/Sub topic. You must grant it publisher access:
gmail-api-push@system.gserviceaccount.com is managed by Google - you won’t see it in your project’s service accounts. You simply grant it access to your topic.Granting Gmail API Publisher Access
Option 1: Via gcloud CLI- Navigate to Pub/Sub → Topics → Select your topic
- Click the Permissions tab
- Click Grant Access
- In “New principals”, enter:
gmail-api-push@system.gserviceaccount.com - Select role: Pub/Sub Publisher
- Click Save
Domain Restricted Sharing Policy
If you encounter this error:“The ‘Domain Restricted Sharing’ organization policy (constraints/iam.allowedPolicyMemberDomains) is enforced.”Your organization blocks external service accounts. Contact your GCP administrator to add
system.gserviceaccount.com to the allowed domains:
Setup Steps
- Enable required APIs in Google Cloud Console
- Create a service account with
roles/pubsub.admin - Create a Pub/Sub topic named
gmail-notifications - Grant
gmail-api-push@system.gserviceaccount.compublisher access to the topic (see above) - Download your service account JSON key
- Configure in helm values under
oauth.secrets.google.gmail.triggers.serviceAccountCredentials
Google Sheets
Google Drive
Google Slides
Google Docs
Configure CrewAI Helm Values
After obtaining your OAuth credentials, configure them in your CrewAI Helm values:- Navigate to APIs & Services > Credentials
- Click Create Credentials > API Key
- Restrict the key to the Google Picker API for security
Activate the Integration
After deploying your updated Helm values, sync integrations to make them available to users — see Activate Integrations After Deployment.Support Google Workspace Identity
To restrict users to connecting to Built-In Integrations from a specific Google Workspace domain only (preventing personal Gmail accounts from authenticating), configure the googleWorkspaceDomain setting:- Only users with email addresses from the specified domain (e.g.,
@company.com) can authenticate - Personal Gmail accounts (
@gmail.com) will be rejected - This applies to all Google integrations (Calendar, Gmail, Drive, Sheets, Slides, Docs, and Contacts)
