unstale

npm / pg-boss

pg-boss

What changed in pg-boss 10 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

128 breaking3 deprecations137 new APIs and options5 performance42 behavior and defaults4 tooling96 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

pg-boss 12322 changes

Breaking changes 63

  • Hour-restricted cron schedules with a timezone now send once at repeated local times when clocks go back; schedules naming every hour still send in both repeated hours, and missed: 'once' follows the same rule.

    12.38.1release notes

  • Deletes in batches and resolves to the number of jobs deleted; failures can leave a partial delete.

    12.38.0release notes

  • Returns matching jobs oldest first and at most 1,000 by default; callers can use limit and after to read further pages.

    12.38.0release notes

  • Reads at most limit jobs of each kind, defaulting to 1,000 and allowing up to 100,000; total is no longer exact and counts only jobs read.

    12.38.0release notes

  • After upgrading, totalCount retains its prior count until the queue's first maintenance pass, then may temporarily be off after concurrent deletes or resumes during counting.

    12.38.0release notes

  • A job naming a missing dead-letter queue now rejects with Dead letter queue <name> does not exist.

    12.37.0release notes

  • Deleting a partitioned queue no longer waits indefinitely on concurrent sends; it retries lock acquisition for about 3 seconds, then rejects and leaves the queue unchanged.

    12.37.0release notes

  • Flow creation now rejects when a queue was deleted by another instance.

    12.37.0release notes

  • Inserting into a queue deleted by another instance now rejects with Queue <name> does not exist instead of reporting nothing done.

    12.37.0release notes

  • Previously stored schedules with empty expressions are skipped by the cron pass with an invalid_schedule warning instead of firing every minute.

    12.37.0release notes

  • schedule() rejects empty, blank, or non-string cron expressions; previously an empty expression could be read as every minute.

    12.37.0release notes

  • schedule() writes on a passed db, and no longer stores db with the schedule.

    12.37.0release notes

  • Sending to a queue deleted by another instance now rejects with Queue <name> does not exist instead of resolving null; in a passed transaction, COMMIT can fail with 23503.

    12.37.0release notes

  • stop() settles in-flight claims before completing; a claim not ready within the timeout is failed without starting its handler, so shutdown can exceed timeout. With graceful: false the job is failed at once.

    12.37.0release notes

  • Upserting into a queue deleted by another instance now rejects with Queue <name> does not exist instead of resolving null or reporting nothing done.

    12.37.0release notes

  • Jobs waiting on a flow parent are no longer included in readyCount because no worker can fetch them.

    12.36.0release notes

  • resume() moves a job's startAfter up to the time of the call, so wait counting starts when the job can run again.

    12.36.0release notes

  • retry() moves a job's startAfter up to the time of the call, so wait counting starts when the job can run again.

    12.36.0release notes

  • On CockroachDB, failing a batch containing an already completed or cancelled job no longer deletes that job.

    12.35.0release notes

  • A destination collision no longer deletes the dead-lettered job: it remains failed with a reason in output, and is not counted as re-created.

    12.35.0release notes

  • Job now declares retryCount, moved from JobWithMetadata; code that constructs Job objects by hand needs to provide it.

    12.35.0release notes

  • On queues with heartbeatSeconds, the handler's signal is aborted when a heartbeat finds the job is no longer active under that worker's claim.

    12.35.0release notes

  • tick() waits for pg-boss statements in flight before starting, after each fired timer, and at the target time; tick() or setTime() rejects while either is in progress.

    12.35.0release notes

  • On CockroachDB, fetch() now returns integer fields, including sourceRetryCount, as numbers.

    12.34.0release notes

  • On CockroachDB, findJobs() now returns integer fields, including sourceRetryCount, as numbers.

    12.34.0release notes

  • On CockroachDB, getJobById() now returns integer fields, including sourceRetryCount, as numbers.

    12.34.0release notes

  • When redriven jobs collide under a destination's short policy, PostgreSQL now keeps the older one; on CockroachDB either one may be kept.

    12.34.0release notes

  • When redriven jobs collide under a destination's singleton policy, PostgreSQL now keeps the older one; on CockroachDB either one may be kept.

    12.34.0release notes

  • Forward time jumps fire overdue timers once on the next tick and reset interval periods from the new time; backward jumps leave pending timers alone, and calls during a tick now throw.

    12.34.0release notes

  • CockroachDB refuses transactional workers on queues with heartbeatSeconds; a heartbeat arriving after registration fails the batch before its transaction opens.

    12.32.0release notes

  • Registration rejects perJobResults when transactional is enabled because a transaction has a single outcome.

    12.32.0release notes

  • Transactional workers run the handler and job completion in one transaction. The handler receives the transaction db as a second argument; a thrown error rolls back both handler writes and completion.

    12.32.0release notes

  • Reads the schedule row for a name and key, returning null when none exists; the key defaults to the empty string.

    12.31.0release notes

  • Schedules without a time zone are backfilled to UTC, and the column now defaults to UTC instead of evaluating in the instance's local zone.

    12.31.0release notes

  • The orderByCreatedOn fetch option is deprecated and ignored; jobs are always fetched in priority and creation order.

    12.30.0release notes

  • Reports indexes not owned by the connected role before attempting them and sets a non-zero exit code.

    12.29.0release notes

  • Index rebuilding is on by default during maintenance; set reindex: false to keep detection and warnings without rebuilding.

    12.29.0release notes

  • publish() rejects with an AggregateError when sends to subscribed queues fail, identifying each source queue.

    12.28.1release notes

  • partitionTables now takes records with tableName and policy instead of strings, allowing migration scripts to target partitions according to queue policy.

    12.28.0release notes

  • schedule() now rejects an unusable time zone up front instead of storing a schedule with a bad timezone.

    12.28.0release notes

  • Strings beginning with an ISO 8601 calendar date are now treated as date times in send-related operations and update()/upsert(); zone-less date times are pinned to UTC.

    12.28.0release notes

  • An empty schema value is rejected instead of passing validation and producing unparseable DDL.

    12.27.0release notes

  • start() refuses to install into a schema when a case variant already contains a pg-boss installation, preventing jobs from appearing to vanish into a different schema.

    12.27.0release notes

  • DELETE and cache-eviction errors now reject; deleting a nonexistent queue remains a no-op.

    12.26.0release notes

  • Only unique-constraint violations are treated as an empty fetch; other database errors propagate, and direct fetch() calls reject.

    12.26.0release notes

  • Passing the same explicit job id twice in one batch now throws instead of silently deduplicating.

    12.26.0release notes

  • Migration from a database version below the oldest supported starting version now fails with a clear message instead of applying migrations over missing steps.

    12.26.0release notes

  • The obsolete keepUntil insertion-time type is dropped.

    12.25.0release notes

  • Flow processing moved from job completion CTEs to an async worker for performance; the worker is gated behind the supervise option.

    12.22.0release notes

  • Jobs are aborted when the graceful shutdown period expires.

    12.7.0release notes

  • The overloads were simplified to offWork(name, options).

    12.2.0release notes

  • Removes the exported policies constant from the package.

    12.1.1release notes

  • Removes the unused QueuePolicies type from the package's exports.

    12.1.1release notes

  • The default export was removed; switch require() or import to use the PgBoss named export.

    12.0.0release notes

  • Static functions and constants previously accessed on the PgBoss class are now named exports.

    12.0.0release notes

  • Static functions and constants previously accessed on the PgBoss class are now named exports.

    12.0.0release notes

  • Static functions and constants previously accessed on the PgBoss class are now named exports.

    12.0.0release notes

  • The minimum Node.js version was increased to support require(esm).

    12.0.0release notes

  • Use the named PgBoss export instead of the default export when requiring or importing the package.

    12.0.0release notes

  • Static functions and constants previously accessed on the PgBoss class are now named exports.

    12.0.0release notes

  • Queue names now only support letters, numbers, hyphens, underscores, or periods; review existing names before upgrading.

    12.0.0release notes

  • Scheduling keys now only support letters, numbers, hyphens, underscores, or periods; review existing names before upgrading.

    12.0.0release notes

  • Static functions and constants previously accessed on the PgBoss class are now named exports.

    12.0.0release notes

