HaloStack Docs
Open App
Apps

Worker

The one-shot Bun runtime that executes scheduled jobs from the shared jobs package.

apps/worker is the deployment runtime for background jobs. Job definitions live in @halostack/jobs; the worker selects one job by JOB_NAME, runs it, and exits.

Runtime shape

The one-shot shape keeps the same job code portable across schedulers. Railway runs it as a cron service today, but another host could trigger the same entry with an equivalent JOB_NAME.

In development the worker can also run a scheduler loop so job behavior can be tested without Railway.

Commands

Deployment

.railway/railway.ts defines the worker service with cronSchedule, a startCommand that sets JOB_NAME, and restartPolicyType: "NEVER". The exit code is the retry signal; the worker is not an HTTP service and has no healthcheck.