pg-boss-v12

Configure pg-boss v12 queues and implement work or fetch job lifecycles.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/sncollective/snc-platform --skill pg-boss-v12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pg-boss-v12
Source: https://github.com/sncollective/snc-platform/tree/main/.claude/skills/pg-boss-v12
Command: npx skills add https://github.com/sncollective/snc-platform --skill pg-boss-v12

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill condenses pg-boss v12 operational guidance into a developer-focused reference that reduces integration mistakes, misconfigured queues, and unreliable background processing in PostgreSQL-backed systems.

Core Features & Use Cases

  • Work vs Fetch Patterns: Explains the differences between work() and fetch()/complete() lifecycles and when to use each for automatic or manual job control.
  • Queue Configuration & Policies: Documents createQueue options, policy choices (standard, singleton, stately, etc.), retry strategies, heartbeat and expiration settings, and retention semantics.
  • Scheduling, Throttling & Chaining: Covers cron scheduling constraints, singleton/debounce/throttle behaviors, job chaining patterns for pipelines, and dead-letter considerations.
  • Use Case: Reliable media processing pipelines (probe → transcode → thumbnail), scheduled maintenance jobs, and throttled notification systems with proper heartbeat, retry, and monitoring settings.

Quick Start

Register queues with explicit options, attach an error listener to the boss EventEmitter, and implement work() handlers that destructure the jobs array and dispatch follow-up jobs with boss.send().

Frequently Asked Questions about pg-boss-v12

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure retry policies in a PostgreSQL job queue?

Retry policies in a PostgreSQL job queue are configured using createQueue options, where you define retry strategies, set heartbeat intervals, and adjust expiration settings to control how failed background jobs are re-queued or dropped.

What is the difference between work and fetch lifecycles for background jobs?

The difference between work and fetch lifecycles is that work() provides automatic job control by processing and completing jobs internally, while fetch() requires manual job handling where you explicitly call complete() to finish the background job.

How do I schedule cron jobs and throttled tasks in Node.js using PostgreSQL?

You can schedule cron jobs and throttled tasks in Node.js using PostgreSQL by applying cron scheduling constraints and singleton, debounce, or throttle policies to control execution frequency and prevent overlapping background job runs.

Does pg-boss support per-entity FIFO queues for background processing?

Yes, pg-boss supports per-entity FIFO queues by applying stately queue policies, ensuring that background jobs for a specific entity are processed sequentially in the exact order they were sent to the PostgreSQL queue.

What is the best way to handle dead-letter queues and safe shutdown in PostgreSQL job queues?

The best way to handle dead-letter queues and safe shutdown in PostgreSQL job queues is to configure dead-letter handling for exhausted retries and implement safe shutdown monitoring to ensure active jobs complete before the process terminates.

How do I chain background jobs for media transcoding pipelines in Node.js?

You chain background jobs for media transcoding pipelines in Node.js by using job chaining patterns to sequence tasks like probe, transcode, and thumbnail, dispatching follow-up jobs with boss.send() after each step completes.