Blog

AI Agent Cron Jobs: How to Schedule Automated Tasks for Your AI Assistant

Learn how to schedule automated tasks for your AI agent using cron jobs. Set up daily briefings, monitoring alerts, news digests, and proactive automations with OpenClaw.

12 min read
Feb 16, 2026
Ampere Team

The biggest leap from "chatbot" to "agent" isn't smarter responses — it's autonomous action. An AI agent that only works when you message it is just a chat interface with extra steps. A truly useful agent acts on its own: checking your email, monitoring your servers, posting updates, and alerting you to problems.

OpenClaw makes this possible with two scheduling mechanisms: cron jobs for precise timing and heartbeats for periodic check-ins. This guide covers both, with real examples you can deploy today.

What Are AI Agent Cron Jobs?

In traditional computing, a cron job is a scheduled task that runs at specific times. AI agent cron jobs work the same way, but instead of running a shell script, they trigger your AI agent to perform a task and deliver the result to a messaging channel.

For example, you could schedule your agent to:

  • Check your inbox every morning at 8 AM and summarize unread emails
  • Post a tech news digest to your Discord server every day at noon
  • Run a security audit on your servers every Sunday night
  • Remind you about upcoming calendar events 2 hours before they start

The key difference from regular cron: your agent uses AI reasoning to interpret results, prioritize what matters, and communicate naturally. It doesn't just dump raw data — it summarizes, analyzes, and acts.

Cron Jobs vs Heartbeats: When to Use Each

OpenClaw offers two scheduling paradigms. Choosing the right one depends on your use case:

Cron Jobs

Exact timing. Isolated sessions. Different models per task. Best for: daily briefings, weekly reports, precise reminders, one-shot tasks.

Heartbeats

Periodic check-ins. Batched tasks. Shared context. Best for: email checks, monitoring, calendar reviews, multi-task batches every 30 min.

Use Cron Jobs When:

  • Exact timing matters ("9:00 AM sharp every Monday")
  • The task needs isolation from your main chat session
  • You want a different AI model for the task (e.g., cheaper model for simple checks)
  • Output should go directly to a channel without your main session's involvement

Use Heartbeats When:

  • Multiple checks can batch together (email + calendar + notifications in one turn)
  • Timing can drift slightly (every ~30 minutes is fine)
  • You want to reduce API calls by combining periodic checks
  • Tasks benefit from conversational context

Setting Up Your First Cron Job

Creating a cron job in OpenClaw is straightforward. You can ask your agent directly:

# Ask your agent in chat:
"Schedule a cron job every weekday at 8am UTC
to check Hacker News top stories and send
a summary to this channel"

Your agent creates the cron job automatically. Under the hood, it's stored in OpenClaw's configuration and executed by the gateway daemon. You can also configure cron jobs via the CLI or Ampere dashboard.

Cron Job Anatomy

Each cron job has these components:

  • Schedule — Standard cron expression (e.g., 0 8 * * 1-5 for weekdays at 8 AM)
  • Prompt — The instruction your agent receives when the job fires
  • Target channel — Where the output gets delivered (Discord, WhatsApp, etc.)
  • Model — Optionally specify a different model (cheaper models for simple tasks)

10 Practical Cron Job Examples

Here are battle-tested cron jobs running on OpenClaw agents today:

1. Morning Briefing

Schedule: Every day at 7:30 AM. Task: Check weather, summarize top emails, list today's calendar events, and check server health. Deliver as a single morning digest message.

2. Tech News Digest

Schedule: Weekdays at noon. Task: Search Hacker News and tech blogs for relevant stories. Summarize the top 5 with one-line descriptions and links. Post to a Discord #news channel.

3. Server Health Check

Schedule: Every 6 hours. Task: Check CPU, RAM, disk usage, and service status. Only message you if something looks concerning. Silent otherwise.

4. Weekly Security Audit

Schedule: Sundays at 2 AM. Task: Run the Healthcheck skill for a full security audit. Check for OS updates, open ports, SSH configuration, and firewall rules. Post results to a private channel.

5. Social Media Monitor

Schedule: Every 3 hours. Task: Check for mentions of your brand or keywords on Twitter/X, Reddit, and Hacker News. Alert you to anything worth responding to.

6. Git Repository Summary

