OpenClaw Gmail Integration Setup — Connect Gmail & Google Calendar

Clawpedia · For Humans

OpenClaw Gmail integration setup step by step: OAuth credentials, scopes, Google Calendar access, and testing automated email and scheduling workflows.

Overview

Google Calendar and Gmail are among the most requested integrations for OpenClaw. With these connected, your agent can check your schedule, create events, read and summarize emails, draft replies, and automate routine communication. This guide walks you through the complete setup and shows practical use cases.

Prerequisites

Setting Up Google API Access

Step 1: Create a Google Cloud Project

Step 2: Create OAuth 2.0 Credentials

Step 3: Install and Configure the Skill


# Install the Google Workspace skill
openclaw skills install google-workspace

# Configure with your credentials
openclaw skills config google-workspace --set credentials_path /path/to/credentials.json

# Authenticate (opens browser for OAuth consent)
openclaw skills auth google-workspace

The authentication flow:

Google Calendar Integration

Configuration


skills:
  google-workspace:
    calendar:
      enabled: true
      calendar_id: primary          # or a specific calendar ID
      default_duration: 60          # Default event duration in minutes
      reminder_minutes: 15          # Default reminder
      timezone: Europe/Berlin
      working_hours:
        start: "09:00"
        end: "18:00"

What You Can Do

CommandExample
Check schedule"What's on my calendar today?"
Create events"Schedule a meeting with Sarah tomorrow at 2 PM"
Find free time"When am I free this week?"
Modify events"Move my 3 PM meeting to 4 PM"
Cancel events"Cancel my meeting with John"
Set reminders"Remind me about the presentation 1 hour before"

Example Interactions


User: "What do I have tomorrow?"

Agent: "Here's your schedule for Tuesday, January 16:

  🕘 09:00 – 09:30  Team standup (Zoom)
  🕙 10:00 – 11:00  Project review with Sarah
  🕐 13:00 – 14:00  Lunch with client (Restaurant Zum Löwen)
  🕞 15:30 – 16:00  1:1 with manager

  You have 3 free hours: 11:00-13:00 and 14:00-15:30."

User: "Schedule a dentist appointment next Friday at 10 AM"

Agent: "I've created the event:

  📅 Dentist Appointment
  🗓 Friday, January 19, 10:00 – 11:00
  ⏰ Reminder: 1 hour before

  Note: This conflicts with your 'Sprint Planning' at 10:30.
  Should I move the sprint planning?"

Multiple Calendars


skills:
  google-workspace:
    calendar:
      calendars:
        - id: primary
          name: Work
        - id: "abc123@group.calendar.google.com"
          name: Personal
        - id: "def456@group.calendar.google.com"
          name: Family
      default_calendar: primary

User: "Add Mom's birthday on March 15 to my family calendar"
Agent: "Added 'Mom's Birthday' to your Family calendar on March 15. Set as all-day event with annual recurrence."

Gmail Integration

Configuration


skills:
  google-workspace:
    gmail:
      enabled: true
      max_emails: 20               # Max emails to fetch per request
      auto_summarize: true         # Summarize long emails
      summary_max_words: 50
      labels:
        - INBOX
        - IMPORTANT
      exclude_labels:
        - SPAM
        - PROMOTIONS

What You Can Do

Check conflicts"Am I free next Tuesday at 10 AM?"
CommandExample
Check inbox"Do I have any new emails?"
Read emails"Read the email from Sarah"
Summarize"Summarize my unread emails"
Search"Find emails about the project proposal"
Draft replies"Draft a reply to John's email"
Send emails"Send an email to sarah@company.com about the meeting"

Example Interactions


User: "Summarize my unread emails"

Agent: "You have 7 unread emails:

  ⚡ High Priority:
  1. Sarah Chen — Project deadline moved to Friday
     → Requests confirmation of new timeline
  2. IT Department — Password expiry in 3 days
     → Action: Update password before Thursday

  📬 Normal:
  3. John Miller — Q4 report draft attached
  4. Team Slack — Weekly digest (14 messages)
  5. AWS — Monthly billing: $142.30

  📰 Low Priority:
  6. LinkedIn — 3 new connection requests
  7. Newsletter — Tech Weekly #147

  Want me to draft replies to any of these?"

Email Drafting


User: "Reply to Sarah that the new timeline works for me"

Agent: "Here's my draft reply:

  To: sarah.chen@company.com
  Subject: Re: Project deadline moved to Friday

  Hi Sarah,

  Thanks for the update. The new Friday deadline works
  for me. I'll have the deliverables ready by Thursday
  evening to allow for review.

  Best,
  [Your name]

  Should I send this, or would you like to edit it?"

Security Considerations

Scopes

Manage labels"Archive all emails from newsletters"

The skill requests only the minimum necessary permissions:

ScopeAccessWhy
calendar.eventsRead/write calendar eventsCreate, modify, view events
gmail.readonlyRead emailsCheck and summarize inbox
gmail.sendSend emailsDraft and send replies

Token Security


skills:
  google-workspace:
    security:
      token_path: ~/.openclaw/tokens/google.json
      encrypt_token: true
      require_confirmation:
        - send_email              # Always confirm before sending
        - delete_event            # Always confirm before deleting
      read_only_mode: false       # Set true for read-only access
gmail.modifyModify labelsArchive, label management

Tip: Enable require_confirmation for destructive actions. This prevents the agent from sending emails or deleting events without your explicit approval.

Token Refresh

OAuth tokens expire periodically. OpenClaw auto-refreshes them using the refresh token. If refresh fails:


# Re-authenticate
openclaw skills auth google-workspace --force

Automation Recipes

Morning Email Briefing


automation:
  email-briefing:
    trigger:
      schedule: "0 8 * * 1-5"
    steps:
      - skill: google-workspace
        action: gmail.unread
        params: { limit: 10 }
      - action: prompt
        prompt: "Summarize these emails by priority. Suggest replies for urgent ones."
    output:
      platform: telegram

Meeting Prep


automation:
  meeting-prep:
    trigger:
      schedule: "*/15 * * * *"   # Check every 15 minutes
    steps:
      - skill: google-workspace
        action: calendar.next
        params: { within_minutes: 15 }
      - condition: "steps[0].result != null"
      - action: prompt
        prompt: "Prepare a brief for this meeting: {{steps[0].result}}"
    output:
      platform: slack
      channel: "#meetings"

Troubleshooting

"Access Denied" Error

Events Created in Wrong Timezone

Set timezone explicitly:


openclaw skills config google-workspace --set calendar.timezone "America/New_York"

Emails Not Showing

Next Steps

Related Articles