Automation

Make your agent do things without you asking. Cron jobs, heartbeats, and scheduled tasks.


Why Automate?

Once your agent is running, you'll notice patterns:

That's where automation comes in.

Cron Jobs

OpenClaw has a built-in cron system. You define schedules in your agent's config, and the agent runs tasks automatically.

Setting Up a Cron Job

openclaw cron add --agent myagent

Or define them in your agent's config file. A cron job needs:

Example: Daily Summary

cron:
  - name: daily-summary
    schedule: "0 9 * * *"  # 9 AM every day
    prompt: "Give me a summary of yesterday's work and today's priorities."

Example: System Health Check

cron:
  - name: health-check
    schedule: "0 */4 * * *"  # Every 4 hours
    prompt: "Check system health. Report any issues."

Heartbeats

Heartbeats are simpler than cron jobs — they're periodic check-ins. If everything is fine, the agent replies HEARTBEAT_OK. If something needs attention, it speaks up.

This is great for monitoring: the agent only bothers you when there's a problem.

Practical Automation Ideas

TaskScheduleDescription
Morning briefing9 AM dailySummary of projects, calendar, priorities
Git backupMidnight dailyCommit and push workspace changes
Server monitoringEvery 4 hoursCheck disk, CPU, services
Content reviewWeekly (Monday)Review draft status, suggest next steps
Memory cleanupWeeklyReview and consolidate memory files

Tips

Further Reading