Skip to content

TIP

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

@saasweave/jobs

BullMQ queues, job dispatch, webhook delivery, repeatable schedules, and domain processors.

Queues

NamePurpose
emailTemplate email send
notificationsIn-app notifications
stripeStripe webhook processing
webhooksOutbound HTTP webhooks
data-exportWorkspace export jobs
batch-jobsDemo / batch workloads
schedulesCron maintenance jobs

Processors

Processors live in this package (domain-workers.ts, schedule-worker.ts, worker.ts). They call @saasweave/app for domain logic and handle queue-specific orchestration (post-export notifications, subscription emails).

apps/worker only composes createAllWorkers() from @saasweave/jobs/worker plus signal/readiness lifecycle.

Dispatch behavior

FunctionWithout RedisWith Redis
dispatchTemplateEmailConsole/logQueued
dispatchNotificationInlineQueued
dispatchOrgWebhookInline HTTPQueued
dispatchStripeWebhookInlineQueued

Schedules

  • registerRepeatableSchedules() — invitation expiry, MRR snapshot, storage cleanup, data retention
  • expireStaleInvitations() — cancels pending invites older than 30 days

Tests

bash
pnpm --filter @saasweave/jobs test:unit

Released under the MIT License.