Introducing a new way to review your PRs.

Read the announcement

ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co

View on GitHub

27 documents · Updated Nov 23, 2026

docs / background-jobs-and-scheduling

Background jobs and scheduling

Background jobs and scheduling move slow or repeated platform work away from request handling. The worker application starts a Nest application context, fires scheduled work, records scheduled runs, and drains queue workers for selected plugins. The shared scheduler also lets a process run a job in place or place it on a BullMQ queue for later processing. For the wider backend map, see the backend platform page.

Worker application startup

The worker is a dedicated runtime for asynchronous work. It loads .env and then .env.local before it loads plugin modules. Values named by ENV_LOCAL_NO_OVERRIDE keep their starting environment values, which lets deployment settings take precedence over local settings. The worker then builds its own Nest module graph and closes that graph when the process receives a shutdown signal.

Bootstrap sequence

The startup path prepares configuration first. It then loads the worker plugin list and registers its entities and subscribers before creating an application context without an HTTP listener. Module startup discovers schedules and queue handlers. Jobs marked to run at startup can then enqueue their first work item.

The sequence below shows how process startup leads to scheduled and queued work.

flowchart TD
    A[Start worker process] --> B[Load .env and .env.local]
    B --> C[Load and register worker plugins]
    C --> D[Create Nest application context]
    D --> E[Build scheduler and plugin modules]
    E --> F[Discover scheduled jobs and queue workers]
    F --> G[Run startup schedules]
    G --> H[Enqueue asynchronous work]
    H --> I[Queue worker handles job]
    D --> J[Wait for signals]
    J --> K[Close application context]

The worker build produces a Node runtime with the workspace packages needed by this module graph. Its build settings also preserve native class behavior between the worker code and the shared scheduler packages, which is required for queue workers to start reliably.

References: apps/…/main.ts• L5-38 apps/…/load-env.ts• L5-10 apps/…/load-env.ts• L12-21 apps/…/load-env.ts• L32-41 apps/…/load-env.spec.ts• L35-58 apps/…/webpack.config.js• L9-18 apps/…/webpack.config.js• L46-90 apps/…/project.json• L15-53 packages/…/scheduler-discovery.service.ts• L39-53

Worker scope

The worker hosts plugins that own work for this process to drain or schedules for this process to fire. This keeps long-running document work out of the API process and prevents a plugin from creating a queue worker merely because the plugin is available to the API. The worker list includes document processing, commerce maintenance, stock maintenance, selected integrations, notification delivery, and task automation schedule producers.

The documents workload runs extraction, classification, chunking, embedding, indexing, thumbnail, and recovery work. Inventory, cart, and order plugins provide stock-hold, cart, and order maintenance schedules. The worker also registers webhook maintenance and timer, meeting, and task-due reminder schedules when queueing is enabled. Invoice payment-reminder and scheduled-invoice schedules also run here. The API remains the process that owns request-facing domain actions and the consumers that need its full domain graph.

The worker can host optional integration work. Ever Works, Asana, Linear, Trello, and Jira Cloud are loaded only when their switches are enabled, so their scheduled sync or maintenance work is present only for active integrations. Their request, webhook, and manual-import paths remain in the API process. Task automations use the same split: the worker creates the scheduled queue request, while the process with the task services consumes it. The Inbox plugin is loaded when its switch is enabled. Its delivery and email-provider plugins are loaded only when the matching notification features are enabled.

The worker also imports platform maintenance modules for idempotency, event-outbox dispatch scheduling, webhooks, reminder schedules, invoice schedules, and other queue-backed work. These imports are schedule-only when the matching consumer needs the API's domain graph. The event-outbox schedule only enqueues dispatch work here; the process that owns the event consumers performs the dispatch. The worker's plugin module is instantiated so plugin queue processors and bootstrap hooks exist in this process.

The worker's module wiring is guarded by dependency and metadata checks. Plugin modules must be instantiated, every plugin prerequisite must be hosted in dependency order, required core modules must be imported, and the scheduler root must be available before plugin registration. The hosted module graph must also expose the entities its repositories use to both supported ORMs. These checks protect the worker's role as the process that fires and drains asynchronous work.