Schedule: Weekdays at 5 PM. Task: Summarize today's commits, open PRs, and CI status across your GitHub repositories. Post to your team's Slack or Discord.

7. Database Backup Verification

Schedule: Daily at 3 AM. Task: Verify that database backups completed successfully. Check file sizes and timestamps. Alert if anything is missing or suspiciously small.

8. Content Calendar Reminder

Schedule: Monday and Thursday at 9 AM. Task: Check your content calendar (Notion, spreadsheet, or file). Remind you what content is due this week and suggest topics.

9. Price Monitoring

Schedule: Every hour. Task: Check prices of tracked items (crypto, stocks, products). Only alert when significant changes occur (>5% movement).

10. Meeting Prep

Schedule: 30 minutes before each calendar event. Task: Look up the attendees, pull relevant past conversation notes from memory, and send you a prep briefing on WhatsApp.

Setting Up Heartbeats

Heartbeats are OpenClaw's polling mechanism. Your agent periodically wakes up, checks a list of tasks, and either takes action or goes back to sleep.

Configure heartbeats by editing HEARTBEAT.md in your workspace:

# HEARTBEAT.md — checked every 30 minutes

## Checks
- Check email for anything urgent
- Check calendar for events in next 2 hours
- Check server health (CPU/RAM/disk)
- Review unread Discord mentions

## Rules
- Only message me if something needs attention
- Stay silent (HEARTBEAT_OK) if nothing urgent
- Don't repeat alerts for known issues

The heartbeat system is smart about resource usage. If there's nothing to report, your agent responds with HEARTBEAT_OK and minimal tokens are consumed. It only engages fully when something actually needs attention.

Best Practices for AI Agent Scheduling

  • Start with 2-3 automations — add more as you validate what's useful
  • Use cheaper models for simple tasks — a news digest doesn't need the frontier model
  • Set quiet hours — don't let your agent wake you at 3 AM unless it's truly critical
  • Monitor costs — each cron job fires an API call; keep an eye on token usage
  • Batch heartbeat checks — combine related checks to reduce API calls
  • Make alerts actionable — "Server disk at 85%" is better than "Disk check complete"

Cron Jobs on Ampere

If you're using Ampere.sh for managed hosting, cron jobs are even easier. The Ampere dashboard provides a visual scheduler where you can create, edit, and monitor cron jobs without touching config files. View execution logs, token costs per job, and pause/resume jobs with a click.

Ampere also handles the infrastructure that makes cron jobs reliable: guaranteed execution, retry on failure, and monitoring for stuck jobs. For self-hosted setups, you manage this yourself via the gateway daemon.

Frequently Asked Questions

How much do cron jobs cost in API tokens?
It depends on the task complexity. A simple health check might use 500-1,000 tokens ($0.01). A detailed news digest with web search could use 5,000-10,000 tokens ($0.05-0.10). Monthly costs for 5-10 daily cron jobs typically range from $5-20.
Can cron jobs access the same tools as regular chat?
Yes. Cron jobs have full access to all installed tools and skills — web search, browser, file system, shell, messaging, and everything else. They run as independent agent sessions.
What happens if a cron job fails?
OpenClaw logs the failure and can optionally retry. On Ampere, failed jobs are flagged in the dashboard. You can configure alerts for failed executions.
Can I create cron jobs by chatting with my agent?
Yes! Just tell your agent what you want scheduled and when. It creates the cron job automatically. You can also manage them via the CLI or Ampere dashboard.
Do cron jobs work with all messaging platforms?
Yes. Cron job output can be delivered to any connected channel — Discord, WhatsApp, Telegram, Slack, or any other platform your agent is connected to.

Make Your Agent Work While You Sleep

Cron jobs and heartbeats are what transform your AI agent from a reactive tool into a proactive assistant. Instead of always pulling information, your agent pushes what matters to you — at the right time, on the right channel.

Start with one or two automations. A morning briefing. A server health check. See how it fits your workflow, then expand. Before long, you'll wonder how you ever managed without an agent that works around the clock.

Ready to set up your first automation? Deploy an agent on Ampere and schedule your first cron job in minutes. Or read our guides on AI agent use cases and essential AI agent tools for more inspiration.

Ready to automate your AI agent?

Deploy on Ampere and schedule your first cron job in minutes.

Get Started with Ampere →