> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentuse.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduled Agents

> Run agents on a recurring schedule using cron expressions or intervals

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:

```yaml theme={"system"}
---
model: anthropic:claude-sonnet-5
schedule: "1h"
---

Check the system status and send a summary report.
```

2. Start the server:

```bash theme={"system"}
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:

```yaml theme={"system"}
schedule: "30m"
```

Supported units:

| Unit | Example | Max | Description |
| ---- | ------- | --- | ----------- |
| `s`  | `30s`   | 59  | Seconds     |
| `m`  | `10m`   | 59  | Minutes     |
| `h`  | `2h`    | 23  | Hours       |

<Note>
  For daily or longer schedules, use cron expressions.
</Note>

### Cron Expressions

Standard cron syntax for precise control:

```yaml theme={"system"}
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    |

<Tip>
  Use [crontab.guru](https://crontab.guru) to build and validate cron expressions.
</Tip>

## Example

A scheduled agent for daily reports:

```yaml theme={"system"}
---
model: anthropic:claude-sonnet-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.
```

<Tip>
  Use cheaper models like `openrouter:minimax/minimax-m3` for frequent, straightforward tasks (health checks, simple monitoring). Reserve `claude-sonnet-4-6` and `claude-opus-4-8` for complex creative tasks.
</Tip>

## Server Options

See [CLI Commands - agentuse serve](/reference/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:

```bash theme={"system"}
agentuse serve --debug
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Webhooks" icon="webhook" href="/guides/webhooks">
    Trigger agents via HTTP
  </Card>

  <Card title="Self-Hosting" icon="server" href="/guides/self-hosting">
    Deploy in production
  </Card>
</CardGroup>
