Skip to main content

Automation & Integrations

OpenClaw can be triggered by schedules, webhooks, and CI/CD pipelines — not just chat messages. This guide covers proactive automation beyond the basic heartbeat.


Cron Jobs​

OpenClaw has a built-in cron system that persists jobs across restarts. Unlike the heartbeat (which runs the same check every N minutes), cron jobs run specific tasks at specific times.

Creating a Cron Job​

Via CLI:

openclaw cron add \
--name "Morning brief" \
--cron "0 7 * * *" \
--tz "America/Los_Angeles" \
--session isolated \
--message "Summarize overnight updates." \
--announce \
--channel slack \
--to "channel:C1234567890"

Via config:

~/.openclaw/openclaw.json
{
"cron": [
{
"name": "Morning brief",
"schedule": {
"kind": "cron",
"expr": "0 7 * * *",
"tz": "America/Los_Angeles"
},
"sessionTarget": "isolated",
"wakeMode": "next-heartbeat",
"payload": {
"kind": "agentTurn",
"message": "Summarize overnight updates."
},
"delivery": {
"mode": "announce",
"channel": "slack",
"to": "channel:C1234567890",
"bestEffort": true
}
}
]
}

Jobs persist under ~/.openclaw/cron/ so restarts don't lose schedules.

Cron vs Heartbeat​

FeatureHeartbeatCron Jobs
TriggerEvery N minutes (default: 30)Specific cron schedule
TaskReads HEARTBEAT.md, checks for workRuns a specific message/command
SessionContinues existing sessionCan run isolated
CostRuns even when idleOnly runs at scheduled time
Use caseMonitoring, reactive checksScheduled reports, daily tasks

Rule of thumb: Use heartbeat for monitoring and reactive behavior. Use cron for scheduled, predictable tasks.

Example Cron Jobs​

# Daily standup summary at 9 AM
openclaw cron add --name "Standup" --cron "0 9 * * 1-5" \
--message "Summarize what I worked on yesterday from git logs and calendar."

# Weekly report every Friday at 5 PM
openclaw cron add --name "Weekly report" --cron "0 17 * * 5" \
--message "Generate my weekly status report from this week's git activity."

# Hourly news check during work hours
openclaw cron add --name "News check" --cron "0 9-17 * * 1-5" \
--message "Check for breaking news in AI and tech. Only alert if significant."

# Nightly backup verification
openclaw cron add --name "Backup check" --cron "0 2 * * *" \
--message "Verify that nightly backups completed successfully."

Managing Cron Jobs​

openclaw cron list              # List all jobs
openclaw cron remove <name> # Remove a job
openclaw cron pause <name> # Pause without removing
openclaw cron resume <name> # Resume a paused job

Webhooks​

OpenClaw can receive and send webhooks for event-driven automation.

Incoming Webhooks​

Trigger agent actions from external events:

~/.openclaw/config.yml
webhooks:
incoming:
enabled: true
secret: "your-webhook-secret"
endpoints:
- path: /deploy-alert
message: "A deployment just completed: {{body}}"
- path: /error-alert
message: "Production error detected: {{body}}"

External services send a POST to http://localhost:18789/webhook/<path> with the webhook secret, and the agent processes the message.

Outgoing Webhooks​

Have OpenClaw notify external services when events occur:

~/.openclaw/config.yml
webhooks:
outgoing:
- event: "agent.task.completed"
url: "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
- event: "security.alert"
url: "https://your-monitoring.example.com/alerts"

CI/CD Integration​

GitHub Actions​

OpenClaw can automate code review, PR management, and CI tasks via GitHub Actions:

.github/workflows/openclaw-review.yml
name: OpenClaw PR Review
on:
pull_request:
types: [opened, synchronize]

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install OpenClaw
run: npm install -g openclaw
- name: Review PR
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
openclaw chat --once "Review this pull request. Check for bugs, security issues, and style. Post your review as a GitHub comment."

Best practice: Use read-only access. OpenClaw excels at reviewing code without needing push access:

PatternAccessUse Case
PR reviewReadCode review comments, suggestions
Issue triageRead + CommentLabel, categorize, request info
Release notesReadGenerate changelogs from commits
Test analysisReadAnalyze test failures, suggest fixes

Lobster Workflows​

Lobster is OpenClaw's official workflow shell for composable pipelines:

workflows/deploy.yml
name: Deploy Pipeline
steps:
- name: lint
skill: code-lint
input: "{{ files.changed }}"
- name: test
skill: run-tests
needs: [lint]
- name: deploy
skill: deploy-staging
needs: [test]
approval: required

Lobster provides typed pipelines, approval gates for side-effect actions, and persistent state between runs.


Service Integrations​

Messaging Platforms​

Full integration guides are in Channels & Integrations. Quick reference:

PlatformSetupAutomation Use Case
SlackOAuth appTeam notifications, standup bots, incident response
DiscordBot tokenCommunity management, moderation, FAQ bot
TelegramBot tokenPersonal assistant, alerts, remote control
WhatsAppQR scanPersonal messaging, family coordination
iMessagemacOS onlyPersonal assistant (calendar, reminders)

Developer Tools​

ServiceIntegrationKey Capabilities
GitHubOAuth/tokenIssues, PRs, code review, notifications
GmailOAuthRead, send, search, label emails
Google CalendarOAuthCreate events, check availability, reminders
NotionAPI tokenRead/write pages, database queries
LinearAPI tokenIssue tracking, sprint management
JiraAPI tokenIssue management, status updates

Smart Home​

PlatformIntegrationCapabilities
Home AssistantREST APIControl lights, locks, thermostats, automations
Philips HueBridge APISmart light control
IFTTTWebhooksBridge to 700+ services

See the Smart Home recipe for a complete setup guide.


Automation Patterns​

Morning Briefing​

Combine cron + multiple integrations:

openclaw cron add --name "Morning brief" --cron "0 7 * * 1-5" \
--message "Good morning. Check my calendar for today, summarize unread emails, check GitHub notifications, and give me a weather forecast. Send the summary to WhatsApp."

Inbox Monitor​

Use heartbeat for reactive monitoring:

~/.openclaw/HEARTBEAT.md
## Email Monitor
- Check Gmail for unread emails from VIP contacts
- If urgent (contains "urgent", "ASAP", "emergency"), send me a Telegram alert
- Otherwise, batch summary at next heartbeat

Deploy Watcher​

~/.openclaw/HEARTBEAT.md
## Deploy Monitor
- Check GitHub Actions for failed deployments in my repos
- If a deploy failed, analyze the logs and send me a Slack message
with the error summary and suggested fix

Content Pipeline​

# Daily content automation
openclaw cron add --name "Content pipeline" --cron "0 8 * * 1-5" \
--message "Check my content calendar in Notion. For any post due today, draft it based on the outline and save to Google Docs. Notify me on Slack when ready for review."

Security Considerations​

Automation increases risk because actions happen without human oversight:

  • Limit scope: Give cron jobs and heartbeat tasks the minimum permissions needed
  • Set quiet hours: Disable autonomous operation during sleep — see Cost Management
  • Audit regularly: Review ~/.openclaw/cron/ and HEARTBEAT.md for unauthorized entries
  • Webhook secrets: Always use shared secrets for incoming webhooks
  • CI/CD tokens: Use repository-scoped tokens with minimal permissions
  • Read-only patterns: Prefer read-only integrations for automated tasks

See Also​