Haven't installed OpenClaw yet? Click here for one-line install commands
curl -fsSL https://openclaw.ai/install.sh | bash
iwr -useb https://openclaw.ai/install.ps1 | iex
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Worried about affecting your computer? ClawTank runs in the cloud with no installation, eliminating accidental deletion risks
Key Findings
  • OpenClaw's Cron feature lets you set up time-triggered AI tasks -- no human intervention needed; the agent automatically executes at the specified time and reports results via communication channels[1]
  • Unlike traditional Linux crontab, OpenClaw's Cron tasks are defined in natural language, with the AI agent dynamically deciding execution steps rather than running fixed Shell scripts[6]
  • The biggest pitfall of Cron tasks is the Gateway Timeout -- if a task's execution time exceeds the Gateway's connection timeout setting, the task will be forcibly terminated[2]
  • Combined with Telegram and other communication channels, Cron task results are pushed to your phone in real-time, achieving a "set it once, benefit long-term" automation workflow[3]

I. What Is OpenClaw's Cron?

If you're familiar with Linux's crontab, OpenClaw's Cron is conceptually similar -- it automatically executes tasks at specified times.[6] But the key difference is: traditional crontab executes fixed Shell commands, while OpenClaw's Cron executes natural language instructions, with the AI agent autonomously deciding how to complete them.

For example:

The latter doesn't require you to write scripts in advance -- the agent will decide which check commands to execute, how to organize the results, and how to format the report on its own.[5]

II. Creating Your First Cron Task

2.1 Basic Syntax

Create a Cron task via CLI:[1]

openclaw cron add --schedule "0 9 * * *" --message "Check the server's CPU and memory usage. If any metric exceeds 80%, summarize the abnormal items in a report"

The scheduling syntax follows the standard cron format: minute hour day month weekday.

2.2 Common Schedule Examples

ScheduleSyntaxDescription
Every day at 9 AM0 9 * * *Daily reports, checks
Every hour on the hour0 * * * *High-frequency monitoring
Every Monday at 8 AM0 8 * * 1Weekly reports
1st of every month at noon0 12 1 * *Monthly reports
Every 30 minutes*/30 * * * *Intensive monitoring

2.3 Managing Existing Tasks

# List all Cron tasks
openclaw cron list

# Delete a specific task
openclaw cron rm TASK_ID

# Pause (retain settings but don't trigger)
openclaw cron disable TASK_ID

# Resume
openclaw cron enable TASK_ID

III. Combining with Telegram for Real-Time Notifications

Cron task execution results are sent to your configured communication channels by default. If you've already completed Telegram integration, results will be pushed directly to your Telegram conversation.[3]

3.1 Typical Scenario: Daily News Briefing

openclaw cron add \
  --schedule "0 8 * * *" \
  --message "Search for major AI-related news from the past 24 hours and compile a summary of 5 items, each no more than 50 words"

Every morning at 8 AM, your Telegram receives an AI industry daily briefing.

3.2 Typical Scenario: Website Availability Monitoring

openclaw cron add \
  --schedule "*/30 * * * *" \
  --message "Check if https://example.com is running normally. If response time exceeds 3 seconds or the status code is not 200, notify me immediately"

Automatic check every 30 minutes, notifying you only when anomalies occur -- no flood of useless "everything is fine" messages.

IV. Gateway Timeout: The Most Common Pitfall

This is the most frequently encountered trap with Cron tasks.[2]

4.1 Problem Description

The Gateway has a connection timeout setting (timeoutSeconds). If a Cron task's execution time exceeds this value, the Gateway will forcibly terminate the connection, causing the task to be truncated -- the agent may have completed 80% of the work, but cannot return results due to the timeout.

4.2 Solution

# Check current Timeout setting
openclaw config get agents.defaults.timeoutSeconds

# Adjust based on the expected execution time of your longest task (in seconds)
openclaw config set agents.defaults.timeoutSeconds 900

Rule of thumb: Set the Timeout to 1.5x the expected execution time of your longest task. For example, if a report task typically takes 5 minutes, set the Timeout to 450 seconds (7.5 minutes).

4.3 Alternatives for Long Tasks

For tasks that may run longer than 15 minutes, it's recommended to break them into multiple shorter tasks:

# Instead of doing everything at once
X "Analyze all sales data from the past year and generate a complete report"

# Break it down into multiple steps
V "Download the past year's sales data and save as CSV"  -> Cron 1
V "Analyze the CSV generated yesterday and produce a summary report"    -> Cron 2 (delayed 10 minutes)

V. Error Handling and Recovery

5.1 Behavior on Task Failure

When a Cron task fails (e.g., target server is offline, API returns an error), the agent will:

  1. Notify you via the communication channel about the reason for failure
  2. Log the error to Gateway logs (viewable via openclaw logs --follow)
  3. Re-trigger normally at the next scheduled time

Cron tasks do not stop because of a single failure -- they continue to attempt according to the schedule.

5.2 Avoiding Task Overlap

If a previous execution has not yet completed, the Gateway will skip the new scheduled trigger to avoid the same task being executed repeatedly. This behavior is automatically managed by the Gateway's task queue.[2]

VI. Best Practices

  1. Test manually first, then set up Cron: Manually execute the task command once in the CLI, confirm the agent's behavior meets expectations, then convert the same command to Cron
  2. Be specific with instructions: "Check server status" is too vague; "Check CPU, memory, and disk usage; report if any exceeds 80%" is better
  3. Set reasonable frequencies: Each Cron trigger consumes LLM Tokens. Triggering every minute can generate significant API costs
  4. Use conditional notifications: Add "only notify me when anomalies occur" to instructions to avoid being flooded with "everything is normal" messages
  5. Monitor Gateway stability: Cron depends on the Gateway running continuously. Use systemd or Docker to ensure the Gateway auto-restarts after crashes

Conclusion

Cron is the key feature that transforms OpenClaw from a "passive tool" into a "proactive assistant."[1] Once configured, the agent automatically executes tasks and reports results at your specified times -- you don't need to remember what to check, don't need to open a terminal, and don't need to be at the computer.

To start using Cron, first ensure you've completed OpenClaw's basic deployment and configured at least one communication channel. If you encounter issues with Cron tasks, the "Troubleshooting Guide" can help you quickly identify the cause.