⏰ Agents in a Box — Masterclass Resource

Automations & Cron Jobs

Schedule any task on a timer. Morning briefings, inbox checks, daily reports, competitor intel — all running on autopilot while you sleep.

Cron Jobs — Your Agent's Scheduler

OpenClaw's cron system is the Gateway's built-in scheduler. It persists jobs, wakes the agent at the right time, and can deliver output to Slack, Discord, Telegram, or any webhook. Each job runs in its own isolated session — separate context, model, and thinking level.

Three Ways to Schedule

📍

at

One-shot. Runs once at a specific time. Perfect for reminders and single future events.

ISO 8601 timestamp
🔁

every

Fixed interval. Repeats at a steady cadence. Human-readable durations.

30m, 1h, 4h, 1d
📅

cron

Standard 5-field cron expression. Full scheduling power with optional timezone.

0 7 * * * (daily 7am)

Managing Cron Jobs

All cron management happens through the OpenClaw CLI. Jobs persist at ~/.openclaw/cron/jobs.json.

# Add a daily morning briefing at 7am EST openclaw cron add --name "Morning Brief" \ --cron "0 7 * * *" \ --tz "America/New_York" \ --session isolated \ --message "Summarize overnight updates" \ --deliver announce \ --channel slack \ --to "channel:C1234567890" # List all active cron jobs openclaw cron list # Manually trigger a job (for testing) openclaw cron run <jobId> # Edit a job's message openclaw cron edit <jobId> --message "Updated prompt" # View run history for a specific job openclaw cron runs --id <jobId> # Remove a job openclaw cron remove <jobId> # Check scheduler health openclaw cron status

Isolated vs. Main Session

I

Isolated Session

Runs a fresh agent turn with no prior conversation context. Each job gets its own clean session. Recommended for most automations — morning briefs, inbox scans, report generation. Runs in session cron:<jobId>.

sessionTarget: "isolated"
M

Main Session

Enqueues a system event into the main session with full conversation history. The agent sees all prior context. Use when the automation needs awareness of ongoing work or conversations.

sessionTarget: "main"

Where Results Go

When a cron job finishes, OpenClaw can deliver the result to any of these channels automatically:

💬Slack
🎮Discord
Telegram
📧Email
🔗Webhook
📸WhatsApp

Smart delivery

The agent replies HEARTBEAT_OK when nothing needs attention — those get suppressed automatically. Only actual alerts get delivered. No noise, just signal.

The Heartbeat System

Beyond cron jobs, OpenClaw has a heartbeat — a periodic agent turn that runs in the main session. Your agent proactively checks on things without being asked.

HEARTBEAT.md

The agent reads this file on every heartbeat cycle. It serves as a checklist of proactive tasks. If empty, the heartbeat is skipped to save API calls.

# Heartbeat checklist - Scan inboxes for urgency - Lightweight daytime check-in if available - Flag blocked tasks with missing details - Check for stale Kanban tasks (>24h in Doing)
30m

Default Interval

Heartbeat fires every 30 minutes by default (1 hour for Anthropic OAuth users). Configurable per-agent via agents.list[].heartbeat.every. Set to "0m" to disable entirely.

🌐

Active Hours

Set activeHours.start and activeHours.end in HH:MM format with an optional timezone. Your agent only wakes during business hours. Omit for 24/7 operation.

5 Automations You Should Set Up

1

Morning Digest

Summarize overnight emails, Slack messages, calendar for today, and any blocked tasks. Delivered to Telegram before you wake up.

cron: 0 7 * * *
2

Midday Prep

Check afternoon calendar, prep meeting briefs, flag any tasks that need attention before EOD.

cron: 0 12 * * 1-5
3

Evening Report

Summarize what got done today, what's still open, what's blocked. Post to Slack and log to ClawBuddy.

cron: 0 18 * * 1-5
4

Competitor Intel

Scan competitor YouTube channels, blogs, and social for new content. Extract trends and post a weekly digest.

cron: 0 9 * * 1
5

Meeting Intelligence Sync

Pull latest meetings from Fathom, extract action items, update the Meeting Intelligence dashboard, flag follow-ups.

every: 4h

Error Handling & Retries

OpenClaw's cron system handles failures gracefully:

Run history is stored at ~/.openclaw/cron/runs/<jobId>.jsonl for full auditability.

Automation Setup Guide

