Surplus logo
Surplus Docsby Sharing Excess
GuidesDevelopersApps and services

Cron workers (crons/*)

Scheduled jobs are small Bun packages with their own package.json, railway.json, and entry src/index.ts. Typical responsibilities:

PackageRole
@surplus/analyticsCacheCron (crons/analyticsCache)Refreshes analytics cache / materializations used by reporting endpoints
@surplus/postgresBackupCron (crons/postgresBackup)Database backup automation
@surplus/fileStorageBackupCron (crons/fileStorageBackup)Object storage backup automation

Running locally

cd crons/analyticsCache
bun run start

Each cron’s README (if present) and railway.json describe schedules and required environment variables.