Skip to content

node-worker features

Generated from templates/node-worker/template.json. Drop a default with --without, add an opt-in with --with.

FeatureDefaultWhat it adds
prisma
Prisma database access
Always

Shares the schema with your API, so the worker reads and writes the same models rather than going through HTTP.

logging
pino structured logging
Always
queue
BullMQ consumers
On

Worker processes pulling from the same Redis queues your API produces to.

Packages: bullmq, bullmq-otel, ioredis

Files it owns (2)
  • src/utils/worker.ts
  • src/workers/**
temporal
Temporal worker
Opt-in

Runs durable workflows and activities from src/temporal (an example of each included) on TEMPORAL_TASK_QUEUE, next to the BullMQ consumers. Pair with the API's temporal feature, which starts them.

Packages: @temporalio/activity, @temporalio/worker, @temporalio/workflow

Files it owns (1)
  • src/temporal/**
telemetry
OpenTelemetry → OpenObserve
On

Traces, logs and metrics pushed over OTLP (set OPENOBSERVE_URL/ORG/TOKEN, or any OTEL_* backend). Off at runtime until connected.

Packages: @opentelemetry/api, @opentelemetry/core, @opentelemetry/sdk-node, @opentelemetry/auto-instrumentations-node, @opentelemetry/exporter-trace-otlp-proto, @opentelemetry/exporter-logs-otlp-proto, @opentelemetry/exporter-metrics-otlp-proto, @opentelemetry/sdk-logs, @opentelemetry/sdk-metrics, @opentelemetry/resources, @opentelemetry/semantic-conventions, @opentelemetry/instrumentation, import-in-the-middle, @prisma/instrumentation

Files it owns (1)
  • src/telemetry/**
browser
Headless browser (Puppeteer)
Opt-in

For scraping pages that need JavaScript executed. Heavy — the Docker image grows by roughly 800 MB (Chromium and its fonts).

Packages: puppeteer

Files it owns (1)
  • src/utils/browser.ts
pm2
PM2 process manager
On

ecosystem.config.cjs for running the worker under PM2 outside Docker.

Files it owns (1)
  • ecosystem.config.cjs
docker
Docker image
On
Files it owns (3)
  • Dockerfile
  • Dockerfile.dev
  • .dockerignore
ci
Forgejo Actions CI
On
Files it owns (1)
  • .forgejo/**
secrets
Infisical secret sync
On
Files it owns (1)
  • .bin/secrets.ts
  • temporal changes the Docker base image: Temporal’s native core ships glibc builds only and won’t load on Alpine, even with gcompat, so the image builds on node:24-bookworm-slim instead of the Alpine house image. The browser and pm2 steps have Debian equivalents.
  • browser adds Chromium to the image, roughly 800 MB. launchBrowser() in src/utils/browser.ts isn’t called anywhere by default.
  • pm2 runs dist/ with autorestart: false: a crash is not restarted by PM2. Rely on your container’s restart policy, or change it.
  • queue off leaves a worker that only runs Temporal workflows (or nothing, as a base for your own loop).