This prompt configures 5 production-ready automations for your OpenClaw agent. Each one runs on a schedule, delivers results to your preferred channel, and logs to ClawBuddy.

automations-setup.md
# OpenClaw Automations Setup ## Prerequisites - OpenClaw installed and running - Gateway configured with at least one delivery channel (Slack, Discord, or Telegram) - ClawBuddy dashboard connected (for logging) ## Automation 1: Morning Digest Run daily at 7am. Summarizes overnight activity. ```bash openclaw cron add --name "Morning Digest" \ --cron "0 7 * * *" \ --tz "America/New_York" \ --session isolated \ --message "Morning briefing. Check: 1) Unread emails (flag urgent). 2) Today's calendar (prep briefs for meetings). 3) Kanban board (any tasks blocked >24h). 4) Overnight agent activity (errors, completions). Format as a clean summary with sections." \ --deliver announce --channel telegram --to "chat:YOUR_CHAT_ID" ``` ## Automation 2: Midday Prep Run at noon on weekdays. Prepares for afternoon. ```bash openclaw cron add --name "Midday Prep" \ --cron "0 12 * * 1-5" \ --tz "America/New_York" \ --session isolated \ --message "Midday check. 1) Afternoon calendar — prep any meeting briefs. 2) Tasks in 'Doing' column — check progress. 3) Any questions pending my answer on ClawBuddy. 4) Quick wins I can close before EOD." \ --deliver announce --channel slack --to "channel:YOUR_CHANNEL" ``` ## Automation 3: Evening Report Run at 6pm on weekdays. Daily wrap-up. ```bash openclaw cron add --name "Evening Report" \ --cron "0 18 * * 1-5" \ --tz "America/New_York" \ --session isolated \ --message "End of day report. Summarize: 1) Tasks completed today. 2) Tasks still in progress. 3) Blockers or items needing input. 4) Tomorrow's priority items. Log this summary to ClawBuddy as an insight." \ --deliver announce --channel telegram --to "chat:YOUR_CHAT_ID" ``` ## Automation 4: Competitor Intel (Weekly) Run Monday at 9am. Weekly competitive scan. ```bash openclaw cron add --name "Competitor Intel" \ --cron "0 9 * * 1" \ --tz "America/New_York" \ --session isolated \ --message "Weekly competitor scan. Check top 5 competitor YouTube channels for new uploads this week. For each new video: title, view count, topic. Identify trending topics. Post summary to ClawBuddy as an insight with insight_type 'alert'." \ --deliver announce --channel slack --to "channel:YOUR_CHANNEL" ``` ## Automation 5: Meeting Sync (Every 4 hours) Syncs meeting data throughout the day. ```bash openclaw cron add --name "Meeting Sync" \ --every "4h" \ --session isolated \ --message "Sync latest meetings. Pull any new meetings from the past 4 hours. Extract: attendees, key decisions, action items, follow-ups needed. Update the Meeting Intelligence dashboard. Flag any meetings where I have unresolved action items." \ --deliver none ``` ## Heartbeat Configuration Add to your OpenClaw config (agents section): ```yaml agents: defaults: heartbeat: every: "30m" activeHours: start: "08:00" end: "20:00" timezone: "America/New_York" delivery: target: "last" ``` Create ~/HEARTBEAT.md: ```markdown # Heartbeat Checklist - Scan inboxes for urgent messages - Check for stale Kanban tasks (>24h in Doing) - Flag any pending questions on ClawBuddy - Verify all automations ran successfully today ``` ## Verification After setup, verify everything is running: ```bash # List all active jobs openclaw cron list # Check scheduler health openclaw cron status # Manually test one openclaw cron run <jobId> ``` ## Delivery Channel Setup Replace YOUR_CHAT_ID and YOUR_CHANNEL with your actual values. For Telegram: Use @BotFather to get your bot token, then get your chat ID. For Slack: Use the channel ID from your Slack workspace (starts with C). For Discord: Use the channel ID from Discord developer mode. For Webhooks: Use --deliver webhook --to "https://your-endpoint.com/hook"

The system that runs itself

Five automations. Morning digest prepares your day. Midday prep keeps you on track. Evening report wraps it up. Competitor intel runs weekly. Meeting sync runs throughout. Your agent works around the clock — you just review the results.

🛠️ Starter vs Production

This prompt creates a V1 scaffold. Production requires wiring real data sources, QA passes, error handling, retry logic, and safety gates. Treat the output as a working prototype — not a ship-ready system.