Deprecations 3

  • The singletonsActive field on getQueue() and getQueues() is deprecated and will be removed in the next major.

    12.37.1release notes

  • backend: 'yugabytedb' still works but emits a Node DeprecationWarning with code PGBOSS_DEP_YUGABYTEDB and will be rejected in the next major.

    12.37.0release notes

  • The priority fetch option is deprecated and ignored; jobs are always fetched in priority and creation order. Its use emits a Node DeprecationWarning.

    12.30.0release notes

New APIs and options 117

  • Returns at most 1,000 rows by default in version and creation order; supports limit and after paging.

    12.38.0release notes

  • Returns at most 1,000 rows by default in key order; supports limit and after paging.

    12.38.0release notes

  • Returns at most 1,000 rows by default, ordered by queue name and id; supports limit and after paging.

    12.38.0release notes

  • Returns at most 1,000 rows by default, oldest first; supports limit and after paging.

    12.38.0release notes

  • Returns at most 1,000 rows by default in name order; supports limit and after paging through its options argument.

    12.38.0release notes

  • Returns at most 1,000 rows by default, ordered by queue name and key; supports limit and after paging.

    12.38.0release notes

  • An options type for bounded list reads is now exported.

    12.38.0release notes

  • The options type for previewRedrive is now exported.

    12.38.0release notes

  • getUninstallPlans(schema, { backend }) returns SQL to remove pg-boss objects from a shared schema without CASCADE.

    12.37.0release notes

  • The uninstall command prints SQL to remove pg-boss objects from a shared schema without CASCADE.

    12.37.0release notes

  • Pass attempts to retry start after database failures, waiting 1 second between tries and doubling up to 30 seconds; configuration AssertionErrors are not retried.

    12.37.0release notes

  • getQueue() and getQueues() report jobs waiting on a flow parent as blockedCount.

    12.36.0release notes

  • Lists pg-boss instances registered in the database with runtime information.

    12.36.0release notes

  • Schema 44 adds an instance table, and each PgBoss object now keeps a row there with runtime information.

    12.36.0release notes

  • A new constructor property lets you change the default 30-second instance heartbeat.

    12.36.0release notes

  • A new constructor property lets you name the registered instance.

    12.36.0release notes

  • pg-boss creates messaging-semantic-convention spans and metrics through @opentelemetry/api; without a registered SDK they are no-ops.

    12.36.0release notes

  • The constructor option can disable OpenTelemetry instrumentation with enabled: false.

    12.36.0release notes

  • The OpenTelemetry constructor option accepts a meter provider.

    12.36.0release notes

  • Opt-in trace propagation stores trace context on jobs so workers continue the producer's trace across retries, dead lettering and redrive.

    12.36.0release notes

  • The OpenTelemetry constructor option accepts a propagator.

    12.36.0release notes

  • The OpenTelemetry constructor option accepts a tracer provider.

    12.36.0release notes

  • getQueueStats() accepts percentiles and returns wait and run time percentile values for each snapshot.

    12.36.0release notes

  • Queue snapshots report how long the oldest ready job had waited at the monitor pass.

    12.36.0release notes

  • Short-lived processes such as serverless functions should set registerInstance: false to avoid each invocation reading as a crash when stop() is not used.

    12.36.0release notes

  • Counted monitor passes expose a 48-bin histogram of job run times.

    12.36.0release notes

  • Schema 44 adds a job column for stored trace context used by opt-in trace propagation.

    12.36.0release notes

  • Counted monitor passes expose a 48-bin histogram of how long finished jobs waited before a worker started them.

    12.36.0release notes

  • Accepts a fetched job or an { id, retryCount } object to settle only the attempt that was fetched; a plain id still applies to the current attempt.

    12.35.0release notes

  • Queue stats snapshots include the number of jobs completed since the previous monitor pass when persistQueueStats is enabled.

    12.35.0release notes

  • Queue stats snapshots include the number of jobs created since the previous monitor pass when persistQueueStats is enabled.

    12.35.0release notes

  • Accepts a fetched job or an { id, retryCount } object to apply only to the attempt that was fetched; a plain id still applies to the current attempt.

    12.35.0release notes

  • Queue stats snapshots include the end time of the throughput interval, which is 10 seconds before capturedOn.

    12.35.0release notes

  • Queue stats snapshots include the number of seconds covered by the throughput counters.

    12.35.0release notes

  • Queue stats snapshots include terminal failures since the previous monitor pass; jobs that will be retried are not counted.

    12.35.0release notes

  • Reports whether a cron pass is in flight.

    12.35.0release notes

  • Dead-lettered jobs expose the failed original's output as sourceOutput; their own output starts empty.

    12.35.0release notes

  • Links every dead-letter and redrive hop to the original job id, enabling lineage lookup after intermediate failed jobs are deleted.

    12.35.0release notes

  • Previews a redrive without moving jobs, returning the total, destinations, and unroutable count; it accepts the same options as redrive() except limit.

    12.34.0release notes

  • redrive() can filter jobs by when they arrived in the dead letter queue; a shared cutoff can keep jobs arriving during repeated calls out of the sweep.

    12.34.0release notes

  • redrive() can filter dead-letter jobs by payload, matched the same way as findJobs().

    12.34.0release notes

  • redrive() can be restricted to specified job ids in the dead letter queue.

    12.34.0release notes

  • Schema 42 creates a function through which pg-boss statements read the clock, enabling TestClock to control database time.

    12.33.0release notes

  • The --fix option repairs a leftover TestClock override on job_now() and reruns the scan; only use it when no live TestClock is held against the schema.

    12.33.0release notes

  • Pass a TestClock using the new clock constructor option to control queue timing in tests.

    12.33.0release notes

  • TestClock lets tests advance JavaScript dates, PostgreSQL timestamps, and worker polling together without waiting for real time.

    12.33.0release notes

  • IDatabase gains an optional method returning a transaction handle with db, commit(), and rollback(). Custom db adapters can implement it to enable transactional workers.

    12.32.0release notes

  • A warning event reports when the server cannot identify its transaction timeout parameter and handlers run without a database-side bound.

    12.32.0release notes

  • A warning event reports when a transactional worker is registered on a pool with no connections to spare.

    12.32.0release notes

  • Sets the database-side limit for a handler's transaction. It defaults to expireInSeconds plus five seconds, and 0 removes the limit.

    12.32.0release notes

  • A config-file backend profile selects the engine-specific behavior for CLI commands.

    12.31.0release notes

  • Adapts Bun's SQL client for use as the pg-boss db option, letting a Bun application share one client and pool.

    12.31.0release notes

  • Accepts a backend profile in its options and can now also receive createSchema: false.

    12.31.0release notes

  • The newly accepted options object exposes createSchema: false for schemas that already exist or are created elsewhere.

    12.31.0release notes

  • Accepts a backend profile in its options so generated migration SQL matches the selected engine.

    12.31.0release notes

  • Accepts a backend profile in its options so generated rollback SQL matches the selected engine.

    12.31.0release notes

  • Schedule rows carry the ID of the most recent job they produced, allowing a schedule to be joined to that run without maintaining a separate record.

    12.31.0release notes

  • A compatibility flag identifies engines that refuse to write a column in the transaction that added it; CockroachDB sets it.

    12.31.0release notes

  • The CLI accepts a backend profile so schema commands emit SQL accepted by the selected engine.

    12.31.0release notes

  • Selects the backend profile for CLI commands when set in the environment.

    12.31.0release notes

  • Purely computes upcoming cron or recurrence-rule occurrences as Date values without a query or started instance; count defaults to 5 and is capped at 1000.

    12.31.0release notes

  • Exports the maximum previewSchedule count so services can validate requests against the same ceiling.

    12.31.0release notes

  • The new missed option selects whether a schedule skips missed occurrences or sends one job for the most recent missed occurrence.

    12.31.0release notes

  • Schema 41 adds a constrained schedule.kind column to record whether a schedule expression is cron or a recurrence rule.

    12.31.0release notes

  • Adds an option to disable vacuum monitoring; it defaults to on and can be set to false to turn monitoring off.

    12.30.0release notes

  • Adds a connection-free entry point that returns SQL plans for index bloat.

    12.29.0release notes

  • Adds an instance method that returns statements for manually rebuilding job indexes, skipping ownership and size filters.

    12.29.0release notes

  • Adds an informational INDEX BLOAT section that does not change the command's exit code.

    12.29.0release notes

  • Adds a CLI command to rebuild bloated job indexes.

    12.29.0release notes

  • Prints the SQL instead of rebuilding indexes.

    12.29.0release notes

  • Rebuilds every job index rather than only bloated ones.

    12.29.0release notes

  • Sets the live entries per page below which an index counts as bloated; the default is 5.

    12.29.0release notes

  • Sets the largest index size eligible for rebuilding; the default is 2 GB.

    12.29.0release notes

  • Sets the minimum number of 8 kB pages for an index to be checked; the default is 128.

    12.29.0release notes

  • Sets how many times larger than its estimated live-entry size an index must be to count as bloated; the default is 4.

    12.29.0release notes

  • Sets how often the index bloat check runs; the default is 1 day.

    12.29.0release notes

  • Accepts a second options argument to skip index work or force rebuilding every job index immediately.

    12.29.0release notes

  • The MigrationPartition type is now exported for callers using the new partitionTables record shape.

    12.28.0release notes

  • Set this option to true to allow installation when another pg-boss installation exists in a schema whose name differs only by case.

    12.27.0release notes

  • Adds a constructor option to tune the interval between listener heartbeat checks. Default 10000.

    12.26.2release notes

  • Adds a constructor option to tune the per-heartbeat query timeout; the listener reconnects if a heartbeat exceeds it. Default 5000.

    12.26.2release notes

  • Adds a constructor option to tune the TCP keepalive initial delay on the listener connection. Default 10000.

    12.26.2release notes

  • Adds a read-only comparison of the live database against pg-boss's expected schema, returning a structured SchemaDriftReport.

    12.26.0release notes

  • Updates the payload and/or options of not-yet-active jobs, targeted by id or singletonKey; supports matching shared keys and returns jobs and an updated count.

    12.25.0release notes

  • Updates matching jobs first and inserts if none match, using the same targeting and match semantics as update().

    12.25.0release notes

  • The dashboard supports dynamic views on the jobs page.

    12.24.0release notes

  • Adds persistQueueStats; the release notes do not specify its behavior or configuration details.

    12.24.0release notes

  • Adds DLQ redrive functionality.

    12.23.0release notes

  • Added a constructor option to configure the flow worker polling interval; it is gated behind the current supervise option.

    12.22.0release notes

  • Added an API to manually do what the flow worker does.

    12.22.0release notes

  • Adds LISTEN/NOTIFY support.

    12.21.0release notes

  • Adds burst mode options for work(), including burstWhenBatchFull.

    12.21.0release notes

  • Adds burst mode options for work(), including burstWhenReadyExceeds.

    12.21.0release notes

  • Batch handlers can settle jobs individually through perJobResults.

    12.21.0release notes

  • Job dependencies can now be defined using flow().

    12.19.0release notes

  • wip is exposed for developers to use.

    12.18.0release notes

  • Transaction adapters are implemented for popular ORMs and SQL builders.

    12.17.0release notes

  • Adds maxPriority as a jobFetch option.

    12.15.0release notes

  • Adds minPriority as a jobFetch option.

    12.15.0release notes

  • Heartbeat functionality is implemented.

    12.12.0release notes

  • Adds a job dashboard for viewing pg-boss jobs.

    12.11.0release notes

  • A new queue policy, key_strict_fifo, is available.

    12.10.0release notes

  • Queued jobs can now be marked complete using complete.

    12.9.0release notes

  • Job fetch can disable created_on sorting.

    12.7.0release notes

  • Jobs can be configured to never be removed.

    12.7.0release notes

  • Adds concurrency configuration and concurrency support.

    12.6.0release notes

  • Adds findJobs.

    12.6.0release notes

  • Exports the QueueOptions type from index so developers can import it from the package entry point.

    12.5.4release notes

  • The InsertOptions type is now exported for developers to use in their code.

    12.5.1release notes

  • Built-in spies are available for improved testability.

    12.5.0release notes

  • An overload lets you delete all jobs from all queues.

    12.5.0release notes

  • A Job is passed with an AbortSignal that aborts when expireInSeconds elapses.

    12.4.0release notes

  • WorkHandler now has a generic return type, allowing developers to specify the type returned by a work handler.

    12.4.0release notes

  • Added the database option and set its default to 10s.

    12.2.0release notes

  • Added the wait option to opt into waiting until the worker finishes all jobs.

    12.2.0release notes

  • Schema creation can now be optionally disabled, allowing developers to control whether pg-boss creates its schema.

    12.1.0release notes

  • A new export provides the expected events you can listen to.

    12.0.0release notes

