Clawdbot Cron Jobs
Schedule automated tasks with Clawdbot AI assistant cron jobs. Learn how to configure recurring messages, reports, and automated workflows.
Clawdbot Cron Jobs Overview
Clawdbot supports scheduled tasks using cron-style syntax. Cron jobs enable automated messages, periodic reports, health checks, and recurring workflows.
Configuration
Basic Cron Job
{
"cron": {
"jobs": [
{
"id": "daily-summary",
"schedule": "0 9 * * *",
"action": "send_message",
"target": {
"channel": "whatsapp",
"peer": "+15551234567"
},
"message": "Good morning! Here's your daily summary."
}
]
}
}Cron Syntax
| Field | Values | Description |
|---|---|---|
| Minute | 0-59 | Minute of hour |
| Hour | 0-23 | Hour of day |
| Day | 1-31 | Day of month |
| Month | 1-12 | Month of year |
| Weekday | 0-6 | Day of week (0=Sunday) |
Common Schedules
| Schedule | Cron Expression |
|---|---|
| Every hour | 0 * * * * |
| Daily at 9am | 0 9 * * * |
| Weekly Monday | 0 9 * * 1 |
| Monthly 1st | 0 9 1 * * |
Job Types
Message Jobs
Send scheduled messages:
{
"id": "reminder",
"schedule": "0 8 * * 1-5",
"action": "send_message",
"target": {
"channel": "telegram",
"peer": "123456789"
},
"message": "Start of workday reminder!"
}Agent Jobs
Run agent tasks:
{
"id": "daily-report",
"schedule": "0 18 * * *",
"action": "run_agent",
"agentId": "reporter",
"prompt": "Generate today's activity report"
}Webhook Jobs
Trigger webhooks:
{
"id": "health-check",
"schedule": "*/5 * * * *",
"action": "webhook",
"url": "https://api.example.com/health",
"method": "POST"
}Session Handling
Cron Session Keys
Cron jobs use dedicated sessions:
cron:<job.id>Session Isolation
- Each job has its own session
- History persists across runs
- Context carries over
Job Management
CLI Commands
# List cron jobs
clawdbot cron list
# Add a job
clawdbot cron add --id daily --schedule "0 9 * * *" --action send_message
# Remove a job
clawdbot cron remove daily
# Run job immediately
clawdbot cron run dailyJob Status
| Status | Description |
|---|---|
active | Job is scheduled |
paused | Job is paused |
running | Currently executing |
failed | Last run failed |
Error Handling
Retry Policy
{
"cron": {
"retry": {
"maxAttempts": 3,
"backoff": "exponential",
"initialDelay": 1000
}
}
}Failure Notifications
{
"cron": {
"notifications": {
"onFailure": {
"channel": "telegram",
"peer": "admin_id"
}
}
}
}Timezone
Configuration
{
"cron": {
"timezone": "Asia/Shanghai"
}
}Default Behavior
- Uses system timezone if not specified
- All schedules interpreted in configured timezone
Examples
Daily Standup Reminder
{
"id": "standup",
"schedule": "0 9 * * 1-5",
"action": "send_message",
"target": {
"channel": "discord",
"peer": { "kind": "group", "id": "standup-channel" }
},
"message": "Time for daily standup! What did you work on yesterday?"
}Weekly Report
{
"id": "weekly-report",
"schedule": "0 17 * * 5",
"action": "run_agent",
"agentId": "main",
"prompt": "Generate weekly summary report and send to team channel"
}Next Steps
- Clawdbot Webhooks - Webhook integration
- Clawdbot Gateway - Gateway configuration
- Clawdbot Tools - Tool configuration