Skip to main content
Combine Google Drive, Gmail, and Calendar context providers in one agent for cross-service workflows.
GOOGLE_DELEGATED_USER makes Google Drive, Gmail, and Calendar impersonate the same Workspace user. The source still gives Drive service-account search instructions, including sharedWithMe fallbacks. Confirm domain-wide delegation covers all three APIs and adapt the Drive instructions to the delegated user’s files before running.
google_workspace.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Run the example

Save the code above as google_workspace.py, then run:
Full source: cookbook/12_context/20_google_workspace.py