One of the most powerful things OpenClaw can do is manage your email. It can scan your inbox, tell you what actually needs attention, draft replies, and even send them (with your approval).
This guide walks through the Gmail integration from scratch.
What You'll Be Able to Do
Once connected, you can ask OpenClaw things like:
"Summarize the last 10 emails from my team"
"Draft a reply to Sarah's email about the project timeline"
"Find all unread emails from the past week about invoices"
It's like having an assistant who reads your email for you and surfaces what matters.
Prerequisites
- OpenClaw installed and running (setup guide here)
- A Google account (personal Gmail or Google Workspace)
- ~10 minutes for the OAuth setup
Step 1: Create a Google Cloud Project
Head to console.cloud.google.com and sign in with the Google account you want to connect.
Click the project dropdown (top left), then "New Project." Name it something like "OpenClaw Gmail" and create it.
In your new project, go to "APIs & Services" → "Library." Search for "Gmail API" and click Enable.
Step 2: Set Up OAuth Credentials
Go to "APIs & Services" → "OAuth consent screen." Choose "External" (unless you have Workspace, then "Internal"). Fill in the required fields—app name, support email, developer email. Save and continue through the scopes (you'll add them later).
Go to "Credentials" → "Create Credentials" → "OAuth client ID." Choose "Desktop app" as the application type. Name it "OpenClaw" and create.
Click the download button (JSON) on your new credential. Save this file—you'll need it for OpenClaw.
Keep this file secure. The credentials JSON gives access to your Gmail. Don't commit it to git or share it publicly.
Step 3: Connect to OpenClaw
Now tell OpenClaw to use these credentials. The easiest way:
OpenClaw will walk you through the rest—where to put the credentials file, running the OAuth flow, and testing the connection.
If you prefer manual setup, place the credentials JSON in your OpenClaw workspace and reference it in your config. Check the official docs for the exact config syntax.
Step 4: Authorize Access
The first time OpenClaw tries to access Gmail, it'll give you a URL to visit. This is the OAuth flow:
- Click the link OpenClaw provides
- Sign in with your Google account
- You'll see a warning about unverified app—click "Advanced" then "Go to OpenClaw (unsafe)"
- Grant the permissions requested
- Copy the authorization code back to OpenClaw
Why "unsafe"? Google shows this warning for apps that haven't gone through their verification process. Since this is your own private integration, it's fine. You're authorizing your own app to access your own email.
Test It
Once connected, try these:
If OpenClaw lists your recent emails, you're good. Now you can start building actual workflows.
Workflow Ideas
Morning Email Triage
"Check my inbox. Tell me which emails need a response today vs. which can wait. Ignore newsletters."
Auto-Draft Replies
"For each email from my manager this week, draft a brief reply. Don't send—just show me the drafts."
Weekly Summary
"Every Monday at 9am, summarize important emails I received last week and any I haven't responded to."
Invoice Tracking
"Find all emails with PDF attachments from vendors this month. List the amounts if visible."
Security Notes
- OpenClaw doesn't store your emails. It reads them on-demand when you ask.
- OAuth tokens are stored locally on your server, not sent anywhere else.
- You can revoke access anytime from your Google account security settings.
- Consider read-only scope if you don't want OpenClaw sending emails—just modify the scopes in your OAuth consent screen.
Troubleshooting
"Access blocked" error
Make sure you added yourself as a test user in the OAuth consent screen (APIs & Services → OAuth consent screen → Test users).
"Invalid credentials" error
Re-download the credentials JSON and make sure OpenClaw is pointing to the correct file path.
Token expired
OAuth tokens expire. If OpenClaw stops working after a while, you may need to re-authorize. It should prompt you automatically.
Need help? Join the Discord community or check the official docs.