References: apps/…/plugins.ts• L30-59 apps/…/plugins.ts• L61-225 apps/…/app.module.ts• L18-149 apps/…/plugins.spec.ts• L76-137 apps/…/plugins.spec.ts• L139-218 apps/…/app.module.spec.ts• L90-170 apps/…/app.module.spec.ts• L173-300 apps/…/worker-composition.spec.ts• L132-196 apps/…/package.json• L20-64

Scheduled execution

Scheduled execution turns a method marked as a scheduled job into a managed unit of work. The scheduler discovers these methods during module startup, applies shared defaults, and connects each job to a time trigger, a startup trigger, or explicit invocation.

Job registration

The scheduler treats a scheduled job as a small contract: it has an identity, an optional time rule, a target, and run controls. A job can use a cron expression, a time interval, or no time rule when another part of the system triggers it. A runOnStart job runs after application bootstrap.

The registry keeps jobs visible even when the current process cannot run a queue-targeted job. It marks that job as unschedulable and the discovery service reports the reason instead of stopping the whole process during boot.

References: packages/…/scheduled-job.decorator.ts• L1-7 packages/…/scheduled-job-options.interface.ts• L3-21 packages/…/scheduler-job-registry.service.ts• L20-37 packages/…/scheduler-discovery.service.ts• L56-141

Execution targets

Each scheduled job has one of two execution targets. An inline job runs its handler in the current process. A queue-targeted job first creates its payload, then places that payload on a named queue. A separate queue worker receives the payload and performs the asynchronous operation.

This split lets a schedule stay light while the heavy work runs elsewhere. The scheduler service can also list registered jobs and trigger one by its identifier, which supports operational inspection and manual recovery.

flowchart LR
    T[Time trigger or manual trigger] --> S[Scheduled job handler]
    S -->|No queue| I[Run in current process]
    S -->|Queue target| Q[Named BullMQ queue]
    Q --> W[Queue worker]
    W --> H[Queue job handler]
    H --> D[Domain service or pipeline]

References: packages/…/scheduler-job-runner.service.ts• L22-102 packages/…/scheduler.service.ts• L16-45 packages/…/scheduler-queue-job.interface.ts• L1-8

Reliability controls

The scheduler protects recurring work from common timing failures. It can prevent overlapping runs for the same scheduled job, retry failed attempts after a delay, stop a run that exceeds its timeout, and add a random delay to spread work across processes. These controls apply to the scheduled-job runner; queue-specific retry and retention rules can add further protection for a workload.

The overlap guard is local to one process. It prevents duplicate work from concurrent triggers in that process, but it is not a distributed lock. Queue job identity and the queue system provide the coordination boundary when multiple processes share a queue.

References: packages/…/scheduler-job-runner.service.ts• L8-16 packages/…/scheduler-job-runner.service.ts• L22-87 packages/…/scheduler-discovery.service.ts• L144-176 apps/…/app.module.ts• L44-54

Run ledger

The worker can record each scheduled attempt in the job ledger. A bootstrap adapter connects the scheduler's run recorder after application startup, so startup jobs are not recorded before the ledger service is ready. The ledger stores the job, trigger, attempt, timing, result, error, and metadata for later operational review.

The ledger also provides a shared live-run boundary. If it refuses a second active run, the scheduler records a skipped-overlap result instead of treating the tick as a job failure. Other ledger errors remain visible to the scheduler, while recording stays separate from the job's own business action.

References: apps/…/scheduler-ledger.bootstrap.ts• L15-56 apps/…/scheduler-ledger.bootstrap.ts• L59-128 apps/…/scheduler-ledger.bootstrap.spec.ts• L42-199

Queue workers

Queue workers consume named jobs from BullMQ and map each job name to a handler. The shared scheduler supplies the worker host and handler contract so each workload can focus on its domain action rather than queue plumbing.

Queue registration and dispatch