Performance 5

  • Expired jobs and orphaned dependencies are deleted a queue at a time, with each batch in its own transaction, limiting long-held locks and xmin horizons.

    12.38.0release notes

  • Fetch now walks an index ordered by priority and creation time instead of sorting eligible rows, substantially reducing query time and buffers at the cost of a larger index.

    12.30.0release notes

  • The index was tuned to remove the INCLUDE (covering) clause because it was no longer in use; review the schema migration and plan for reindexing on very large queue tables.

    12.22.0release notes

  • Performance improvements may make pg-boss run faster.

    12.5.2release notes

  • Simplified offWork to remove polling.

    12.4.1release notes

Behavior and default changes 37

  • If registration has not succeeded, a heartbeat now tries to register the instance again; that registration also counts crash restarts.

    12.38.2release notes

  • Once a pending background command is found, pending commands run back to back; commands from one migration on one table run in order and wait for predecessors to complete.

    12.38.0release notes

  • Deletes in batches and resolves to the number of jobs deleted, or null when TRUNCATE is used; failures can leave a partial delete.

    12.38.0release notes

  • On a shared table, deletes jobs in batches before deleting the queue; a failure can leave jobs partially deleted and the queue in place.

    12.38.0release notes

  • Returns one row per status, ordered by status, without a limit.

    12.38.0release notes

  • When enabled, handler_overrun, a failed LISTEN/NOTIFY listener, and a disabled xmin_horizon check are written to the warning table.

    12.38.0release notes

  • Runs pending background migration commands after the migration commits; on failure, exits with an error listing statements left to run by hand.

    12.38.0release notes

  • Without table partitioning, old snapshots are deleted in batches on every supervise pass; with partitioning, whole days are still dropped.

    12.38.0release notes

  • The timeout now bounds how long stop waits for a running background migration command; graceful: false ends the command at once.

    12.38.0release notes

  • Expired jobs are failed in batches, so recovery after a fleet outage uses short transactions.

    12.38.0release notes

  • If a handler outlives its timeout, its worker waits for it to return before fetching again and emits a handler_overrun warning; a handler that never returns holds the worker until stopped.

    12.38.0release notes

  • unschedule() now runs its write on a passed db.

    12.37.0release notes

  • When not set explicitly, connections on a pool created by pg-boss are named pgboss: plus the first 8 characters of the instance id instead of pgboss.

    12.36.0release notes

  • No longer takes at least 500 ms after a worker has done work; waits on worker cleanups within the same deadline instead of polling.

    12.35.1release notes

  • Accepts a fetched job or an { id, retryCount } object to settle only the attempt that was fetched; a plain id still applies to the current attempt.

    12.35.0release notes

  • For dead-letter queues using this policy, only the oldest collision per singletonKey is failed; later jobs remain queued until the key is resolved.

    12.35.0release notes

  • Accepts a fetched job or an { id, retryCount } object to apply only to the attempt that was fetched; a plain id still applies to the current attempt.

    12.35.0release notes

  • On CockroachDB, schema drift detection now reports missing and invalid indexes and functions without comparing their definitions.

    12.34.0release notes

  • The queue backlog warning now includes the queue name and size, making it easier to identify the affected queue.

    12.33.5release notes

  • Each timer schedules its next attempt from when its claim stamped the row, preventing short gaps between passes while still refusing claims before the full interval.

    12.33.1release notes

  • schedule() accepts RFC 5545 recurrence rules and calendar recurrence lines as well as cron expressions, and stores the expression format in the schedule row.

    12.31.0release notes

  • On Bun 1.4.0 and later, pg-boss uses the client's listen support for LISTEN/NOTIFY delivery; older runtimes fall back to polling.

    12.31.0release notes

  • Adds a maintenance warning when no vacuum is running on the table.

    12.30.0release notes

  • A warning is emitted when queue monitoring backs off to give autovacuum a clean window.

    12.30.0release notes

  • Monitoring backs off when scanning takes more than a tenth of autovacuum_naptime, allowing an autovacuum worker a clean window.

    12.30.0release notes

  • Vacuum monitoring is enabled by default and can warn when vacuum is unable to reclaim rows or is disabled.

    12.30.0release notes

  • Adds a maintenance warning when vacuum runs but reclaims nothing, identifying the holder of the pinned horizon and relevant connection details where readable.

    12.30.0release notes

  • Schema drift detection now compares INCLUDE payloads and reports mismatches in differs; comparison is order-insensitive.

    12.28.0release notes

  • Passing null to updateQueue() now clears heartbeatSeconds; omitted options remain unchanged.

    12.28.0release notes

  • Passing null to updateQueue() now clears retryDelayMax; omitted options remain unchanged.

    12.28.0release notes

  • Upgrading runs a migration that adds an index; on partitioned installations BAM builds it concurrently in the background, and getBamStatus() reports progress.

    12.28.0release notes

  • The schema value may be pre-quoted to use PostgreSQL identifiers that are not legal bare names or to preserve mixed case. Quoted and unquoted spellings can refer to different schemas.

    12.27.0release notes

  • Distributed database support was improved.

    12.20.0release notes

  • workId is added to localConcurrency workers and WIP data.

    12.18.0release notes

  • Queue and event names can now contain forward slashes.

    12.13.0release notes

  • Makes migrations asynchronous.

    12.6.0release notes

  • The work method now has a generic return type.

    12.4.0release notes

