Email Management with OpenClaw

Complete tutorial to automate email processing, filtering, and responses

This walkthrough gets OpenClaw talking to your email: process messages, filter and prioritize, send automated replies, and (with Gmail) react to new mail in real time via Pub/Sub instead of polling. Allow 20–30 minutes. The examples use Gmail; the ideas apply to other providers if you have a skill or integration for them.

What you end up with

By the end you’ll have OpenClaw wired to your inbox (we use Gmail as the example). The assistant can read and summarize mail, filter by sender or importance, send replies on your behalf, and—if you set up Gmail Pub/Sub—process new messages as they arrive instead of on a schedule. You can drive it from chat (“Check my emails”, “Summarize the last 24 hours”) or from cron and webhooks.

Prerequisites

You need OpenClaw installed and running (if not, do the Getting Started tutorial first) and at least one channel connected so you can talk to the assistant. A Gmail account is enough for the examples here; other email access works if there’s a skill for it. Familiarity with automation (cron, webhooks) helps when you add scheduled or event-driven email tasks—see the Automation tutorial for that.

Step 1: Install email skills

OpenClaw reaches your email through skills—add-ons that give the agent tools to read, send, and organize mail. Two main options:

Google Workspace (gws): For full Gmail + Drive + Calendar + Sheets + Docs access, use gws—100+ skills with first-class OpenClaw support. Install with npx skills add https://github.com/googleworkspace/cli after running gws auth setup and gws auth login.

Or use a standalone Gmail skill for email-only access. From your project or OpenClaw environment:

Install Gmail Skill
npx clawdhub@latest install gmail

That pulls the skill and wires it in. Alternatively you can ask the assistant in chat: e.g. “Set up Gmail integration for email management”, “Create a skill to read and process my emails”, or “Help me automate email filtering”. It will walk you through setup and, for Gmail, OAuth when needed. Once the skill is installed, the agent can query and send mail (after you complete OAuth in the next step).

Step 2: Configure email access

Gmail (and most Google APIs) use OAuth so OpenClaw can access your mailbox without your password. You create a project in Google Cloud, enable the Gmail API, create OAuth client credentials, and add them to your OpenClaw configuration. Then you complete a one-time sign-in in the browser; after that the skill can read and send mail on your behalf.

Gmail OAuth setup

  1. Open Google Cloud Console
  2. Create a new project or pick an existing one
  3. Enable the Gmail API for that project
  4. Create OAuth 2.0 credentials (e.g. desktop or web application type, depending on how the skill expects them)
  5. Add the client ID and secret to OpenClaw (the skill or config usually tells you where—often in workspace or env)

You can do this manually or ask OpenClaw in chat: “Help me set up Gmail OAuth”. It will prompt you for the right steps and where to paste credentials.

Step 3: Set up email automation

With the skill and OAuth in place, you can run email tasks on a schedule (cron) or in real time (Gmail Pub/Sub). Scheduled runs are simple: you trigger the agent at a fixed time with a message like “Check my emails and summarize”. Real time needs Gmail Pub/Sub so Google pushes a notification when mail arrives; OpenClaw then processes it without polling. Both are described in the Automation reference; below are minimal examples.

Daily email summary (cron)

Run the agent every morning to summarize the last 24 hours and flag what needs attention. Example cron config (adjust schedule and message to taste):

Daily Email Summary Cron
{
  "cron": {
    "jobs": [
      {
        "schedule": "0 9 * * *",
        "command": "agent --message 'Check my emails from the last 24 hours. Summarize important messages and flag any that need my attention.'"
      }
    ]
  }
}

Real-time processing (Gmail Pub/Sub)

To react as soon as mail arrives, set up Gmail Pub/Sub: create a topic and subscription in Google Cloud, point Gmail to push to that topic, and configure OpenClaw to receive those pushes (via a webhook or the hooks config). Then new mail triggers your agent immediately instead of waiting for the next cron run. Example hooks config (fill in your topic and subscription):

Gmail Pub/Sub Config
{
  "hooks": {
    "gmail": {
      "enabled": true,
      "topic": "your-pubsub-topic",
      "subscription": "your-subscription-name"
    }
  }
}

Full Pub/Sub and webhook setup is in the Automation guide (webhooks, Gmail push).

Step 4: Create email processing rules

Beyond “check my inbox” and scheduled summaries, you can define rules the agent follows: filter by sender or keyword, auto-respond, categorize and move mail, or handle attachments. You don’t have to write code—you describe what you want in chat and the assistant can create or adjust a skill or automation rule. For example:

  • “Filter emails from important senders and notify me immediately”
  • “Auto-respond to emails that contain [keyword] with [template or draft]”
  • “Categorize emails and move them to the right folders”
  • “Extract attachments and save them to [path]”

OpenClaw will propose or generate the logic (skills, cron jobs, or webhook handlers) and you refine from there. See Skills and Automation tutorial for how skills and scheduled/event-driven tasks fit together.

Step 5: Test the setup

Confirm that the agent can see and act on your mail. Send yourself a test message, then in chat ask OpenClaw to check your inbox or summarize recent mail. If it can read and summarize, the skill and OAuth are working. Then test any automation you added: either wait for the next cron run (e.g. the morning summary) or trigger the same command manually so you see the agent’s output. If you set up Pub/Sub, send another test email and check that the agent runs when the push arrives—see Automation and your Gateway logs if pushes aren’t firing.

Going further

Once read, summarize, and basic automation work, you can layer on smarter behavior. Use the agent to separate important mail from noise, draft or send context-aware replies, summarize long threads, or process attachments (e.g. extract text from PDFs, save to a folder). To tie email to your calendar, pull meeting requests from messages and create events—Calendar integration walks through that. The same Automation reference (cron, webhooks, Pub/Sub) supports more complex email workflows.

Next steps