Scheduled Agents
Run agents and workflows on a recurring schedule using cron expressions. Built on BullMQ repeatable jobs with Redis — production-grade, timezone-aware, and zero custom infrastructure.Requires the
@radaros/queue package with bullmq and ioredis peer dependencies.Quick Start
queue.schedule()
Create a recurring schedule for an agent or workflow.
Unique schedule identifier (e.g.
"daily-report").Cron expression (e.g.
"0 9 * * *" for daily at 9am, "*/5 * * * *" for every 5 minutes).IANA timezone (e.g.
"America/New_York", "UTC"). Defaults to the server’s local timezone.Agent to run:
{ name, input, sessionId?, userId? }.Workflow to run:
{ name, initialState? }.agent or workflow, not both.
queue.unschedule(id)
Remove a recurring schedule.
queue.listSchedules()
List all active schedules with their cron pattern, timezone, and next run time.
Examples
Workflow Schedule
Health Check Every 5 Minutes
One-Off Delayed Job
If you need a single delayed execution instead of a recurring schedule, useenqueueAgentRun directly:
REST API
Enable schedule management endpoints by passing yourAgentQueue as the scheduler option in createAgentRouter:
| Method | Endpoint | Description |
|---|---|---|
GET | /schedules | List all active schedules |
POST | /schedules | Create a schedule ({ id, cron, timezone?, agent?, workflow? }) |
DELETE | /schedules/:id | Remove a schedule |
Example: Create via HTTP
Example: List Schedules
Cron Expression Reference
| Expression | Meaning |
|---|---|
* * * * * | Every minute |
*/5 * * * * | Every 5 minutes |
0 * * * * | Every hour |
0 9 * * * | Daily at 9:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
0 0 * * 0 | Weekly on Sunday at midnight |
0 2 * * 1 | Every Monday at 2:00 AM |
0 0 1 * * | First day of every month at midnight |
minute hour day-of-month month day-of-week