Tooling 4

  • This package is a new peer dependency, at version range ^1.9.0.

    12.36.0release notes

  • Adds a CLI command that scans for schema drift, prints remediation DDL, and exits with code 1 on drift or 0 when clean.

    12.26.0release notes

  • The CLI supports asynchronous migration exports.

    12.21.0release notes

  • pg-boss adds CLI support.

    12.7.0release notes

Fixes and other changes 93

  • Emitted declarations now include the jobs, requested, affected and settled fields, allowing code that reads affected from complete() to compile.

    12.38.2release notes

  • The data parameter now accepts unknown, so a caught error can be passed to fail() under strict TypeScript settings.

    12.38.2release notes

  • With { db }, subscription lookup now uses the supplied database instead of pg-boss's own pool, avoiding an extra connection and allowing publish after stop().

    12.38.2release notes

  • A failed job with retries left now has its deletion time moved forward along with its retry time, so it is not deleted before the retry runs.

    12.38.2release notes

  • Deletion time is now exactly the retention window after a job's new start time, including when that time moves across a daylight saving change.

    12.38.2release notes

  • Concurrent fetches now recount group activity after claims commit and return over-limit jobs to created before handlers see them; a fetch that returns its whole batch retries up to three times.

    12.38.1release notes

  • Published declarations now include ResolvedConstructorOptions and CompatibilityFlags, fixing TS2724 when projects typecheck dependencies with skipLibCheck: false.

    12.38.1release notes

  • Pool connection setup now runs in pg-pool's onConnect before checkout; setup failures fail checkout and close the connection instead of handing it out unconfigured.

    12.38.1release notes

  • Workers now time polling rounds with the system clock, so setting a configured TestClock back during a round no longer delays the next poll; job timestamps still use the configured clock.

    12.38.1release notes

  • A custom adapter's executeSql must return an array with one result per statement for multi-statement queries; returning only the last result breaks maintenance passes and background migration claims.

    12.38.0release notes

  • Expiry no longer deletes jobs from another queue when jobs share an id on the shared job table.

    12.38.0release notes

  • The old index now remains in place until its replacement has been built, preventing slow fetches after a failed background index build.

    12.38.0release notes

  • Multi-statement query results over postgres-js are flattened, allowing pg-boss to find rows from statements before the last.

    12.38.0release notes

  • Redriving from a dead letter queue on the shared job table now touches only that queue's jobs, avoiding deletion or in-place failure of another queue's job with the same id.

    12.38.0release notes

  • Fetches from singleton and stately queues now check whether a key has an active job instead of relying on the cached list, preventing completed-job keys from staying blocked.

    12.37.1release notes

  • A pass that loses the lock now lets the next pass count its queues, keeping counts within about one interval for getQueue(), getQueueStats(), the dashboard, queue_stats history, and large-queue warnings.

    12.37.1release notes

  • Using pg-boss before start() now reports that start() must be called, rather than naming the internal open().

    12.37.0release notes

  • publish() skips a subscribed queue deleted while it is running, unless the send ran on a passed db.

    12.37.0release notes

  • Concurrent upserts with the same singletonKey now agree on one job instead of inserting duplicates; on CockroachDB, a later upsert may fail with 40001 and is retried up to 3 times when pg-boss owns the transaction.

    12.37.0release notes

  • When truncating without a name or truncating a partitioned queue, zeroes cached queue counts so getQueue() reflects the deletion immediately.

    12.35.1release notes

  • On CockroachDB, jobs with array data can now fail without a JSON syntax error leaving them active.

    12.35.1release notes

  • Fixes JSON payloads being encoded twice by Bun SQL, restoring data-filter matching, schedule updates, and persisted warning data.

    12.35.1release notes

  • The JobAttempt type is now exported for code passing { id, retryCount } to the settle methods.

    12.35.1release notes

  • On CockroachDB, readyCount and failedCount are now returned as numbers.

    12.35.0release notes

  • On CockroachDB, calls using bucketSeconds or maxDataPoints no longer throw.

    12.35.0release notes

  • Runs one pass at a time with the background supervisor; stop() waits for an in-flight call, and calls after stop resolve without running.

    12.35.0release notes

  • redrive() now works on CockroachDB, running the move as three statements in one transaction with the same filters, order, and limit.

    12.34.0release notes

  • Failed dead-letter jobs now retain their source queue metadata when reinserted, allowing redrive() to route them back; jobs that already lost the fields are not repaired.

    12.34.0release notes

  • update() no longer fails on CockroachDB because it no longer uses the unsupported jsonb_exists() function.

    12.34.0release notes

  • updateQueue() no longer fails on CockroachDB because it no longer uses the unsupported jsonb_exists() function.

    12.34.0release notes

  • Scheduled jobs are filed under the minute their occurrence falls in, preventing duplicate, dropped, or lost occurrences and aligning schedule kinds.

    12.33.7release notes

  • A cron pass at an exact whole-minute database clock reading now finds occurrences due at that minute instead of sending them one pass late.

    12.33.6release notes

  • A global pg-types parser returning a value other than a Date no longer breaks pg-boss when it shares the application's connection pool.

    12.33.6release notes

  • Cron workers no longer miss sending scheduled jobs when multiple instances run and cronMonitorIntervalSeconds is set above the default of 30s.

    12.33.4release notes

  • Completes a re-attempt whose index is already valid.

    12.33.3release notes

  • offWork waits for workers that are already stopping, affecting worker shutdown behavior.

    12.33.2release notes

  • A tick now produces a pass; tests that tick twice to get one pass should tick once per expected pass.

    12.33.1release notes

  • A stop after stop({ close: false }) now closes the connection pool.

    12.31.1release notes

  • Array parameters are expanded for drivers that cannot encode JavaScript arrays, also repairing completion paths under fromDrizzle() on bun-sql.

    12.31.0release notes

  • Bun is a supported runtime; pg-boss can use Bun's client through an adapter or the bundled pg driver.

    12.31.0release notes

  • JSON parameters are cast through ::text for drivers that infer statement parameter types and would otherwise reject JSON arguments.

    12.31.0release notes

  • The occurrence key format changes to avoid collisions between distinct queue-name and schedule-key pairs that previously could cause a schedule to lose jobs.

    12.31.0release notes

  • The cron pass evaluates schedules independently, skipping an unevaluable row and emitting one invalid_schedule warning for each broken schedule rather than stopping all scheduling.

    12.28.0release notes

  • Passing null to updateQueue() now clears deadLetter instead of writing the literal string 'null'.

    12.28.0release notes

  • expireInSeconds now accepts exactly 86,400 seconds.

    12.28.0release notes

  • Fetch now picks one eligible FIFO head per singletonKey before applying priority and the batch limit, so a blocked key no longer prevents unrelated keys from being delivered.

    12.28.0release notes

  • Redriven jobs now receive dead_letter from the destination queue and its expiration and heartbeat config, while preserving priority, singletonKey and group.

    12.28.0release notes

  • Catalog comparisons now resolve the configured schema to its stored PostgreSQL name, fixing partition maintenance, schema drift detection, and BAM background index probes for mixed-case bare schema names.

    12.27.0release notes

  • The 50-character limit is now measured in bytes, preventing quoted multibyte names from being truncated by PostgreSQL and diverging from the configured name.

    12.27.0release notes

  • For names that are illegal as bare identifiers, the validation error now includes the quoted schema configuration to use; when quoting would not help, it identifies the blocking rule.

    12.27.0release notes

  • Fixes insert() so group id and tier are persisted.

    12.26.4release notes

  • Fixes the ready sparkline overflowing the dashboard stat card.

    12.26.4release notes

  • Fixes a crash with the postgres.js driver by treating arrays whose elements have no rows property as the row set itself.

    12.26.3release notes

  • Fixes a query plan regression that could make job fetching slow and pin database CPU when a saturated group had a large pending backlog.

    12.26.3release notes

  • The listener detects dead connections and lost subscriptions, reconnects with capped backoff, re-runs LISTEN, and fires the reconnect hook so workers drain missed jobs.

    12.26.2release notes

  • fetch() now includes jobs whose start_after equals now(), so a job inserted with the default start_after is not skipped until the clock ticks.

    12.26.1release notes

  • The adapter now escapes literal jsonb question-mark operators before binding, fixing Undefined binding(s) detected errors in affected queries.

    12.26.0release notes

  • The listener only self-heals after connecting at least once, so an initial connection failure falls back to polling without an untracked reconnect.

    12.26.0release notes

  • When retryBackoff is true and retryDelay is unset, the backoff path now floors the delay to 1 second instead of retrying immediately.

    12.26.0release notes

  • Honors startAfter values of 0 and below, allowing a deferred job to be pulled forward to now.

    12.26.0release notes

  • Fetch errors in a work() loop are routed to the worker's error handler and emitted as an error event.

    12.26.0release notes

  • Warning thresholds are scoped to each instance instead of being shared across instances.

    12.25.1release notes

  • Fixes the public type for spies.

    12.25.0release notes

  • Fixes deadlocks during migrations. Upgrades from 12.20 or earlier should skip incremental upgrades and use this version.

    12.24.1release notes

  • Evicts the queue metadata cache on create, update, and delete.

    12.24.1release notes

  • Fixed an issue with the Drizzle adapter.

    12.23.1release notes

  • All schedules can now be queried.

    12.23.1release notes

  • The release includes changes related to alternative databases.

    12.20.0release notes

  • Startup state is reset after start errors, preventing a failed start from leaving stale state.

    12.19.1release notes

  • Missing public input and option types are now exported for developers to use.

    12.18.3release notes

  • Fixes results being returned as an array of objects instead of a single object.

    12.18.3release notes

  • WIP now emits reliably, including during slow jobs.

    12.18.3release notes

  • Public constructor types no longer have an implicit dependency on @types/pg.

    12.18.2release notes

  • Addresses a database placeholder issue.

    12.18.1release notes

  • Tier capacity is no longer silently ignored when using localGroupConcurrency with tiers.

    12.18.0release notes

  • Its typing now matches pg.PoolConfig, improving compatibility when configuring database options.

    12.17.0release notes

  • Fixes a head-of-line blocking bug in groupConcurrency.

    12.16.0release notes

  • Boss.stop() now waits for pending maintenance, Bam, and Timekeeper work to complete before returning.

    12.15.0release notes

  • The release notes list Proxy as a change but provide no further details.

    12.14.0release notes

  • The deadletter property can be passed as an option when creating a job.

    12.8.0release notes

  • The types.InsertOptions type was updated; the notes do not specify what changed.

    12.7.2release notes

  • The PgBoss constructor option is now publicly visible in TypeScript, allowing developers to use it with the public types.

    12.7.1release notes

  • IDs can be returned when spies are disabled.

    12.7.0release notes

  • Fixes how retry delays are calculated.

    12.6.0release notes

  • Queue stats are now calculated properly when a queue has no jobs.

    12.5.3release notes

  • Calling createQueue no longer mutates the supplied arguments by assigning policy the default value standard when it is missing.

    12.4.0release notes

  • Calling fetch no longer mutates the supplied arguments by assigning batchSize the default value of 1 when it is missing.

    12.4.0release notes

  • Calling work no longer mutates the supplied arguments by assigning batchSize the default value of 1 when it is missing.

    12.4.0release notes

  • Updated package bundling to resolve issues with the Bun runtime and external ESM dependencies such as serialize-error.

    12.3.1release notes

  • Bundled serialize-error so CommonJS projects can work in edge cases.

    12.3.0release notes

  • stop() now waits long enough for all resources and timers to be cleaned up.

    12.2.0release notes

  • Exports the SendOptions type so developers can use it from the package.

    12.1.1release notes

  • A few stray types were fixed.

    12.0.0release notes

