Workly

PgQueuer alternative

A Postgres-backed queue without the workers.

PgQueuer gets a lot right: jobs live in Postgres, not a broker, and there's no separate scheduler. But the work still runs in async Python workers you deploy, scale and watch. Workly keeps Postgres and drops the workers. Your job is an endpoint in the app you already deploy, in any language, and Workly calls it, with retries, rate limits and schedules, and keeps every attempt.

The jobs stay in Postgres; the work moves to your app.

Workers pull; Workly pushes. Since the work happens in an HTTP request to your app, what's around it changes.

With PgQueuer
With Workly
Worker processes, deployed and scaled next to the app
Your app, which already serves HTTP
Queue tables, claims and logs in your application database
Its own Postgres, or none of yours when hosted
A retry executor on each entrypoint that should retry
Retries per queue, on by default
A job to prune pgqueuer_log
Retention, built in
Handlers in async Python
Handlers in anything that serves HTTP

Workly and PgQueuer compared.

Both keep jobs in Postgres, deliver at least once and deduplicate on enqueue. The differences are in who runs the work, what's on by default, and what you can see afterwards.

PgQueuerWorkly
ModelA Python library: async workers claim jobs from your Postgres with FOR UPDATE SKIP LOCKEDA server: Workly pushes each task to your endpoint as an HTTP request
What you runWorker processes (pgq run), deployed with your code, against your application databaseOne server plus Postgres, or hosted at workly.run. Your handlers run in the app you already deploy
LanguagesPython, with async def handlers; sync code can enqueue through psycopgAny: a handler is an HTTP endpoint, sync or async. Python and TypeScript SDKs
EnqueueIn the same transaction as your data, so a job exists only if the row it is about doesAn API call, after your transaction commits; an idempotency_key makes retrying it safe
PayloadsBytes; encoding and decoding are up to youJSON, or any body with its own content type, plus headers
RetriesOpt in per entrypoint (DatabaseRetryEntrypointExecutor), or raise RetryRequested; otherwise a failure is finalOn by default: backoff with jitter, honours Retry-After, per-queue policy
After the last retryDeleted and logged with its traceback, or kept with on_failure="hold" for pgq requeueKept as failed with every attempt, grouped by error; retry one or a whole group once the fix is in
Crashed workerThe job is picked up again once its heartbeat is stale (heartbeat_timeout)No workers to crash. If Workly stops mid-delivery, the attempt is recorded as lost and delivered again
Rate limitsConcurrency per entrypoint (concurrency_limit); requests per second was removed in 1.0max_concurrency and rate_per_second per queue
Deduplicationdedupe_key, while the job is queued or runningidempotency_key, for as long as the task is kept, and a stable Workly-Task-Id header
Schedules@pgq.schedule with cron in UTC, run by the workersSchedules in the server: cron in your timezone, overlap policy, run history, run-now
Fan-inNot built in: jobs are independentTask groups: one callback with the counts when every task has finished
WorkflowsNot built in (River and Oban have workflows in their Pro editions)DAGs of HTTP steps in workly.yaml, each a task; a step can wait for a task group
VisibilityTerminal and web dashboards (pgq dashboard, pgq web), Prometheus, a read-only MCP server, SQL on the log tableDashboard with every attempt’s status, error and response body, MCP that can also retry and pause, and Prometheus metrics when self-hosted
Historypgqueuer_log keeps growing until you prune itKept for a set time (7 days by default), then deleted
Job lengthNo limit: a job runs as long as the worker doesOne HTTP request: up to 30 minutes per attempt

PgQueuer behaviour from its documentation (v2.0), November 2026.

An entrypoint becomes an endpoint.

The function body stays the same. It moves behind a route in your web app, gets its arguments from the JSON payload, and answers 2xx when it's done; anything else is retried, with no executor to configure.

PgQueuer
import json
from contextlib import asynccontextmanager
from datetime import timedelta

import asyncpg
from pgqueuer import PgQueuer
from pgqueuer.executors import DatabaseRetryEntrypointExecutor
from pgqueuer.models import Job

@asynccontextmanager
async def main():
    pool = await asyncpg.create_pool()
    pgq = PgQueuer.from_asyncpg_pool(pool)

    @pgq.entrypoint(
        "send_email",
        executor_factory=lambda params: DatabaseRetryEntrypointExecutor(
            parameters=params, max_attempts=5,
            initial_delay=timedelta(seconds=1),
        ),
    )
    async def send_email(job: Job) -> None:
        user_id = json.loads(job.payload)["user_id"]
        ...

    yield pgq

