All posts
OpenClaw Guides

OpenClaw Slack and Google Calendar Integration: Step-by-Step

How to connect OpenClaw to Slack and Google Calendar. Covers Slack bot setup, app tokens, Gmail Pub/Sub triggers, and common configuration errors.

Tin Zulic··10 min read

Slack and Google Calendar are the two integrations most business users want first. They're also among the more involved setups in OpenClaw — Slack requires two separate tokens, and Google Calendar integration goes through Pub/Sub rather than simple polling.

This covers both, step by step.

Part 1: OpenClaw + Slack

How Slack Integration Works

OpenClaw connects to Slack using two tokens:

  • SLACK_BOT_TOKEN — authenticates your agent as a Slack bot (starts with xoxb-)
  • SLACK_APP_TOKEN — enables Socket Mode, which lets your agent receive events in real-time without a public webhook URL (starts with xapp-)

You need both. A common mistake is using only the bot token, which means your agent can send messages but can't receive them.

Step 1: Create a Slack App

Go to api.slack.com/apps → "Create New App" → "From scratch."

Name your app (this will be visible to your team as the bot name). Select your workspace.

Step 2: Configure Bot Permissions

Under "OAuth & Permissions" → "Scopes" → "Bot Token Scopes," add:

  • channels:read — see channel info
  • channels:history — read messages in public channels
  • chat:write — send messages
  • im:read and im:history — direct messages
  • users:read — see user info (needed for @mention resolution)

For any channels you want your agent to monitor, also add groups:read and groups:history.

Step 3: Enable Socket Mode

Under "Socket Mode," enable it. This generates your SLACK_APP_TOKEN — copy it immediately (it starts with xapp-).

Under "Event Subscriptions," enable events. Subscribe to:

  • message.channels — messages in public channels
  • message.im — direct messages to your bot

Step 4: Install the App

Under "OAuth & Permissions" → "Install to Workspace." Authorize it. After installation, you'll see your SLACK_BOT_TOKEN (starts with xoxb-).

Step 5: Configure OpenClaw

Install the Slack skill:

clawhub install slack
openclaw gateway restart

Then add your tokens to ~/.openclaw/openclaw.json under the Slack channel configuration:

  • SLACK_BOT_TOKEN: your xoxb-... token
  • SLACK_APP_TOKEN: your xapp-... token

Restart the gateway after updating the config: openclaw gateway restart

Step 6: Invite Your Bot to Channels

In Slack, go to each channel your agent should monitor. Type /invite @your-bot-name.

Your bot won't see messages in channels it hasn't been invited to.

Test

Message your bot directly in Slack. It should respond. If it doesn't, check openclaw logs — Slack errors are usually token-related or permissions-related.


Part 2: OpenClaw + Google Calendar

How Calendar Integration Works

Google Calendar integration in OpenClaw uses the Google Calendar API with OAuth2. Your agent authenticates with your Google account and can read your calendars, create events, and respond to scheduling requests.

For real-time triggers (your agent reacting when events are created or modified), you need to configure Gmail with Pub/Sub — covered in the advanced section below.

Step 1: Create a Google Cloud Project

Go to console.cloud.google.com. Create a new project (name it anything — "openclaw-agent" is fine).

Step 2: Enable APIs

In the project, go to "APIs & Services" → "Library." Search for and enable:

  • Google Calendar API
  • Gmail API (if you want email integration)

Step 3: Configure OAuth Consent Screen

Under "APIs & Services" → "OAuth consent screen":

  • Select "External"
  • Fill in the required fields (app name, support email)
  • Under "Scopes," add:
    • https://www.googleapis.com/auth/calendar
    • https://www.googleapis.com/auth/calendar.events
  • Add yourself as a test user

Step 4: Create Credentials

Under "APIs & Services" → "Credentials" → "Create Credentials" → "OAuth client ID":

  • Application type: Desktop app
  • Name: openclaw

Download the JSON file. Keep it — you'll need it during skill configuration.

Step 5: Install and Configure the Calendar Skill

clawhub install google-calendar
openclaw gateway restart

The skill will need your OAuth credentials file. Add the path to your openclaw.json configuration, then restart the gateway. On first use, the skill will open a browser window for OAuth authorization — sign in with the Google account that owns the calendars you want to connect.

After authorization, your agent has calendar access.

Test

In Telegram (or whichever channel you've set up), ask your agent:

What's on my calendar today?

If the integration is working, you'll see your events listed.


Advanced: Gmail Pub/Sub Triggers

If you want your agent to react in real-time when emails arrive — rather than polling on a schedule — configure Gmail's Pub/Sub integration. This follows the pattern documented at docs.openclaw.ai/automation/gmail-pubsub.

The short version: Gmail can push notifications to a Google Cloud Pub/Sub topic when your inbox changes. Your agent subscribes to that topic and acts on the push.

Setup requires:

  1. A Pub/Sub topic in your Google Cloud project
  2. A Pub/Sub subscription pointing to your agent's webhook endpoint
  3. Gmail push notification configuration pointing to your topic

This is more involved than basic calendar setup, and requires your agent to have a public webhook URL. If you're not running OpenClaw in gateway mode with a public endpoint, skip this for now and use polling instead.


Common Errors

Slack: "not_authed" errors. Your bot token is wrong or expired. Regenerate it in your Slack app settings.

Slack: bot responds to nothing. Socket Mode may be disabled. Check your app settings — if Socket Mode is off, the SLACK_APP_TOKEN isn't being used, and your bot can't receive events.

Slack: bot only responds in DMs, not channels. You haven't invited the bot to the channels. Go to each channel and type /invite @your-bot-name.

Calendar: "insufficient permissions" error. The OAuth scope didn't include calendar write access. Revoke the OAuth token, add the calendar scope (not just calendar.readonly), and reauthorize.

Calendar: agent can see events but can't create them. Same permissions issue — verify both read and write scopes are authorized.

Calendar: "invalid_client" error. Your credentials JSON file is from the wrong project, or the OAuth consent screen hasn't been configured. Check both.


OpenClaw tutorial: getting started →

Agent skills overview: which to install first →

Skip the configuration — Volos connects your tools through conversation →

Related posts

Want the agent without the setup?

Volos handles everything. €99 setup + €49/month.

Join the waitlist