Automate Everything with
OpenClaw Cron Jobs
Master OpenClaw automation with scheduled tasks, workflows, and cron jobs. Set up powerful automation that runs 24/7.
Cron Job Fundamentals
Understanding the building blocks of OpenClaw automation
Cron Expression
Time-based job scheduler syntax
Format:
Examples:
0 9 * * *→ Every day at 9:00 AM*/15 * * * *→ Every 15 minutes0 */2 * * *→ Every 2 hours0 9 * * 1-5→ 9 AM on weekdays0 0 1 * *→ First day of every monthJob Types
Different types of scheduled tasks
Agent Tasks
Schedule specific agent actions
- •Send daily reports
- •Process emails
- •Update social media
System Maintenance
Automated system upkeep
- •Clean temp files
- •Backup data
- •Update dependencies
Data Processing
Scheduled data operations
- •Import feeds
- •Generate analytics
- •Sync databases
Notifications
Timed alerts and reminders
- •Status updates
- •Deadline reminders
- •Health checks
Execution Context
Where and how cron jobs run
Agent-specific
Jobs tied to specific agents
System-wide
Global OpenClaw tasks
Skill-based
Jobs within specific skills
Workspace-level
Workspace maintenance tasks
Quick Setup Guide
Get your first cron job running in minutes
Enable Cron Service
5 minutesActivate the OpenClaw cron scheduler
Commands:
openclaw cron status openclaw cron enable openclaw cron start
Verification:
- ✓ Service shows as 'running'
- ✓ No error messages in logs
- ✓ Cron daemon process active
Create Your First Cron Job
10 minutesSet up a basic scheduled task
Examples:
Daily Status Report
Generate daily status report at 9 AM
Hourly Health Check
Check system health every hour
Configure Job Parameters
15 minutesSet advanced job configuration
Configuration (cron-jobs.json):
{
"jobs": [
{
"name": "daily-summary",
"schedule": "0 9 * * *",
"agent": "main-agent",
"action": "generate-summary",
"parameters": {
"timeframe": "24h",
"format": "markdown"
},
"retry": {
"attempts": 3,
"delay": "5m"
},
"notifications": {
"success": true,
"failure": true
}
}
]
}Practical Automation Examples
Real-world cron job examples you can implement today
Business Automation
Automate common business tasks
Daily Sales Report
0 8 * * 1-5Generate and send daily sales reports to team
Workflow Steps:
- 1.Collect sales data from CRM
- 2.Generate report with charts
- 3.Send via email to stakeholders
- 4.Update dashboard
Configuration:
{
"name": "daily-sales-report",
"schedule": "0 8 * * 1-5",
"actions": [
{
"type": "crm-query",
"timeframe": "yesterday"
},
{
"type": "generate-report",
"template": "sales-summary",
"format": "pdf"
},
{
"type": "email-send",
"recipients": ["team@company.com"],
"subject": "Daily Sales Report - {{date}}"
}
]
}Weekly Backup
0 2 * * 0Create weekly system backups
Workflow Steps:
- 1.Backup database
- 2.Archive important files
- 3.Upload to cloud storage
- 4.Verify backup integrity
Configuration:
{
"name": "weekly-backup",
"schedule": "0 2 * * 0",
"actions": [
{
"type": "backup-database",
"retention": "4weeks"
},
{
"type": "archive-files",
"paths": ["/data", "/configs"]
},
{
"type": "cloud-upload",
"service": "s3",
"verify": true
}
]
}Content Automation
Automate content creation and publishing
Social Media Scheduler
0 10,14,18 * * *Post content to social media platforms
Workflow Steps:
- 1.Generate engaging content
- 2.Add relevant hashtags
- 3.Post to multiple platforms
- 4.Track engagement metrics
Configuration:
{
"name": "social-media-post",
"schedule": "0 10,14,18 * * *",
"actions": [
{
"type": "content-generate",
"topic": "daily-tip",
"length": "short"
},
{
"type": "hashtag-suggest",
"count": 3
},
{
"type": "social-post",
"platforms": ["twitter", "linkedin"]
}
]
}Blog Content Pipeline
0 9 * * 1Research and draft weekly blog posts
Workflow Steps:
- 1.Research trending topics
- 2.Generate content outline
- 3.Draft blog post
- 4.Schedule for review
Configuration:
{
"name": "blog-pipeline",
"schedule": "0 9 * * 1",
"actions": [
{
"type": "trend-research",
"sources": ["google-trends", "industry-news"]
},
{
"type": "content-outline",
"length": "1500-words"
},
{
"type": "draft-article",
"save-to": "drafts/"
}
]
}Monitoring & Alerts
Automated system monitoring and notifications
Website Health Monitor
*/5 * * * *Monitor website uptime and performance
Workflow Steps:
- 1.Check website availability
- 2.Test response times
- 3.Monitor SSL certificates
- 4.Alert on issues
Configuration:
{
"name": "website-monitor",
"schedule": "*/5 * * * *",
"actions": [
{
"type": "http-check",
"urls": ["https://example.com", "https://api.example.com"],
"timeout": "10s"
},
{
"type": "ssl-check",
"alert-days": 30
},
{
"type": "alert-if-down",
"notification": "slack"
}
]
}System Resource Monitor
*/10 * * * *Monitor CPU, memory, and disk usage
Workflow Steps:
- 1.Check system resources
- 2.Log performance metrics
- 3.Alert on thresholds
- 4.Generate usage reports
Configuration:
{
"name": "resource-monitor",
"schedule": "*/10 * * * *",
"actions": [
{
"type": "system-check",
"metrics": ["cpu", "memory", "disk"]
},
{
"type": "threshold-alert",
"cpu": 80,
"memory": 85,
"disk": 90
},
{
"type": "log-metrics",
"retention": "30d"
}
]
}Advanced Features
Powerful features for sophisticated automation workflows
Conditional Execution
Run jobs based on conditions
Weather-based
Configuration:
{
"condition": {
"type": "weather",
"operator": "equals",
"value": "sunny"
},
"action": "send-outdoor-event-reminder"
}Use Case:
Send outdoor event reminders only when sunny
File existence
Configuration:
{
"condition": {
"type": "file-exists",
"path": "/data/new-orders.csv"
},
"action": "process-orders"
}Use Case:
Process orders only when new file exists
Job Dependencies
Chain jobs with dependencies
Data Pipeline
Configuration:
{
"jobs": [
{
"name": "extract-data",
"schedule": "0 1 * * *",
"next": ["transform-data"]
},
{
"name": "transform-data",
"depends-on": ["extract-data"],
"next": ["load-data"]
},
{
"name": "load-data",
"depends-on": ["transform-data"]
}
]
}Use Case:
Run data pipeline jobs in sequence
Dynamic Scheduling
Adjust schedules based on conditions
Business Hours Adaptation
Configuration:
{
"dynamic-schedule": {
"base": "0 9 * * *",
"adjustments": [
{
"condition": "holiday",
"action": "skip"
},
{
"condition": "weekend",
"schedule": "0 10 * * *"
}
]
}
}Use Case:
Adjust schedules for holidays and weekends
Error Handling
Manage job failures gracefully
Retry Logic
{
"retry": {
"attempts": 3,
"delay": "exponential",
"backoff": "2x"
}
}Retry failed jobs with exponential backoff
Fallback Actions
{
"on-failure": {
"action": "fallback-notify",
"parameters": {
"method": "email",
"priority": "high"
}
}
}Execute fallback action on job failure
Management Commands
Essential commands for managing your cron jobs
Job Management
openclaw cron list
List all scheduled jobs
Output:
Job names, schedules, and status
openclaw cron add "schedule" "action"
Add new cron job
Example:
openclaw cron remove job-name
Remove specific job
Example:
openclaw cron enable job-name
Enable disabled job
Example:
openclaw cron disable job-name
Temporarily disable job
Example:
Job Monitoring
openclaw cron status
Show cron service status
Output:
Service state and job count
openclaw cron logs job-name
View job execution logs
Example:
openclaw cron history
Show job execution history
Output:
Recent executions with timestamps
openclaw cron next
Show next scheduled executions
Output:
Upcoming jobs and run times
Testing & Debugging
openclaw cron run job-name
Manually execute job
Example:
openclaw cron validate schedule
Validate cron expression
Example:
openclaw cron test job-name
Test job without execution
Output:
Validation results and next run time
Troubleshooting
Common issues and how to resolve them
Jobs Not Running
Symptoms:
- •No execution logs
- •Jobs show as scheduled but don't run
- •Cron service appears active
Solutions:
- ✓Check cron service status: openclaw cron status
- ✓Verify job syntax: openclaw cron validate
- ✓Review system time and timezone
- ✓Check for permission issues
- ✓Examine cron daemon logs
Jobs Failing Silently
Symptoms:
- •Jobs appear to run but produce no output
- •No error messages in logs
- •Expected actions don't occur
Solutions:
- ✓Add verbose logging to job actions
- ✓Check agent availability and status
- ✓Verify required resources are available
- ✓Test job manually: openclaw cron run job-name
- ✓Review job configuration for errors
Performance Issues
Symptoms:
- •Jobs running slower than expected
- •System resource exhaustion
- •Jobs overlapping or conflicting
Solutions:
- ✓Stagger job schedules to avoid conflicts
- ✓Optimize job resource usage
- ✓Implement job queuing for heavy tasks
- ✓Monitor system resources during execution
- ✓Consider splitting complex jobs
Need Help with
Complex Automation?
Get expert help designing and implementing sophisticated automation workflows for your business.
- ✓Custom automation design
- ✓Performance optimization
- ✓Error handling strategies
Automation Consulting
Design powerful automated workflows