schedule/README.md
egregore 6499e17390 Add README documentation
Documents service purpose, endpoints, cron format, and configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:58:25 +00:00

56 lines
1.2 KiB
Markdown

# Schedule Service
Task scheduler for Egregore.
## Purpose
Cron-like scheduler that triggers AI tasks on a schedule. Wakes the reason service at configured times to perform automated work.
## Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/schedules` | GET/POST | List or create schedules |
| `/schedules/{id}` | GET/PATCH/DELETE | Manage a schedule |
| `/schedules/{id}/run` | POST | Manually trigger a schedule |
| `/schedules/{id}/history` | GET | View execution history |
| `/health` | GET | Health check |
## Configuration
Schedules stored in `~/data/schedules/`.
Each schedule has:
- `name` - Descriptive name
- `cron` - Cron expression (e.g., `0 9 * * *`)
- `instruction` - What to tell the reason service
- `enabled` - Active flag
## Running
```bash
# Activate venv
source ~/.venv/bin/activate
# Run directly
python main.py
# Or via systemd
sudo systemctl start schedule
sudo systemctl status schedule
```
## Cron Format
Standard 5-field cron: `minute hour day month weekday`
Examples:
- `0 9 * * *` - Daily at 9am
- `*/15 * * * *` - Every 15 minutes
- `0 0 * * 0` - Weekly on Sunday midnight
## Dependencies
- FastAPI
- APScheduler (cron scheduling)
- httpx (to call reason service)