Skip to main content
Run agents automatically on a schedule using agentuse serve. Configure schedules in agent frontmatter with cron expressions or intervals.

Quick Start

  1. Add a schedule config to your agent:
---
model: anthropic:claude-sonnet-4-5
schedule: "1h"
---

Check the system status and send a summary report.
  1. Start the server:
agentuse serve
The server displays scheduled agents on startup:
Scheduled (1)
  Agent                  Schedule    Next Run
  monitor.agentuse       0 * * * *   Jan 01, 12:00

Schedule Formats

The schedule field accepts a single string value. The format is auto-detected:

Intervals

Simple duration format for recurring tasks:
schedule: "30m"
Supported units:
UnitExampleMaxDescription
s30s59Seconds
m10m59Minutes
h2h23Hours
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:
PatternDescription
0 * * * *Every hour
*/15 * * * *Every 15 minutes
0 9 * * *Daily at 9am
0 0 * * 0Weekly on Sunday
0 0 1 * *Monthly on the 1st
0 9 * * 1-5Weekdays at 9am
Use crontab.guru to build and validate cron expressions.

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:
agentuse serve --debug

Next Steps