The scheduler has a root configuration and feature configuration. The root creates the optional queue connection and shared scheduler services. A feature declares its job providers and queue names. A process can therefore host the scheduler without queueing, or host queue producers and workers when a queue root is enabled. In the worker, queue-gated maintenance features and schedule-only producer modules are imported only when the queue root exists.

When a scheduled job targets a queue, the scheduler resolves that queue and adds the job with its payload and queue options. A missing queue is an explicit configuration failure. A queue-targeted job in a process with queueing disabled is instead left unscheduled and logged so an optional workload cannot prevent application startup.

References: packages/…/scheduler.module.ts• L17-67 packages/…/scheduler-queue.service.ts• L17-44 packages/…/scheduler-discovery.service.ts• L107-141 apps/…/app.module.ts• L39-123

Handler routing

A queue worker declares the queue it consumes. Its handler methods declare the job names they accept. The worker host uses the job name to select one handler and raises an error when no handler matches. A rejected handler result remains visible to BullMQ so the queue's retry policy can act on it.

This contract keeps transport concerns separate from business work. The queue worker adapts the incoming job, while the domain service or pipeline owns the actual operation.

References: packages/…/queue-worker.host.ts• L7-57 packages/…/queue-worker.decorator.ts• L1-3 packages/…/queue-job-handler.decorator.ts• L4-10 packages/…/docs-processing.worker.ts• L29-45

Transactional outbox dispatch

The event outbox carries durable facts from a committed state change to the platform's event consumers. A writer appends the fact in the same transaction as the state change. A dispatch pass later claims due partition heads, gives the event to each registered consumer, and records whether the event is published, waiting for retry, or unresolved.

The scheduled outbox job runs every minute and places a dispatch request on event-outbox-dispatch. The worker process fires the schedule but does not consume the event. The API process that hosts the complete consumer registry runs the pass. This separation prevents a process with an incomplete registry from marking an event complete too early.

The dispatch pass keeps event order within each partition. A lease lets another pass reclaim work after a crash. A failed consumer uses a retry ladder, while a consumer that reaches its terminal state no longer blocks the event or later positions. A row with no matching consumer is treated as published because the deployment has no delivery target for it.

sequenceDiagram
    participant State as State change
    participant Outbox as Event outbox
    participant Signal as Commit signal
    participant Schedule as Scheduled pass
    participant Queue as Dispatch queue
    participant Consumer as Event consumers

    State->>Outbox: Append in the state transaction
    State->>Signal: Commit
    Signal->>Queue: Wake a consuming process
    Schedule->>Queue: Request a periodic pass
    Queue->>Outbox: Claim due partition heads
    Outbox->>Consumer: Deliver one event to each consumer
    Consumer-->>Outbox: Publish, retry, or settle

References: packages/…/event-outbox.service.ts• L121-175 packages/…/event-outbox.service.ts• L215-252 packages/…/event-outbox-dispatch.scheduler.ts• L11-60 packages/…/event-outbox-dispatch.worker.ts• L46-80 packages/…/event-outbox-constant.ts• L11-65 apps/…/app.module.ts• L57-92 apps/…/app.module.spec.ts• L144-170

Inline outbox dispatch

An API without a queue can run the same outbox dispatch pass in process. A commit wakes the inline worker, and a short sweep finds retries, expired leases, or rows appended by another process. This keeps subscriptions, projections, and outbound delivery active in single-process and development deployments.

Queue mode, inline mode, and disabled mode are separate process choices. Queue mode uses the shared queue worker. Inline mode uses the local worker only when no queue root exists. Disabled mode leaves events for another configured path or stops dispatch, so it must be an explicit operational choice.

References: packages/…/event-outbox-inline-dispatch.ts• L8-35 packages/…/event-outbox-inline-dispatch.ts• L37-82 packages/…/event-outbox-inline-dispatch.ts• L85-98 packages/…/app.module.ts• L669-704 packages/…/event-outbox-inline-dispatch.sqlite.spec.ts• L120-180

Platform workload examples

