Complete step-by-step tutorial to automate workflows with OpenClaw using cron jobs and webhooks
This tutorial will guide you through setting up your first automation with OpenClaw (formerly Moltbot, Clawdbot). We'll create a practical example: a daily briefing that runs every morning. By the end, you'll understand how to automate any task. Estimated time: 15-20 minutes.
We'll create a Daily Briefing Automation that:
This example covers the fundamentals you need to automate any task.
Before starting, ensure you have:
OpenClaw supports several automation types:
Scheduled tasks that run at specific times (daily, weekly, etc.)
Trigger actions from external services (GitHub, Sentry, etc.)
Continuous monitoring with configurable intervals
For this tutorial, we'll focus on cron jobs - the most common automation type. See the Automation Reference for webhooks and other types.
Before writing configuration, let's plan what our automation will do:
Cron uses a time-based schedule format:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
│ │ │ │ │
* * * * *
Examples:
0 9 * * * - Every day at 9:00 AM0 */6 * * * - Every 6 hours0 9 * * 1 - Every Monday at 9:00 AM*/15 * * * * - Every 15 minutesNow let's add the automation to your OpenClaw configuration.
Open your OpenClaw configuration file:
nano ~/.clawdbot/moltbot.json
# or use your preferred editor
Add the cron section to your configuration. Here's a complete example:
{
"agent": {
"model": "anthropic/claude-opus-4-5"
},
"cron": {
"jobs": [
{
"schedule": "0 9 * * *",
"command": "agent --message 'Create my daily briefing for today. Include: weather summary, calendar events, and any important reminders.'"
}
]
}
}
What this does:
"schedule": "0 9 * * *" - Runs at 9:00 AM every day"command" - The command to execute (sends a message to the agent)After adding your automation configuration:
# If running as service:
openclaw gateway restart
# Or if running manually, stop and restart:
openclaw gateway --port 18789 --verbose
The Gateway will now load your cron jobs and schedule them according to your schedule.
You don't have to wait until 9 AM to test! Let's verify it works:
Run the command manually to test:
openclaw agent --message 'Create my daily briefing for today. Include: weather summary, calendar events, and any important reminders.'
This should trigger the same response your automation will send. Check your connected channel for the message.
For testing, you can temporarily change the schedule to run more frequently:
{
"cron": {
"jobs": [
{
"schedule": "*/5 * * * *",
"command": "agent --message 'Test briefing'"
}
]
}
}
Remember to change it back to your desired schedule after testing!
Check that your automation is scheduled correctly:
Look for messages in your Gateway logs indicating cron jobs are loaded:
# If running as service, check logs:
openclaw gateway logs
# Or check system logs (macOS):
log show --predicate 'process == "openclaw"' --last 5m
If you set it to run at a specific time, wait until that time and check your channel for the automated message.
Here are more practical automation examples you can use:
{
"cron": {
"jobs": [
{
"schedule": "0 18 * * 5",
"command": "agent --message 'Create a weekly summary of my accomplishments and tasks completed this week.'"
}
]
}
}
Runs every Friday at 6:00 PM.
{
"cron": {
"jobs": [
{
"schedule": "0 8 * * *",
"command": "agent --message 'Check my calendar and remind me of any important events or deadlines today.'"
}
]
}
}
Runs every morning at 8:00 AM.
You can have multiple cron jobs:
{
"cron": {
"jobs": [
{
"schedule": "0 9 * * *",
"command": "agent --message 'Daily briefing'"
},
{
"schedule": "0 18 * * *",
"command": "agent --message 'Evening summary'"
},
{
"schedule": "0 0 * * 1",
"command": "agent --message 'Weekly planning session'"
}
]
}
}
If your automation doesn't run:
openclaw gateway statusCron jobs use your system's timezone. If times seem wrong:
dateIf the command doesn't execute:
Now that you understand automation basics, explore advanced features:
Trigger automations from external services like GitHub, Sentry, or custom apps.
Webhooks Guide →