Next.js instrumentation starts embedded workers for development. Production deployments should set ATLAS_WORKER_MODE=external and supervise the independent worker process. Web and worker services must use the same database, data directory access, encryption secret, and provider configuration. The worker loads its environment and reports which roles it is running.

bash
npm run worker -- --role=all
# Or isolate responsibilities into supervised processes:
npm run worker -- --role=ai
npm run worker -- --role=email,workflows,search
# A controlled single pass:
npm run worker -- --role=search --once

Saved work survives disconnected clients#

AI requests are actor/workspace-scoped database jobs. Creation idempotency keys prevent duplicate requests after lost responses. Interrupted jobs retain saved progress for recovery. Cancellation and dismissal are distinct from navigating away. The AI job service bounds concurrency, queue size, and the number of active and retained requests per actor; these are capacity controls, not throughput guarantees.

Workflow definitions, runs, event jobs, and schedule claims are durable. A restarted scheduler dispatches one overdue interval instead of replaying every missed interval. Helpers start paused; enabling them authorizes their configured schedule or events. Helper-produced changes do not trigger other helpers, preventing recursive chains. Long-interrupted runs fail visibly instead of silently repeating.

ControlEffect
ATLAS_DISABLE_WORKER=trueDisables embedded workflow and search worker startup
ATLAS_DISABLE_AI_WORKER=trueDisables embedded AI worker startup
ATLAS_DISABLE_EMAIL_WORKER=trueDisables embedded email and notification worker startup
ATLAS_DISABLE_SEARCH_WORKER=trueDisables embedded indexing startup; existing vectors remain searchable

For external workers, pause the supervised process or omit its role; do not treat embedded startup flags as a global kill switch. Use PostgreSQL to coordinate separate processes. Adding workers without accounting for database pools, provider quotas, and file access can reduce reliability instead of improving it.