Work Scheduling Service
The scheduling system enables automated, recurring generation runs for works. It consists of two services: WorkScheduleService (configuration and state management) and WorkScheduleDispatcherService (cron-like dispatch logic).
Sources:
packages/agent/src/services/work-schedule.service.tspackages/agent/src/services/work-schedule-dispatcher.service.ts
Overview
Scheduled updates allow works to automatically refresh their content at configurable intervals. The system integrates with the subscription/billing layer to enforce plan limits and supports both subscription-based and pay-per-use billing modes.
Schedule Configuration
Cadences
The system supports four cadence options, defined in WorkScheduleCadence:
| Cadence | Interval | Typical Use Case |
|---|---|---|
HOURLY | Every hour | High-frequency monitoring works |
DAILY | Every 24 hours | Standard content refresh |
WEEKLY | Every 7 days | Low-frequency curated lists |
MONTHLY | Every 30 days | Archival or slow-moving works |
Schedule Statuses
| Status | Description |
|---|---|
ACTIVE | Schedule is running; nextRunAt is set |
PAUSED | Temporarily stopped (manual or auto-pause after failures) |
CANCELED | Permanently stopped; configuration cleared |
DISABLED | Default state before any schedule is created |
Billing Modes
| Mode | Description |
|---|---|
SUBSCRIPTION | Runs count against the user's subscription plan limits |
USAGE | Pay-per-use billing; no plan cadence restrictions |