pg-boss 1149 changes

Breaking changes 34

  • updateQueue() now throws if policy or partition is passed; their types are updated to match. Create a new queue to change these settings.

    11.1.0release notes

  • The archive() API has been removed.

    11.0.0release notes

  • Archive tables have been removed; completed jobs remain in the job table until they are removed.

    11.0.0release notes

  • This configuration option has been removed.

    11.0.0release notes

  • This configuration option has been removed.

    11.0.0release notes

  • Automatic migration from v10 or lower is not supported because of significant job partitioning changes; move jobs manually via the API or SQL.

    11.0.0release notes

  • Removed with no replacement; see deleteAllJobs(name).

    11.0.0release notes

  • Removed in favor of clockMonitorIntervalSeconds.

    11.0.0release notes

  • Queues no longer automatically get a dedicated table; set partition to true to opt into a dedicated table, intended for high-volume queues.

    11.0.0release notes

  • Removed; use deleteAfterSeconds on a queue or job instead.

    11.0.0release notes

  • Removed; use deleteAfterSeconds on a queue or job instead.

    11.0.0release notes

  • Removed; use deleteAfterSeconds on a queue or job instead.

    11.0.0release notes

  • The constructor-level setting was removed; configure deleteAfterSeconds on a queue or job instead.

    11.0.0release notes

  • Removed in favor of supervise().

    11.0.0release notes

  • The insert() job property was renamed to expireInSeconds, which takes a number.

    11.0.0release notes

  • Replaces the insert() job property expireIn and takes a number.

    11.0.0release notes

  • The includeArchive option has been removed.

    11.0.0release notes

  • getQueueSize(name) has been removed; use getQueueStats(name) for immediate stats that bypass the queue stats cache.

    11.0.0release notes

  • Added to retrieve immediate queue stats while bypassing the queue stats cache.

    11.0.0release notes

  • insert(PgBoss.JobInsert[]) now requires the queue name as its first argument.

    11.0.0release notes

  • The event has been removed.

    11.0.0release notes

  • Removed in favor of maintenanceIntervalSeconds.

    11.0.0release notes

  • Its meaning changed to maintenance, which removes completed jobs according to deleteAfterSeconds and queued jobs whose retention policy expired; it now defaults to 1 day.

    11.0.0release notes

  • The event has been removed; queue monitoring and metrics are now stored in the queue table.

    11.0.0release notes

  • This configuration property has been removed.

    11.0.0release notes

  • Node 22 is now the minimum required version.

    11.0.0release notes

  • Removed with no replacement; see deleteQueuedJobs(name).

    11.0.0release notes

  • Removed in favor of deleteQueuedJobs(name).

    11.0.0release notes

  • Removed for queues and jobs in favor of retentionSeconds.

    11.0.0release notes

  • Removed for queues and jobs in favor of retentionSeconds.

    11.0.0release notes

  • Removed for queues and jobs in favor of retentionSeconds.

    11.0.0release notes

  • Added to limit the growth of exponential backoffs during job retries.

    11.0.0release notes

  • Removed in favor of singletonSeconds.

    11.0.0release notes

  • Removed in favor of singletonSeconds.

    11.0.0release notes

