Skip to content

TIP

This page mirrors apps/worker/README.md from the repository. Edit it at the source, not here.

@saasweave/worker

Background job process host using BullMQ. Registers processors from @saasweave/jobs; contains no domain logic.

Responsibilities

ConcernOwner
Worker startup / shutdown, SIGINT/SIGTERMapps/worker
Readiness HTTP (WORKER_HEALTH_PORT)apps/worker
Repeatable schedule registration on bootapps/worker
BullMQ processors (stripe, export, batch, email, …)@saasweave/jobs
Stripe apply, export build, batch iteration@saasweave/app

Queues processed

All queues from @saasweave/jobs/workercreateAllWorkers():

email, notifications, stripe, webhooks, data-export, batch-jobs, schedules

Without Redis, the server falls back to inline delivery where possible (webhooks, email logging).

Environment variables

Same as server for DB, Redis, mail, Stripe, and MinIO. See packages/env/README.md.

VariableDefaultNotes
WORKER_CONCURRENCY5Parallel jobs per queue worker
QUEUE_PREFIXsaasweaveRedis key namespace
WORKER_HEALTH_PORT9100Readiness probe port

Development

bash
pnpm --filter @saasweave/worker dev

Requires Redis (REDIS_URL) and migrated database.

Docker

worker service in docker-compose.yaml starts after migrate, redis, and minio-init.

Released under the MIT License.