apps/worker handles non-AI background jobs that should not increase gateway response time. It connects to Redis for BullMQ and to MongoDB when a job needs persistence.
Workers
The subscription worker is not started when enterprise mode is disabled. This prevents open-source deployments from executing licensed billing behavior accidentally.
Shutdown and failure behavior
The process closes all active workers onSIGTERM or SIGINT. Unhandled promise rejections and uncaught exceptions are logged and terminate the process so the container supervisor can restart it.
Email and analytics jobs are at-least-once work. Configure retries carefully and make downstream side effects idempotent where possible.
Configuration
The worker needs Redis connectivity, MongoDB for analytics and subscription work, email-provider settings, AWS credentials when SES is selected, andWORKER_CONCURRENCY. See environment variables.