The scheduler supports both platform maintenance and user-facing asynchronous work. Current examples show the intended pattern:

  • The documents workload sends extraction, classification, chunking, embedding, indexing, thumbnail, and recovery jobs through docs-processing. Its worker calls one shared pipeline so queued and inline paths use the same stage behavior.
  • Token maintenance schedules expired-token cleanup every hour and inactive-token cleanup every six hours. Its queue worker invokes the token command handlers that update token state.
  • Commerce maintenance schedules stock-hold release, cart expiry and abandonment, and order repair passes in the worker process.
  • The optional Ever Works integration schedules feed polling, reconciliation, cleanup, and health checks. Asana, Linear, Trello, and Jira Cloud add scheduled import or connection-maintenance work when their integrations are enabled.
  • The Inbox plugin schedules recovery for notifications that were not filed during the live path. Its delivery plugin runs notification sweeps, and its enabled email providers supply the delivery paths.
  • Task automations, timer reminders, meeting reminders, task-due reminders, payment reminders, scheduled invoices, webhook maintenance, and idempotency maintenance use queue-backed schedules for periodic platform work. The worker schedules these jobs, while the API consumes the jobs that need its notification, mail, invoice, or full domain services.

The documents recovery scan also gives the system a repair path. It runs after startup and on a recurring schedule to find stale database rows and re-enqueue or fail them. The database row remains the source of truth when queue state is lost.

References: packages/…/docs-processing.worker.ts• L49-124 packages/…/docs-recovery.service.ts• L31-43 packages/…/docs-recovery.service.ts• L56-111 packages/…/token-cleanup.scheduler.ts• L13-43 packages/…/token-cleanup.worker.ts• L10-59 apps/…/plugins.ts• L69-225 apps/…/app.module.ts• L84-123 apps/…/app.module.spec.ts• L173-300

Shared scheduler infrastructure

@gauzy/scheduler is the common boundary for time triggers, queue registration, scheduled-job policy, and queue-worker dispatch. Applications and plugins use the same boundary so they agree on job identity, queue names, and whether queueing exists in the current process.

Root and feature modules

SchedulerModule.forRoot() creates the process-wide scheduler context. It enables or disables scheduling and queueing independently. SchedulerModule.forFeature() adds a workload's job providers and queue registrations without creating another root.

This distinction supports different backend roles. A producer can enqueue work without running schedules. A worker can run schedules and consume queues. A process without a queue root can still run inline work where the workload supports that mode.

The worker registers both scheduling and queueing in its root, then registers platform schedule-only modules and plugin features after that root. This order ensures that plugin queue workers have the shared queue context they need and that schedules run in the process assigned to produce them.

References: packages/…/scheduler.module.ts• L19-67 packages/…/scheduler-module-options.interface.ts• L6-35 packages/…/scheduler-feature-options.interface.ts• L1-10 packages/…/scheduler.module.producer-only.spec.ts• L9-21 apps/…/app.module.ts• L39-147 apps/…/app.module.spec.ts• L105-142

Queue availability

Queue availability is a shared process decision. Redis configuration enables the queue root by default, while SCHEDULER_QUEUE_ENABLED=false disables it for the deployment and WORKER_QUEUE_ENABLED=false narrows it for the worker. The same predicate is used by applications and plugin queue gates so a plugin does not register a queue worker against a root that is absent.

Queue connection details come from an explicit connection or from the Redis environment settings. When queueing is off, queue registrations are removed from the module shape. This allows a root-less process to start and use an available inline path instead of failing at worker construction.

References: packages/…/is-queue-root-enabled.ts• L1-56 packages/…/resolve-bull-connection.ts• L3-18 packages/…/normalize-scheduler-options.ts• L18-42 apps/…/worker.constants.ts• L1-22

Plugin integration

Plugins join the scheduler through feature registration. The worker loads the configured plugin modules after it creates the scheduler root, which lets those plugins register their queues, handlers, and schedules. The worker resolves plugin prerequisites before registration and supplies their entities to the ORM, so a plugin's complete module graph can start as one unit. Optional integrations, task automation, Inbox features, notification channels, and email providers use switch rules in the worker and API, so their schedules and delivery paths are present only when the related feature is enabled.