New APIs and options 11

  • The new exclusive queue policy allows only one job to be queued or active.

    11.1.0release notes

  • Queues can override warningQueueSize; the default 0 inherits the constructor value.

    11.0.0release notes

  • Added as an example of a queue-table monitoring and metrics property.

    11.0.0release notes

  • Added to createQueue() and send() to control how long completed jobs remain before removal; the default is 7 days.

    11.0.0release notes

  • Added an optional key argument to retrieve schedules by key.

    11.0.0release notes

  • Added to support multiple schedules per queue, with one schedule per unique key.

    11.0.0release notes

  • Added to control how often queues are monitored; defaults to 60 seconds.

    11.0.0release notes

  • Added an optional key argument to make schedules keyed by unique key easier to use.

    11.0.0release notes

  • Added an event that can notify when a queue backlog grows too large or a query takes too long.

    11.0.0release notes

  • Added as a constructor setting to tune queue backlog warnings; defaults to 10,000.

    11.0.0release notes

  • Added as a constructor setting to tune slow-query warnings; defaults to 30 seconds.

    11.0.0release notes

Behavior and default changes 2

  • The default is 7 days; large-volume queues may need a shorter duration.

    11.0.0release notes

  • Queue monitoring and metrics are now stored in the queue table and can normally be retrieved via getQueues().

    11.0.0release notes