# In a request handler
await queries.enqueue("send_email", json.dumps({"user_id": 123}).encode())

# And in production, alongside the app:
#   pgq run tasks:main
Workly
import json

from workly import AsyncWorkly, SignatureVerificationError, verify_signature

workly = AsyncWorkly()  # WORKLY_URL, WORKLY_API_KEY

# In a request handler
await workly.tasks.enqueue(
    "emails",
    url="https://api.example.com/tasks/send-email",
    payload={"user_id": 123},
)

# The task is an endpoint in the app you already run
@app.post("/tasks/send-email")
async def send_email(request: Request):
    body = await request.body()
    try:
        verify_signature(body, request.headers)
    except SignatureVerificationError:
        raise HTTPException(401)
    user_id = json.loads(body)["user_id"]
    ...
    return Response(status_code=204)

And schedules leave the workers.

PgQueuer's schedules run in your workers, in UTC. Workly's run on the server, in the timezone you give them, are retried and signed like tasks, and each run is recorded, with a button to run one now.

PgQueuer
from pgqueuer.models import Schedule

# Cron in UTC; runs in whichever worker is up
@pgq.schedule("nightly_report", "0 2 * * *")
async def nightly_report(schedule: Schedule) -> None:
    ...
Workly
# workly.yaml, applied with `workly deploy`
version: 1
schedules:
  nightly-report:
    cron: "0 3 * * *"
    timezone: Europe/Stockholm
    url: https://api.example.com/tasks/nightly-report

See why a job failed without writing SQL.

Every task keeps its attempts: status code, error, response body and timing, with nothing to prune. Failed tasks are grouped by error, so after a bad deploy you fix the handler and retry the whole group. Queue depth, delivery rate and the age of the oldest due task are in the dashboard.

A failed task in the Workly dashboard, explaining why it failed, with every attempt's response.

When PgQueuer is the better choice.

Jobs must commit with your data

PgQueuer's enqueue is an insert in your transaction: if the order is rolled back, so is its receipt job. Workly is a separate service, so you enqueue after the commit, or write an outbox row and enqueue from it.

Everything is async Python on one database

If the workers are already there and you want the fewest moving parts, a library on the database you run is hard to beat: no service to add, nothing to call over the network.

Jobs run longer than 30 minutes, or there is no web service

Each Workly attempt is one HTTP request. A worker can run a job for hours, and needs no endpoint, which suits scripts and data pipelines.

Questions

Both use Postgres. What is the difference?
Where the work runs. PgQueuer is a library: your Python workers poll your database and run the jobs. Workly is a server with its own database that calls your app over HTTP, so there are no workers, and the handler can be in any language. Hosted Workly needs no database on your side at all.
Can Workly enqueue in the same transaction as my data?
No. Enqueueing is an API call, so do it after the commit. If the job must never be lost when the call fails, write it to an outbox table in your transaction and enqueue from there; the idempotency key makes sending it twice harmless.
Does Workly put load on my database?
Self-hosted, it uses whichever Postgres you point it at: its own, or a separate database on the same server. Hosted, it uses none of yours. With PgQueuer, claims, heartbeats and logs run on the database your application queries.
What about River, pg-boss or Oban?
The same comparison holds: they are job libraries on your Postgres, for Go, Node and Elixir. Workly trades the workers for HTTP delivery, and adds retries by default, rate limits per queue, schedules in your timezone and attempt history.
Is HTTP delivery slower than a worker?
Slightly: each task is an HTTP request. In Workly's load tests on one server, the median from enqueue to delivery was a few milliseconds at 1,000 tasks a second. For background jobs that is rarely what matters.
How do I move over gradually?
Entrypoint by entrypoint. Turn one into an endpoint, enqueue it with Workly instead of queries.enqueue, and keep the rest on PgQueuer until you're ready. The two don't interfere, even on the same Postgres server.

Try it in five minutes.

pip install "workly[cli]" and workly dev give you a server and dashboard on your laptop, with nothing else to start. Or sign in to hosted Workly and get a workspace and an API key in a minute, free on the Hobby plan.