The event outbox uses the same boundary with two roles. EventOutboxDispatchScheduleModule registers only the schedule that creates dispatch requests. EventOutboxMaintenanceModule registers the queue worker and the shared consumer registry in the API process that can deliver every supported event. An API with no queue root instead imports the inline dispatch module. The worker also uses schedule-only modules for reminder and invoice work whose domain consumers belong in the API. This relationship connects the plugin architecture to the worker runtime. Domain actions remain in the plugin or core service, while scheduling decides when and where to invoke them. The API application lifecycle page describes the API process that produces work without hosting this worker runtime. The backend platform page places both runtimes in the wider backend system. The domain services and contracts page explains those business boundaries.

References: packages/…/event-outbox-maintenance.module.ts• L8-80 packages/…/event-outbox.module.ts• L18-83 apps/…/main.ts• L12-20 apps/…/app.module.ts• L80-149 apps/…/plugins.ts• L30-59 apps/…/plugins.ts• L69-225 apps/…/plugins.spec.ts• L76-137 apps/…/plugins.spec.ts• L139-218 apps/…/app.module.spec.ts• L144-300 packages/…/docs-queue.service.ts• L16-40 packages/…/docs-queue.service.ts• L67-107

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the worker plugin list, plugin queue gate, and shared queue-root predicate aligned. A mismatch can register a processor without a queue root.
  • Keep the worker plugin list, its declared prerequisites, and the ORM entity set aligned. A missing prerequisite can fail boot through dependency injection or repository metadata before any job runs.
  • Keep scheduled maintenance modules in the process whose scheduler root is enabled. Importing only the worker side into a producer-only process can leave a schedule silent.
  • Keep schedule-only modules paired with the API consumer modules for outbox, reminders, and invoice work. A schedule can fire successfully while the queued domain action has no handler.
  • Keep the scheduler run recorder attached after the worker graph is ready. A missing attachment removes run history without stopping the scheduled work.
  • Keep scheduled queue names and queue-worker declarations aligned. A valid schedule with an unregistered queue cannot enqueue work.
  • Keep scheduled job names and queue handler names aligned. The queue can accept a job that no worker handler can process.
  • Keep producer-only scheduler settings separate from worker scheduler settings. Enabling the job runner in both processes can run a recurring job twice.
  • Load worker plugin configuration only after environment loading. Early module evaluation can select the wrong queue or inline mode.
  • Keep each optional integration, task automation, Inbox feature, notification channel, and email provider switch aligned in both process plugin lists. A partial switch can create a schedule or delivery path without its required module.
  • Keep schedule-only modules aligned with the process that owns the matching consumer. A schedule can fire successfully while its queued domain action has no handler.
  • When a workload adds an inline fallback, preserve the same domain handler used by its queue worker so the two paths do not drift.
  • When a recovery path uses deterministic queue IDs, check whether retained completed jobs can suppress a later enqueue. Recovery runs need a fresh run identity when they must force a new attempt.
  • Keep the event-outbox schedule, queue name, queue job name, and handler name aligned. A mismatch can leave committed events stored without a dispatch pass.
  • Keep the outbox maintenance module limited to processes with the complete consumer registry. A partial registry can mark an event published before every supported consumer sees it.
  • Keep commit wake-up and periodic sweep paths together. The wake reduces live latency, while the periodic path retries failures and finds work created in another process.
  • Keep inline dispatch mutually exclusive with the queue worker. Running both in one process can spend resources on duplicate passes even when row leases prevent duplicate delivery.
  • Keep outbox partition ordering, lease duration, retry state, and consumer delivery records as one contract. Changing one without the others can allow later events to pass an unresolved head or repeat settled delivery.
  • Preserve the same outbox row shape across TypeORM and MikroORM. A mismatch in event body, scope, sequence, or status can make one database mode append work that the dispatcher cannot read correctly.