Fixes and other changes 2

  • During supervise, unwraps SQL results when they are returned as an array.

    11.1.2release notes

  • Fixed missing jobs when using unique keys within the same minute.

    11.1.1release notes

pg-boss 1044 changes

Breaking changes 31

  • Automatic migration from v9 or lower is unavailable; jobs must be moved manually via the API or a manual SQL migration.

    10.0.0release notes

  • cancel() now requires a queue name argument.

    10.0.0release notes

  • complete() now requires a queue name argument.

    10.0.0release notes

  • Queues must be created before API or direct SQL inserts work; queues have storage policies and apply default retry and retention policies to new jobs.

    10.0.0release notes

  • This fetch() option was removed in favor of policy queues.

    10.0.0release notes

  • The expired failed state was consolidated into failed.

    10.0.0release notes

  • fail() now requires a queue name argument.

    10.0.0release notes

  • The fetchCompleted() API function was removed as dead letter queues replace completion jobs.

    10.0.0release notes

  • getJobById() now requires a queue name argument, and its returned metadata contract was standardized.

    10.0.0release notes

  • This work() option was replaced by pollingIntervalSeconds.

    10.0.0release notes

  • The minimum required Node.js version is now 20.

    10.0.0release notes

  • Use schedule: false instead of noScheduling: true to disable scheduled cron jobs.

    10.0.0release notes

  • Use supervise: false instead of noSupervisor: true to disable maintenance.

    10.0.0release notes

  • The offComplete() API function was removed as dead letter queues replace completion jobs.

    10.0.0release notes

  • The onComplete option was removed from send() and insert() as dead letter queues replace completion jobs.

    10.0.0release notes

  • The onComplete() API function was removed as dead letter queues replace completion jobs.

    10.0.0release notes

  • Job and archive table columns were renamed to snake case, and the job table is partitioned by name.

    10.0.0release notes

  • This work() option replaces newJobCheckInterval and newJobCheckIntervalSeconds; its minimum value is 0.5 seconds.

    10.0.0release notes

  • The minimum required PostgreSQL version is now 13, and the pgcrypto extension dependency has been removed.

    10.0.0release notes

  • The default is now 2 retries, so handlers that are not idempotent may need retryLimit set to 0.

    10.0.0release notes

  • Use schedule: false to disable scheduled cron jobs; it replaces noScheduling: true.

    10.0.0release notes

  • sendOnce() was dropped in favor of policy queues.

    10.0.0release notes

  • sendSingleton() was dropped in favor of policy queues.

    10.0.0release notes

  • The short queue policy allows only one item to be queued in the created state, replacing sendSingleton() and sendOnce().

    10.0.0release notes

  • The singleton queue policy allows only one active item, replacing the fetch() option enforceSingletonQueueActiveLimit.

    10.0.0release notes

  • The renamed close option now defaults to true.

    10.0.0release notes

  • The stop() option destroy was renamed to close; close defaults to true rather than leaving the internal connection open.

    10.0.0release notes

  • stop() now waits for the default graceful stop timeout of 30 seconds before resolving; set wait to false for the original behavior.

    10.0.0release notes

  • Use supervise: false to disable maintenance; it replaces noSupervisor: true.

    10.0.0release notes

  • This work() option was removed to simplify worker polling use cases.

    10.0.0release notes

  • The handler now always receives an array of jobs, including when processing a single job.

    10.0.0release notes

