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
@agentium/queue package with bullmq and ioredis peer dependencies.Quick Start
queue.schedule()
Create a recurring schedule for an agent or workflow.
string
required
Unique schedule identifier (e.g.
"daily-report").string
required
Cron expression (e.g.
"0 9 * * *" for daily at 9am, "*/5 * * * *" for every 5 minutes).string
IANA timezone (e.g.
"America/New_York", "UTC"). Defaults to the server’s local timezone.object
Agent to run:
{ name, input, sessionId?, userId? }.object
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:
Example: Create via HTTP
Example: List Schedules
Cron Expression Reference
Format:
minute hour day-of-month month day-of-week