Automation
Make your agent proactive with cron jobs, hooks, webhooks, and event-driven triggers.
OpenClaw isn't just reactive — it can initiate actions on its own schedule.
Cron Jobs
Schedule recurring tasks via the Gateway scheduler:
openclaw cron add "daily-briefing" --schedule "0 8 * * *" --message "Give me my daily briefing: weather, calendar, top emails"
Manage with CLI:
openclaw cron list
openclaw cron remove daily-briefing
Or configure in openclaw.json for persistence. Jobs use standard cron syntax.
Hooks
Event-driven triggers that fire on specific conditions. Hooks use a HOOK.md metadata format similar to SKILL.md.
Bundled hooks are available out of the box. Hook packs can be distributed via npm or archives.
Hook types:
- Command hooks — triggered by user slash commands
- Event hooks — triggered by system events (new message, session start, etc.)
- SOUL Evil Hook — special hook for prompt injection detection and defense
Example use cases: auto-summarize long threads, auto-tag emails, send daily recaps.
Webhooks
Expose HTTP endpoints for external triggers. The Gateway supports:
/hooks/wake— Wake the agent from external systems/hooks/agent— Send a message to the agent via HTTP/hooks/<name>— Custom mapped webhook handlers
{
"webhooks": {
"deploy-notify": {
"path": "/hooks/deploy",
"message": "A new deployment was triggered: {{body.repo}} {{body.branch}}"
}
}
}
Security: Use authentication tokens, bind to localhost, and use HTTPS for external-facing webhooks.
Gmail PubSub
Connect to Gmail push notifications. When a new email arrives, OpenClaw can:
- Triage and categorize
- Draft a reply
- Notify you on WhatsApp/Telegram with a summary
- Auto-archive low-priority messages
Polls
Periodically check external sources (APIs, RSS feeds, websites) for changes. Configure polling intervals and trigger actions when changes are detected.
Auth Monitoring
Automatically monitor authentication status for connected services. Get alerted when:
- OAuth tokens are expiring
- API keys are approaching rate limits
- Channel connections drop
Cron vs Heartbeat
- Cron: Time-based scheduling. “Do X every day at 8am.”
- Heartbeat: Interval-based check-ins. “Check status every 5 minutes.”
Use cron for scheduled tasks, heartbeat for monitoring and keepalive.
Real-World Automation Examples
Morning Briefing
Daily cron: weather + calendar + top 5 emails at 8am
Email Triage
Gmail PubSub: auto-categorize, draft replies, notify urgents
Deploy Notifications
Webhook from CI/CD → agent summarizes and posts to Slack
Blog Monitor
Poll RSS feeds → summarize new posts → save to notes
Deep Dive: Proactive Agent Architecture
Automation transforms an agent from a chatbot into an autonomous system. The cron/webhook/event patterns OpenClaw uses are the same building blocks in every production agent platform.
Explore Agent Design Patterns