Skip to main content
HowOpenClawv2026.4.10

Module 6: Autonomous Tasks

Automate your AI assistant with scheduled tasks and cron jobs. Deploy OpenClaw 24/7 on a $5/month VPS or keep it on your own machine.

0 of 10 modules complete0%
6 min read
What you will learn
  • Schedule automated tasks with cron jobs
  • Deploy OpenClaw to a server for 24/7 operation
  • Monitor your agent's health and logs
  • Set up a self-check system

Why this matters

So far, your agent only does things when you message it. In this module, you make it proactive — running tasks on a schedule and staying online around the clock.

Scheduling tasks with cron

OpenClaw has built-in cron support. You can schedule any prompt to run automatically.

Add a cron job

In your Terminal, schedule a task like this:

openclaw cron add "0 7 * * *" --message "Generate my daily briefing and send it to me"

This runs every day at 7:00 AM. You don't need to understand the scheduling syntax — just copy from the table below and change the time.

Don't know cron syntax? Just use the table

Cron expressions look cryptic but you only need a handful of patterns. The numbers represent: minute, hour, day, month, weekday — in that order. A * means "every". Use the examples below and swap in your preferred time.

Common schedules

WhenUse this expressionExample
Every morning at 7am0 7 * * *Daily briefing
Every morning at 8am0 8 * * *Change 7 to your hour
Weekdays (Mon–Fri) at 9am0 9 * * 1-5Work digest
Every 30 minutes*/30 * * * *Health check
Every Monday at 10am0 10 * * 1Weekly summary
First of each month at 9am0 9 1 * *Monthly report

Watch your API costs

Each cron job makes one or more AI API calls. A job running every 30 minutes = ~1,440 API calls per month. For simple health checks, use a very short prompt ("reply ok only") to keep costs minimal. Check your AI provider's dashboard to monitor usage. The Pricing guide has cost estimates.

Manage cron jobs

# List all scheduled jobs
openclaw cron list

# Remove a job
openclaw cron remove [job-id]

See the CLI Cheatsheet for the full list of openclaw cron flags and options.

Agent Execution & Progress Tracking

When your agent runs automated tasks, it can report its progress with the /exec command.

Understanding execution reporting

As of v2026.4.8, /exec reports now accurately reflect your actual runtime environment. The fallback policy shown depends on where OpenClaw is running:

DeploymentFallback PolicyBehavior
Gateway hostfull/offFull execution available, or disabled
Node deploymentfull/offFull execution available, or disabled
Sandbox environmentdeny/offExecution denied by default, or disabled

If you set host=auto, the policy automatically adapts to your environment. Previously, stricter defaults were displayed even when the actual behavior was more permissive. Now the report is honest about what your agent can do.

Progress tool: keeping update_plan available

For OpenAI-family runs, the agent keeps update_plan available for progress tracking during autonomous tasks. You can now:

  • Set tools.experimental.planTool=true to enable progress reporting (default)
  • Set tools.experimental.planTool=false to opt out and use simpler compact payloads

This gives you fine-grained control over whether the agent tracks detailed progress or sends minimal status updates.

Example: disable detailed planning for cost-sensitive automations

{
  "tools": {
    "experimental": {
      "planTool": false
    }
  }
}

Deployment: Keeping your agent online

Your agent currently runs on your computer. If your laptop sleeps or shuts down, the agent stops.

Choosing your deployment option

Before setting up 24/7 operation, pick the approach that fits your situation:

OptionBest forSetup effort
Keep on your machineAutomations only when you're at your deskNone — already works
Prevent sleepMore reliable, still on your machine2 minutes
Deploy to a VPSTrue 24/7 reliability, runs while you sleep20–30 minutes

If you just want to test automations, they already work — your machine is the server. Only set up a VPS if you need guaranteed uptime.

Option 1 — Keep on your machine (works now)

Your cron jobs already run whenever the Gateway is running. If you're happy with automations firing only while your computer is on and awake, you're done with this section.

Option 2 — Prevent your machine from sleeping

On macOS, prevent sleep while OpenClaw is running:

caffeinate -d &

On Windows: Settings → System → Power → Screen and sleep → set "When plugged in, put my device to sleep after" to Never.

This gives you near-24/7 operation without any server setup, as long as your machine stays powered on.

Option 3 — Deploy to a VPS (most reliable)

A small cloud server costs $5-6/month and runs 24/7.

Get a server

DigitalOcean, Hetzner, or Vultr all have $5-6/month plans. Choose Ubuntu 22.04+, 1 vCPU, 1 GB RAM minimum (2 GB recommended).

Connect to your server

Your provider will give you an IP address and root password (or SSH key):

ssh root@YOUR_SERVER_IP

Install Node.js 24

Copy and paste these two commands one at a time:

curl -fsSL https://deb.nodesource.com/setup_24.x | bash -

(curl downloads a setup script from the internet. The | pipes it directly into bash which runs it. This is the standard way to install Node.js on Linux servers — it's safe.)

apt-get install -y nodejs

(apt-get is the Linux package manager — like an app store for the Terminal.)

Install OpenClaw

npm install -g openclaw@latest

Run the setup wizard

Same as Module 0 — pick your provider, enter your API key, choose model:

openclaw onboard --install-daemon

(Optional) Copy your SOUL.md and USER.md

If you want to copy your existing personality files from your local machine to the server, open a new Terminal window on your local computer (not the server) and run:

scp ~/.openclaw/SOUL.md root@YOUR_SERVER_IP:~/.openclaw/
scp ~/.openclaw/USER.md root@YOUR_SERVER_IP:~/.openclaw/

(scp stands for "secure copy" — it copies a file from one machine to another over SSH.)

Verify it's running

Back in the server Terminal:

openclaw gateway status

The daemon registers as a system service automatically — it starts on boot and restarts on failure.

Home server (no monthly cost)

If you have a Raspberry Pi, old laptop, or NAS, you can run OpenClaw on it. Same setup as VPS, but the machine stays in your home. Your data never leaves your network.

Syncing configuration

When you update your SOUL.md or config locally and want to push changes to your server, run this from your local Terminal:

rsync -avz ~/.openclaw/ root@YOUR_SERVER_IP:~/.openclaw/ --exclude workspace/

rsync copies only the changed files — it is much faster than copying everything. The --exclude workspace/ skips your local files so they don't overwrite the server's memory.

Then restart the gateway on the server:

ssh root@YOUR_SERVER_IP "openclaw gateway restart"

Monitoring

Check status

openclaw gateway status
openclaw cron list

View logs

openclaw logs --tail 50

Automated health check

Add a self-check cron job that pings your agent every 30 minutes and only alerts you if something is wrong. In your Terminal:

openclaw cron add "*/30 * * * *" --message "Self-check: confirm you are running and responding. Reply with 'ok' only." --suppress-if-ok

--suppress-if-ok means: only send the result to your channel if the agent fails to respond. If everything is fine, you hear nothing. If it breaks, you get a message.

This checks every 30 minutes. Since it's a short prompt with a short reply, the API cost is negligible.

Health endpoint

The Gateway exposes a health endpoint you can monitor externally:

curl http://localhost:18789/health

Security for deployed agents

When your agent runs on a server:

  • The Gateway binds to 127.0.0.1:18789 by default (not publicly accessible)
  • Never expose port 18789 directly to the internet
  • Use Tailscale for remote access (see Module 8)
  • Keep your config file permissions restricted: chmod 600 ~/.openclaw/openclaw.json

Finished this module?

Tracks your progress across all 10 modules

FAQ

Does my computer need to stay on for cron jobs to run?
Yes — if your machine sleeps or shuts down, scheduled tasks don't run. For 24/7 reliability, deploy OpenClaw to a VPS (a small cloud server costs about $5/month). Alternatively, use caffeinate on Mac to prevent sleep while keeping the agent on your local machine.
How much do scheduled AI tasks cost in API fees?
It depends on the task complexity. A simple self-check prompt ('reply ok only') costs a fraction of a cent per run. A detailed daily briefing with web searches might cost $0.01–$0.05. A cron job running every 30 minutes with a short prompt costs under $1/month at current API rates.
How do I pause or stop a cron job without deleting it?
Run `openclaw cron list` to find your job's ID, then `openclaw cron remove [job-id]` to stop it. To pause temporarily, you can comment out the cron entry in your config. There's no built-in 'pause' — removing and re-adding is the simplest approach.
What's the cheapest way to keep OpenClaw running 24/7?
A $4–6/month VPS (DigitalOcean, Hetzner, or Vultr) is the most reliable option. Alternatively, a Raspberry Pi or old laptop at home costs nothing monthly after purchase. The VPS option is recommended for beginners since it's simpler to set up and maintain.