Skip to content

How to Set Up OpenClaw Cron Automation for Daily Tasks: Complete Guide

I wanted my AI agents to work while I slept. Every morning, I’d log in to check overnight activity, see what tasks had completed, and review the results. But that meant I still had to be involved every single day.

What I really wanted was for my agents to run automatically, do the work, and deliver the results to me without me touching anything.

That’s when I discovered OpenClaw’s cron automation system.

The Problem: My Agents Were Passive

When I first started with OpenClaw, I treated it like a chat interface. I’d send a prompt, get a response, send another prompt. The agent was reactive—waiting for me to initiate everything.

This worked fine for one-off tasks. But I had recurring needs:

  • Daily digest of new issues in my GitHub repositories
  • Weekly summary of competitor updates
  • Morning check of my server logs for anomalies
  • Regular backups of important workspace files

Each of these required me to remember the task, open OpenClaw, type the prompt, and wait for results. That’s not automation. That’s just a fancy to-do list.

I needed something that would:

  1. Run on a schedule without my involvement
  2. Use the right agent for each task
  3. Deliver results to me automatically
  4. Let me monitor what’s happening

My First Attempt: Manual Scheduling

I tried using external tools to trigger OpenClaw:

attempt-with-crontab.sh
# Added to my system crontab
0 9 * * * curl -X POST http://localhost:18789/api/agent/run -d '{"agent": "daily-summary", "prompt": "Check GitHub issues"}'

This sort of worked, but it had problems:

  • I had to manage cron jobs outside OpenClaw
  • No visibility into task status inside OpenClaw
  • Results went to logs, not to me
  • No easy way to pause or modify tasks

Then I found out OpenClaw has a built-in cron system.

The Solution: OpenClaw’s Native Cron

OpenClaw’s cron system turns an agent from a chatbot into a worker. The key command is openclaw cron add:

basic-cron-add.sh
openclaw cron add \
--schedule '[cron-expression]' \
--agent [agent-name] \
--prompt '[task-instruction]' \
--announce

Let me break down each part.

Understanding the Components

The Schedule: Cron Expressions

The --schedule parameter accepts standard cron expressions:

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday = 0)
│ │ │ │ │
* * * * *

Common patterns I use:

schedule-examples.sh
# Every day at 9:00 AM
--schedule '0 9 * * *'
# Every Monday at 8:00 AM
--schedule '0 8 * * 1'
# Every hour
--schedule '0 * * * *'
# Every 6 hours
--schedule '0 */6 * * *'
# First day of every month at midnight
--schedule '0 0 1 * *'

The Agent: Choosing the Right One

The --agent parameter specifies which agent configuration to use. I created specialized agents for different tasks:

agents/daily-digest.yaml
name: daily-digest
model: haiku-3.5 # Low tier for grunt work
tools:
- github-search
- web-fetch
- file-write
prompt_template: |
You are a daily digest generator.
Check the configured repositories and summarize:
- New issues opened
- PRs merged
- Notable discussions
agents/competitor-watch.yaml
name: competitor-watch
model: sonnet-4.5 # Higher tier for analysis
tools:
- web-search
- web-fetch
- file-write
prompt_template: |
You are a competitive intelligence agent.
Monitor competitor websites and report significant changes.

The key insight from Reddit discussions: use different model tiers for different tasks. Low tier models (haiku) for grunt work, high tier (sonnet, opus) for planning and thinking.

The Prompt: What to Do

The --prompt parameter contains the actual instruction. You can reference files or previous context:

prompt-examples.sh
# Simple instruction
--prompt 'Check my top 5 GitHub repos for new issues opened in the last 24 hours and summarize them.'
# With file reference
--prompt 'Read @workspace/daily-checklist.md and execute each item, reporting results.'
# With context
--prompt 'Based on our previous conversation about monitoring server logs, check for ERROR entries in the last 24 hours.'

Delivery Options: --announce vs --no-deliver

This is where it gets useful:

delivery-options.sh
# --announce: Sends results to your configured channel
# The agent wakes up, does the task, sends the result to the channel
--announce
# --no-deliver: Runs silently, no notification
# Useful for maintenance tasks where you only want alerts on failure
--no-deliver