Important failure modes

TriggerConsequenceGuard
A plugin queue gate says queueing is enabled while the process has no BullMQ rootNest can fail during worker construction because the queue worker has no connectionUse isSchedulerQueueRootEnabled() for root registration and plugin gating
A scheduled maintenance module is loaded only in a process whose scheduler root is disabledThe queue worker can exist while its schedule never fires, so work remains pending without an errorLoad the schedule in the worker root with WORKER_SCHEDULER_ENABLED=true
A schedule-only reminder or invoice module is present without its API consumer moduleJobs can enter a queue that no process handles, so reminders or invoices remain pendingKeep each worker schedule paired with its API maintenance consumer
A plugin prerequisite is absent or its repository entity is not in the worker's ORM setThe worker can fail during module construction before it can drain any queueResolve plugin load order and keep hosted module repositories covered by the registered entity set
A plugin module is not instantiated in the worker, or a required core module is missingThe worker can idle without a queue processor or fail during dependency setupKeep PluginModule.init() and the worker's required core module imports in AppModule
Plugin registration occurs before the worker scheduler rootPlugin queue workers can start without the queue context they requireRegister the scheduler root before PluginModule.init()
Worker plugin configuration is imported before environment loadingA plugin can select inline execution or the wrong feature state even when queueing is configuredLoad the plugin list dynamically after loadEnv()
.env.local overrides a deployment value that must remain fixedThe worker can select the wrong API, database, or feature setting for its processList protected names in ENV_LOCAL_NO_OVERRIDE so their starting environment values are restored after .env.local loads
An optional integration, task automation, or notification feature is enabled without its dependent worker or API pluginIts scheduled work or delivery path is absent, so work waits for another process or remains pendingUse the same exact-true switch rules for each feature and its dependent modules in both process lists
A worker build lowers its application classes in a way that is not compatible with native shared queue classesThe worker can crash during boot before background jobs startKeep the worker's compiler target compatible with the prebuilt scheduler and BullMQ classes
A scheduled job targets a queue that is not registeredEnqueue fails when the schedule firesRegister the queue through SchedulerModule.forFeature()
A queue job name has no matching worker handlerThe worker rejects the job and the queue retry policy may repeat the failureKeep queue job names and QueueJobHandler names as one contract
The API and worker both run the same scheduled jobRecurring work can run twiceDisable the job runner in the producer-only process
A worker process exits without normal application shutdownIn-process schedules and active work stop with the processUse queue persistence for resumable work and the workload recovery scan where one exists
The scheduler run recorder is not attached, or the ledger is not availableScheduled work can run without a usable record of its trigger and outcomeKeep SchedulerLedgerBootstrap in the worker and treat ledger errors as visible operational failures
A queue is unavailable during documents dispatchDocument stages can fall back to inline background execution, with weaker queue guaranteesCheck dispatch-mode logs and restore the queue when distributed retries or coalescing are required
The outbox maintenance worker runs in a process without every event consumerThe outbox row can be marked published while a consumer in another process never receives itRun the worker where the complete consumer registry is loaded, and keep schedule-only registration separate
Commit wake-up is disabled without a working periodic or inline sweepNewly committed events wait for a later retry path, increasing delivery latencyKeep the per-minute queue schedule or the inline sweep enabled when commit wake-up is off
A queue-less API omits inline dispatch or sets it to disabledEvents remain pending while subscriptions, projections, and outbound delivery stay silentUse EventOutboxInlineDispatchModule when no queue root exists, unless another dispatcher is guaranteed
The outbox queue name or job name differs between scheduler and workerDispatch requests can enter a queue that no handler consumesShare the event-outbox constants across the schedule, queue registration, and handler
A dispatch pass claims a row and then dies before it settlesThe row waits until its lease expires, then a later pass can reclaim itKeep leases finite and longer than the normal pass period; retain the periodic recovery pass
A consumer fails while another consumer succeedsThe event stays retryable, but the successful consumer must not run againKeep the per-event, per-consumer delivery record and retry only unsettled records
TypeORM and MikroORM disagree on outbox columns or partition rulesOne database mode can lose event data, scope, ordering, or dispatch statePreserve ORM parity for append, claim, delivery, replay, and status changes

