Course: OpenClaw — Autonomous AI Agents | Pathway: Builder | Tier: Free | Level: Beginner Estimated Reading Time: 10 minutes
Up to now, your agent responds when someone talks to it. That is useful, but it is still reactive — it waits for input.
Cron jobs change that. A cron job is a task that runs automatically on a schedule. With cron jobs, your agent can wake up at a set time, do something useful, and go back to sleep. No human needed.
This is the difference between a chatbot and an autonomous agent. A chatbot answers questions. An autonomous agent does work.
The name "cron" comes from the Greek word for time — chronos. In computing, a cron job is a task that runs on a schedule. The concept has been around since the 1970s.
A cron schedule is written as a short string of numbers and symbols that tells the system when to run the task. Here are some examples:
| Schedule | Meaning |
|---|---|
0 7 * * * | Every day at 7:00am |
0 */2 * * * | Every 2 hours |
30 9 * * 1-5 | 9:30am, Monday to Friday |
0 0 * * 0 | Midnight every Sunday |
*/15 * * * * | Every 15 minutes |
The format is: minute hour day-of-month month day-of-week
You do not need to memorise this. There are free online tools like crontab.guru that let you build cron schedules by clicking buttons.
OpenClaw has a built-in scheduler that reads your cron configuration and triggers agent actions at the specified times.
Each cron job consists of three things:
That third part is important. When a cron job fires, OpenClaw sends the agent a message — just like a human would. The agent reads the message, uses its SOUL.md and tools to figure out what to do, and does it.
Open the cron configuration file:
nano ~/openclaw/config/cron.yaml
Add a simple job:
cron_jobs:
- name: morning-greeting
schedule: "0 7 * * *"
agent: helper
prompt: >
Good morning. Please send me a brief, friendly message on Telegram
with today's date and a motivational thought to start the day.
channel: telegram
enabled: true
This tells OpenClaw: every morning at 7am, send the Helper agent a prompt, and have it respond on Telegram.
Restart OpenClaw for the change to take effect:
npm start
Tomorrow morning at 7am, your agent will send you a message on Telegram. You did not have to do anything — it just happened.
A morning greeting is a nice demo, but the real value comes from practical automation. Here are some examples of what you can do.
- name: email-summary
schedule: "0 8 * * 1-5"
agent: helper
prompt: >
Check the email inbox and create a summary of all new emails
received since yesterday. Categorise them as urgent, follow-up,
or informational. Send the summary on Telegram.
channel: telegram
enabled: true
This requires your agent to have access to an email tool, which is an additional setup step we will not cover in detail here. But the pattern is the same: schedule, agent, prompt.
- name: daily-post
schedule: "0 10 * * 1-5"
agent: social
prompt: >
Review the content calendar and post today's scheduled content
to LinkedIn. Follow the brand voice guidelines in your SOUL.md.
channel: internal
enabled: true
- name: health-check
schedule: "*/30 * * * *"
agent: monitor
prompt: >
Check the status of the following services: website, database,
API. If anything is down or responding slowly, send an alert
on Telegram immediately.
channel: telegram
enabled: true
- name: weekly-report
schedule: "0 17 * * 5"
agent: helper
prompt: >
Compile a summary of this week's activity. Include any
significant events, completed tasks, and items that need
attention next week. Format it as a clear, scannable report
and send it on Telegram.
channel: telegram
enabled: true
At Lalapanzi.ai, we run about 20 cron jobs across our five agents. Here is a sample:
These cron jobs mean that a lot of routine work happens automatically. The team spends less time on busywork and more time on the things that actually need a human brain.
The prompt in your cron job is everything. A vague prompt gets vague results.
Bad prompt:
Check things and let me know.
Good prompt:
Check the inbox at admin@example.co.nz for new emails received
in the last 24 hours. Ignore newsletters and automated notifications.
For each remaining email, provide: sender, subject, and a one-sentence
summary. If any email looks urgent, flag it at the top of the summary.
Send the complete summary as a single Telegram message.
The good prompt tells the agent exactly what to check, what to ignore, what format to use, and where to send the result. There is no room for ambiguity.
Tips for cron prompts:
A few things to keep in mind about scheduling:
Time zones. OpenClaw uses your system's local time zone by default. If your computer is set to NZST (New Zealand Standard Time), your cron jobs will run on NZST. Check your system time zone if your jobs seem to fire at the wrong time.
Do not overdo it. Running a cron job every minute creates a lot of work for your machine and your AI model. If you are using a cloud model, it also costs money per call. Start with longer intervals and only increase frequency if you genuinely need it.
Stacking. If a cron job takes longer to run than the interval between runs, you can get jobs stacking up. For example, if a job takes 5 minutes but runs every 2 minutes, you will have multiple instances running at once. Keep your intervals realistic.
Model rate limits. If you are using free models through OpenRouter, be aware that they have rate limits. Too many cron jobs hitting the same model can get you temporarily blocked.
You can disable a cron job without deleting it by setting enabled: false:
- name: morning-greeting
schedule: "0 7 * * *"
agent: helper
prompt: "Send a morning greeting on Telegram."
channel: telegram
enabled: false
This is handy when you are testing or troubleshooting. You can turn jobs on and off without losing the configuration.
Your agent can now respond to messages and run tasks on a schedule. In the next lesson, we will look at running AI models locally on your machine using Ollama — no internet required, no API costs, and your data stays with you.
Key Takeaways