New APIs and options 9

  • A deadLetter option was added to send(), insert(), and createQueue(); failed jobs can be copied to optional dead letter queues after exhausting retries.

    10.0.0release notes

  • Added deleteJob() to provide fetch-then-delete semantics when job throttling or storage is not desired.

    10.0.0release notes

  • Added priority: false to opt out of priority sorting during job fetching, which may improve fetch performance for large queues not using priorities.

    10.0.0release notes

  • Added isInstalled().

    10.0.0release notes

  • Added maintain() for serverless or externally scheduled maintenance use cases.

    10.0.0release notes

  • The constructor option migrate: false prevents an instance from attempting to migrate to the latest database schema version.

    10.0.0release notes

  • Added schemaVersion().

    10.0.0release notes

  • Added an id option to pre-assign a job id when sending.

    10.0.0release notes

  • The stately queue policy combines short and singleton behavior, allowing only one queued job and one active job.

    10.0.0release notes

Behavior and default changes 3

  • insert() inherits supported settings from policy queues and then global constructor settings.

    10.0.0release notes

  • A primary key was added to the job archive table to support replication use cases such as read replicas or high availability standbys.

    10.0.0release notes

  • send() inherits supported settings from policy queues and then global constructor settings.

    10.0.0release notes

Fixes and other changes 1

  • Prevents singleton/stately batches from activating twice.

    10.4.0release notes