From a Reddit discussion:

“Every morning at 9:00 the agent wakes up, does the task, sends the result to the channel. Without you touching anything.”

This is exactly what I wanted.

My First Working Setup

I started with a simple daily GitHub digest:

setup-daily-digest.sh
openclaw cron add \
--schedule '0 9 * * *' \
--agent daily-digest \
--prompt 'Check these repos for new issues in the last 24 hours: openclaw/openclaw, openclaw/docs, myorg/internal-tools. Create a summary grouped by repo with priority levels.' \
--announce

The next morning at 9:00 AM, I got a message in my configured channel:

📅 Daily GitHub Digest - March 11, 2026
## openclaw/openclaw
- [P1] #234: Agent crashes on large file uploads
- [P2] #231: Add support for custom tool endpoints
## openclaw/docs
- [P3] #89: Update cron documentation
## myorg/internal-tools
- No new issues in the last 24 hours
Total: 3 issues, 1 high priority

It worked. I hadn’t touched anything.

Adding More Automation

Emboldened by success, I added more scheduled tasks:

weekly-competitor-check.sh
# Every Monday at 8 AM
openclaw cron add \
--schedule '0 8 * * 1' \
--agent competitor-watch \
--prompt 'Check competitor sites: competitor1.com/pricing, competitor2.com/features. Compare to our baseline at @workspace/competitor-baseline.md and report any changes.' \
--announce
hourly-health-check.sh
# Every hour
openclaw cron add \
--schedule '0 * * * *' \
--agent health-check \
--prompt 'Ping critical endpoints: api.example.com/health, db.example.com/status. Report any failures.' \
--no-deliver # Silent unless failure
monthly-backup.sh
# First of every month at 2 AM
openclaw cron add \
--schedule '0 2 1 * *' \
--agent backup-agent \
--prompt 'Create backup of workspace/important-docs to backup-location with timestamp.' \
--announce

Now I had a suite of automated workers.

Managing Cron Jobs

OpenClaw provides commands to manage your scheduled tasks:

cron-management.sh
# List all cron jobs
openclaw cron list
# Show details of a specific job
openclaw cron show [job-id]
# Pause a job temporarily
openclaw cron pause [job-id]
# Resume a paused job
openclaw cron resume [job-id]
# Remove a job permanently
openclaw cron remove [job-id]
# Run a job immediately (for testing)
openclaw cron run [job-id]

Here’s what cron list shows:

ID Schedule Agent Last Run Status
───────────────────────────────────────────────────────────────────
cron-001 0 9 * * * daily-digest 2026-03-11 09:00 active
cron-002 0 8 * * 1 competitor-watch 2026-03-10 08:00 active
cron-003 0 * * * * health-check 2026-03-11 10:00 active
cron-004 0 2 1 * * backup-agent never active

Integration with Heartbeat

OpenClaw’s cron system integrates with heartbeat monitoring for reliability:

┌─────────────────────────────────────────────────────────────────┐
│ Cron + Heartbeat Flow │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Cron │────►│ Agent │────►│ Task │ │
│ │Schedule │ │Execute │ │Complete │ │
│ └─────────┘ └─────────┘ └────┬────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Heartbeat │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Success │ │ Failure │ │ Timeout │ │ │
│ │ │ Log │ │ Alert │ │ Retry │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Delivery Channel │ │
│ │ --announce sends results here │ │
│ └─────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Heartbeat monitoring means:

  • Automatic logging of every cron execution
  • Alerts on failures or timeouts
  • Retry logic for transient failures
  • Historical tracking of task success rates

Model Selection Strategy

One mistake I made early on was using powerful models for everything. I had scheduled tasks using Opus for simple checks.

That’s wasteful. Here’s my current approach:

model-tier-strategy.yaml
# Tier 1: Simple, repetitive tasks
routine-checks:
model: haiku-3.5
tasks:
- health checks
- log scanning
- data formatting
- simple lookups
cost: ~$0.25 per 1M tokens
# Tier 2: Moderate complexity
analysis:
model: sonnet-4.5
tasks:
- summarization
- competitive analysis
- report generation
cost: ~$3 per 1M tokens
# Tier 3: Complex reasoning
strategic:
model: opus-4.5
tasks:
- architectural decisions
- complex debugging
- multi-step planning
cost: ~$15 per 1M tokens

My daily digest uses haiku. My competitor analysis uses sonnet. Opus is reserved for tasks that need deep thinking.

Testing Your Cron Jobs

Before relying on a scheduled job, test it:

test-cron-job.sh
# Run immediately without scheduling
openclaw cron run [job-id]
# Or test the agent directly first
openclaw agent run daily-digest \
--prompt 'Check these repos: openclaw/openclaw. Summarize issues.'

I always test with cron run before letting a job run on schedule. This catches:

  • Wrong schedule syntax (I’ve used * 9 * * * instead of 0 9 * * *)
  • Missing agent configuration
  • Permission issues with tools
  • Prompt errors

Common Mistakes I Made

Mistake 1: Wrong Cron Syntax

wrong-cron-syntax.sh
# WRONG: This runs EVERY MINUTE during hour 9
--schedule '* 9 * * *'
# CORRECT: This runs ONCE at 9:00 AM
--schedule '0 9 * * *'

The first version ran my job 60 times in one hour. I got 60 identical reports.

Mistake 2: Forgetting --announce

no-announce.sh
# I ran this and wondered why nothing appeared
openclaw cron add \
--schedule '0 9 * * *' \
--agent daily-digest \
--prompt 'Check repos...'
# Without --announce, results go to logs only
# Add --announce to receive results

Mistake 3: Over-Scheduling

over-scheduling.sh
# TOO FREQUENT for expensive operations
--schedule '*/5 * * * *' # Every 5 minutes
--prompt 'Analyze all competitor websites...'
# BETTER: Match frequency to task cost
--schedule '0 9 * * *' # Daily for heavy analysis

Running a web scraping analysis every 5 minutes burned through my API budget in hours.

Mistake 4: Not Handling Failures

Scheduled tasks fail. Network issues happen. Services go down.

failure-handling.yaml
# Add retry logic in your agent configuration
retry:
max_attempts: 3
backoff: exponential
on_failure: alert # Send notification on persistent failure

My Current Automation Stack

Here’s what I have running now:

ScheduleAgentTaskModelDelivery
0 9 * * *daily-digestGitHub issues summaryhaikuannounce
0 8 * * 1competitor-watchCompetitor monitoringsonnetannounce
0 * * * *health-checkEndpoint monitoringhaikuno-deliver
0 2 1 * *backup-agentMonthly backuphaikuannounce
30 17 * * 5weekly-reviewTeam activity reportsonnetannounce

This runs completely hands-off. I just review the announcements that come in.

Quick Reference

cron-quick-reference.sh
# Add a new scheduled task
openclaw cron add \
--schedule '0 9 * * *' \
--agent my-agent \
--prompt 'My instruction here' \
--announce
# List all cron jobs
openclaw cron list
# Test a job immediately
openclaw cron run [job-id]
# Pause/resume jobs
openclaw cron pause [job-id]
openclaw cron resume [job-id]
# Remove a job
openclaw cron remove [job-id]
# Common schedules
# '0 9 * * *' - Daily at 9:00 AM
# '0 9 * * 1' - Every Monday at 9:00 AM
# '0 */6 * * *' - Every 6 hours
# '0 0 1 * *' - Monthly on the 1st

The Bottom Line

Cron is what turns an agent from a chatbot into a worker. Without it, you’re stuck initiating every interaction. With it, your agents work on your schedule, not theirs.

The key points:

  1. Use standard cron expressions for scheduling
  2. Choose appropriate model tiers—haiku for simple tasks, sonnet for analysis
  3. Add --announce to receive results automatically
  4. Test with cron run before relying on schedules
  5. Handle failures gracefully with retry logic

My morning routine used to include logging in to check overnight activity. Now I just review the announcements that arrive automatically at 9:00 AM. The agents did the work while I slept.

That’s the power of automation.


Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments