Automation: cron, hooks, webhooks & tasks
Schedules, gateway hooks, HTTP triggers, background work, and standing orders—summarized here; details stay current in the official automation docs.
Schedules, gateway hooks, HTTP triggers, background work, and standing orders—summarized here; details stay current in the official automation docs.
New to automation? Start with the Automation Tutorial for a hands-on walkthrough. This page collects common patterns and example config; when in doubt, follow the official automation documentation.
You can wake the agent on a timer, when a message or lifecycle event fires inside the gateway, when another system posts to a webhook, or through background tasks and standing orders. The sections below mirror that split; use them together with the official docs linked above.
Same idea everywhere: something happens, the gateway can wake your agent. The names differ so you can find the right upstream doc.
Standing orders — short standing instructions the agent keeps across turns. Official: Standing orders.
Webhooks allow external services to trigger OpenClaw actions:
Configure webhooks in your config file: ~/.openclaw/openclaw.json:
{
"webhooks": {
"enabled": true,
"endpoints": {
"/webhook/github": {
"handler": "github-webhook-handler"
}
}
}
}
Cron jobs allow scheduled tasks to run automatically:
Add the cron block to ~/.openclaw/openclaw.json. Restart the Gateway after editing.
{
"cron": {
"jobs": [
{
"schedule": "0 9 * * *",
"command": "agent --message 'Daily briefing'"
},
{
"schedule": "*/30 * * * *",
"command": "check-status"
}
]
}
}
OpenClaw supports two scheduling mechanisms:
Use cron for specific time-based tasks, heartbeat for continuous monitoring.
Hooks allow you to intercept and modify events:
OpenClaw can integrate with Gmail via Pub/Sub:
Configure Gmail Pub/Sub in your workspace for email automation.
Schedule a daily briefing that summarizes your day:
{
"cron": {
"jobs": [
{
"schedule": "0 9 * * *",
"command": "agent --message 'Create my daily briefing'"
}
]
}
}
Example pattern: send Sentry (or similar) events to a webhook so the agent can triage:
Common GitHub webhook flows people wire up: