Run agents automatically on a schedule using agentuse serve. Configure schedules in agent frontmatter with cron expressions or intervals.
Quick Start
- Add a
schedule config to your agent:
---
model: anthropic:claude-sonnet-4-5
schedule: "1h"
---
Check the system status and send a summary report.
- Start the server:
The server displays scheduled agents on startup:
Scheduled (1)
Agent Schedule Next Run
monitor.agentuse 0 * * * * Jan 01, 12:00
The schedule field accepts a single string value. The format is auto-detected:
Intervals
Simple duration format for recurring tasks:
Supported units:
| Unit | Example | Max | Description |
|---|
s | 30s | 59 | Seconds |
m | 10m | 59 | Minutes |
h | 2h | 23 | Hours |
For daily or longer schedules, use cron expressions.
Cron Expressions
Standard cron syntax for precise control:
schedule: "0 9 * * 1-5" # Weekdays at 9am
Common patterns:
| Pattern | Description |
|---|
0 * * * * | Every hour |
*/15 * * * * | Every 15 minutes |
0 9 * * * | Daily at 9am |
0 0 * * 0 | Weekly on Sunday |
0 0 1 * * | Monthly on the 1st |
0 9 * * 1-5 | Weekdays at 9am |
Example
A scheduled agent for daily reports:
---
model: anthropic:claude-sonnet-4-5
description: Generate daily analytics report
schedule: "0 8 * * 1-5" # Weekdays at 8am
tools:
filesystem:
- path: ${root}/data
permissions: [read]
bash:
commands:
- "curl *"
---
Generate the daily analytics report and save it to reports/daily.md.
Use cheaper models like openrouter:minimax/minimax-m2.1 for frequent, straightforward tasks (health checks, simple monitoring). Reserve claude-sonnet-4-5 and claude-opus-4-5 for complex creative tasks.
Server Options
See CLI Commands - agentuse serve for all server options including port, host, and authentication configuration.
Monitoring
The server logs each scheduled execution:
[12:00:00] Running scheduled agent: monitor.agentuse
[12:00:05] Completed: monitor.agentuse (5.2s)
Enable debug mode for detailed logs:
Next Steps