Key files

FileWhy to read it
apps/…/main.tsShows environment loading, delayed plugin loading, application-context startup, and signal-based shutdown.
apps/…/load-env.tsDefines the worker's .env and .env.local precedence and the protected-value rule.
apps/…/load-env.spec.tsShows the contract for local settings and protected starting environment values.
apps/…/app.module.tsShows the worker's scheduler root, core dependencies, schedule-only platform modules, ledger attachment, and plugin integration order.
apps/…/plugins.tsShows which plugins the worker fires or drains, their prerequisites, and their feature switches.
apps/…/plugins.spec.tsShows the contracts for plugin presence, dependency order, duplicate prevention, and optional feature switches.
apps/…/package.jsonShows the worker runtime commands and the workspace packages that provide its asynchronous workloads.
apps/…/app.module.spec.tsShows the wiring guarantees for plugin construction, the scheduler root, schedule-only outbox and reminder modules, and API-owned consumers.
apps/…/scheduler-ledger.bootstrap.tsConnects scheduled runs to the job ledger and turns live-run conflicts into skipped-overlap records.
apps/…/scheduler-ledger.bootstrap.spec.tsShows the contract between scheduler run events and ledger records.
apps/…/worker-jobs.module.tsShows how worker lifecycle jobs and their queue are registered as a feature.
apps/…/webpack.config.jsShows the worker build packaging and compiler settings needed for the shared runtime classes.
apps/…/project.jsonShows the Node build, serve, and production targets for the worker application.
packages/…/scheduler.module.tsDefines the root and feature boundary shared by applications and plugins.
packages/…/scheduler-discovery.service.tsShows job discovery, time-trigger registration, startup execution, and cleanup.
packages/…/scheduler-job-runner.service.tsDefines target selection, overlap protection, retries, and timeouts.
packages/…/scheduler-queue.service.tsDefines the shared enqueue contract and queue registration check.
packages/…/queue-worker.host.tsShows how queue job names reach worker handlers.
packages/…/event-outbox.service.tsDefines transactional event append, ordered claiming, retry state, consumer delivery records, and replay behavior.
packages/…/event-outbox-dispatch.scheduler.tsShows the periodic outbox dispatch request and its stable queue contract.
packages/…/event-outbox-dispatch.worker.tsShows how a dispatch pass delivers one event to all consumers and handles retry and terminal states.
packages/…/event-outbox-commit.signal.tsShows why committed appends can wake dispatch without exposing uncommitted events.
packages/…/event-outbox-inline-dispatch.tsShows the queue-less API fallback and its sweep for work not announced by a local commit.
packages/…/event-outbox-maintenance.module.tsShows the separation between schedule-only registration and the complete consumer-bearing maintenance worker.
packages/…/event-outbox-mikro-orm.store.tsShows the shared outbox behavior required for the MikroORM persistence path.
packages/…/event-outbox-dispatch.worker.spec.tsSummarizes the worker guarantees for fan-out, retries, leases, job routing, and commit wake-up.
packages/…/event-outbox-inline-dispatch.sqlite.spec.tsShows that inline dispatch waits for commit and recovers work from a sweep in a queue-less API.
packages/…/event-outbox.orm-parity.spec.tsShows that append, claim, delivery, replay, and commit signaling have the same behavior across supported ORMs.
packages/…/docs-queue.service.tsIllustrates queued and inline dispatch for a long-running platform pipeline.
packages/…/docs-processing.worker.tsIllustrates a queue worker that delegates stages to a shared domain pipeline.
packages/…/docs-recovery.service.tsShows startup and recurring recovery for work whose queue state is incomplete.
packages/…/token-cleanup.scheduler.tsIllustrates scheduled maintenance that produces queue jobs.
packages/…/token-cleanup.worker.tsIllustrates queue handlers that invoke core maintenance commands.