Google Workspace: Managed OAuth for Multiple Accounts
Configure multiple Google accounts for different purposes, each with secure OAuth connections and scoped permissions.
What You Will Get
After this guide, your OpenClaw agent will be connected to multiple Google accounts simultaneously. Each account serves a different purpose: one for personal email, another for work calendar, a third for a project Drive. The agent knows which account to use based on the task context.
Many people use multiple Google accounts for different areas of their life. Rather than choosing one account for all integrations, multi-account support lets your agent access the right account for each task. Send personal emails from your personal account and work emails from your work account, all through the same agent.
Each account has its own OAuth token with independently scoped permissions. You control exactly what the agent can do with each account, and revoking one account's access does not affect the others. This provides both flexibility and security.
Step-by-Step Setup
Connect and manage multiple Google accounts with separate OAuth connections.
Plan Your Account Structure
Before connecting accounts, plan which Google accounts you want to link and what each one will be used for. For example, personal@gmail.com for personal email and calendar, work@company.com for work email and Drive, and project@gmail.com for a specific project. Write down the accounts, their purposes, and the permissions each one needs.
Connect Your First Google Account
In the RunTheAgent dashboard, go to the Google Workspace settings and click Add Google Account. Complete the OAuth flow for your first account. Give it a descriptive label like Personal or Work. Select the services you want to enable for this account: Gmail, Calendar, Drive, Docs, Sheets, and Slides.
Add Additional Accounts
Click Add Google Account again to connect each additional account. Sign into the Google account you want to add and complete the OAuth authorization. Assign a unique label to each account. The dashboard shows all connected accounts with their labels, services, and connection status.
Configure Default Account Routing
Set up rules for which account the agent uses by default for each type of task. For example, all email operations default to your work account, personal calendar queries use your personal account, and Drive operations use your project account. These defaults are overridden when you specify an account explicitly.
Set Up Context-Based Switching
Configure the agent to detect which account to use based on context. If you ask the agent to check my work email, it routes to your work account. If you say schedule a personal appointment, it uses your personal calendar. Define keyword and context patterns for automatic account selection.
Configure Per-Account Permissions
Review and adjust the OAuth scopes for each account independently. Your personal account might only need Calendar read access, while your work account needs full Gmail and Drive permissions. Minimize permissions per account to follow the principle of least privilege.
Test Multi-Account Operations
Test each connected account by performing a task that routes to it. Send a work email, check your personal calendar, and upload a file to the project Drive. Verify that each operation uses the correct account. Check the RunTheAgent logs to confirm the account routing is working as expected.
Tips and Best Practices
Use Clear Account Labels
Give each account a descriptive, easy-to-remember label. When you need to specify an account explicitly, you will reference it by label. Labels like Personal Gmail and Work Drive are much clearer than Account 1 and Account 2.
Audit Connections Periodically
Review your connected accounts quarterly. Remove any accounts you no longer use and update permissions for accounts whose requirements have changed. This reduces your security surface.
Keep Tokens Secure
OAuth tokens for multiple accounts are stored securely by RunTheAgent. Never share your dashboard login credentials, as this would grant access to all connected Google accounts.
Test After Account Changes
If you change a Google account's password, enable new security settings, or modify OAuth scopes, test the connection from the dashboard. Some changes may require re-authorization.
Frequently Asked Questions
Related Pages
Ready to get started?
Deploy your own OpenClaw instance in under 60 seconds. No VPS, no Docker, no SSH. Just your personal AI assistant, ready to work.
Starting at $24.50/mo. Everything included. 3-day money-back guarantee.