Free forever, no credit card.Get Started for Free →
← All posts
November 11, 2026 · 6 min read

Does pg-boss Remember Between Runs? Jobs Are Stored in Postgres. The Next Job Still Starts With Only Its Data.

Does pg-boss Remember Between Runs? Jobs Are Stored in Postgres. The Next Job Still Starts With Only Its Data. pg-boss is a job queue for Node.js built on PostgreSQL. Instead of adding Redis or another queue service, it stores jobs in the Postgres database an application already runs, and workers claim those jobs with SKIP LOCKED so several workers can share one queue without blocking each other. For a team whose job does AI work on a schedule, that raises a practical question: when the same jo

Does pg-boss Remember Between Runs? Jobs Are Stored in Postgres. The Next Job Still Starts With Only Its Data.

pg-boss is a job queue for Node.js built on PostgreSQL. Instead of adding Redis or another queue service, it stores jobs in the Postgres database an application already runs, and workers claim those jobs with SKIP LOCKED so several workers can share one queue without blocking each other. For a team whose job does AI work on a schedule, that raises a practical question: when the same job runs again tomorrow, does it know anything about today's run? No. pg-boss stores the job, its data, and its state until a worker runs it, and it can keep a completed job for a retention window. The next job still starts with only the data it was sent with. What the last run found, decided, or already handled is not passed along.

A job is a row, and its data is chosen at send time

Sending a job creates a row in pg-boss's own schema in Postgres. That row holds the queue name, the data payload passed to send(), and the delivery options chosen at that moment: priority, a start time for delayed work, retry limits and delays, an expiration window, and uniqueness settings such as singleton or debounce keys. A worker registered with work() then fetches a ready job and receives that job object, including its id and its data.

Read that row closely and its scope becomes clear. Every field answers an execution question. Which queue should run this. With which data. When should it become ready. How long may it stay active before it expires, which defaults to 15 minutes. How many times should it be retried. None of the fields answers a work question: which records did yesterday's run already process, which exception did a person approve, or which conclusion should today's run build on instead of rediscovering it? The job knows how to start. It does not carry a briefing from the job before it.

That data is also fixed in advance by the code that calls send(). It can carry context chosen beforehand, such as an account id or a date range. It is not a place where a finished job automatically writes what it learned for the next job to pick up. If the sending code does not already know a fact at send time, the next job does not learn it from pg-boss.

Completed is a state, not a briefing for the next job

When a handler finishes, pg-boss moves that job to completed. A completed job can carry output data from that one job, and a person or another piece of code can look that specific job up by its id. Completed jobs are not kept as a growing memory. By default they are deleted after a retention period, with deleteAfterSeconds set to seven days after completion in the documented job options. Jobs waiting in a created or retry state have their own retention window as well.

Even while a completed job still exists, pg-boss does not assemble it into a briefing. It does not take yesterday's output, merge it with the outputs before it, and hand the result to tomorrow's handler as part of its data. It does not search past jobs for the same queue and summarize what they established. A handler that wants yesterday's result has to fetch that exact job itself, know its id, and interpret the output itself, all outside the normal flow of claiming the next job. In the normal flow, each job arrives on its own.

Failure follows the same boundary. A failed job can be retried with backoff, can expire, and after its retries can move to a dead letter queue if one is configured. A retry receives the same queue and the same data as the earlier attempt. That is the right design for a transient error. It is not a way to tell the retry what the first attempt managed to finish before it failed, or what a person decided after seeing the failure.

Schedules remember when, not what was learned

pg-boss also handles recurring work directly. A schedule stores a queue name, a cron expression, and the data and options to use each time, so a job can be created every day or every hour without outside code sending it again. That makes the timing durable, even across restarts.

A schedule changes nothing about knowledge. Every firing creates a fresh job from the stored schedule entry, with the same stored data. If Monday's run discovered that a lead was already contacted, that a report was already sent, or that a source had changed its format, Tuesday's scheduled job does not receive that discovery unless some outside system updated the schedule's data or the handler loads it from somewhere else. The schedule is an excellent clock. A clock is not a memory of the work.

The missing layer is shared memory, and it sits beside the queue

None of this is a reason to replace the queue. pg-boss does the job it promises: durable jobs in Postgres, retries with backoff, cron schedules, dead letter queues, priorities, and singleton and debounce policies, all without a separate queue service. The gap appears when the job is an AI agent step in a recurring automation, because that step needs a past, not just a trigger. It needs to start each run already knowing what previous runs established, across every tool in the workflow, not only inside one Postgres schema.

That past is what Vilix AI provides as a shared memory layer. Vilix AI is cloud-hosted, so there is zero infrastructure to run or maintain: no extra database to provision, no memory service to deploy next to the worker. The same memory is available everywhere over MCP, so the pg-boss worker, the chat tool used to review its output, and every other connected agent read and write one shared memory instead of separate local notes. And Vilix AI stores full conversation history, not just extracted facts, so a run can revisit what was actually said and decided, in context, rather than working from a compressed summary.

In practice the split is simple. pg-boss decides when work happens and runs it reliably. Before the job acts, it checks Vilix AI for what earlier runs already found, which items are already handled, and which corrections a person already gave. After the job finishes, it saves its findings back, so the next firing, on any schedule and in any tool, starts briefed instead of blank.

Getting started carries no commitment. Vilix AI has a free plan that is free forever, and a 7-day Pro trial with no credit card required. Data stays under the operator's control, with the ability to export everything or delete it anytime. A queue that stores jobs cleanly in Postgres is a strong foundation for scheduled work. Adding one shared memory beside it is what turns a job that merely runs every day into an agent that remembers every day.

Get Started for Free

Persistent memory across ChatGPT, Claude, and the AI tools you already use in Vilix AI.

Get Started for Free

Free forever, no credit card.

Keep reading
Does Apache RocketMQ Remember Between Runs? Messages Stay in the CommitLog for Days. The Next Run Still Starts With Only Its Message.

Does Apache RocketMQ Remember Between Runs? Messages Stay in the CommitLog for Days. The Next Run Still Starts With Only Its Message. Apache RocketMQ remembers the message, in full, on disk. A broker writes every message it receives into a shared physical log, keeps it for the whole storage duration whether anyone consumed it or not, and lets a consumer go back and read it again inside that window. That is real retention, and it is stronger than a queue that deletes on delivery. What RocketMQ n

How Do You Give a Microsoft Teams AI Agent Memory Between Conversations?

How Do You Give a Microsoft Teams AI Agent Memory Between Conversations? You give a Microsoft Teams AI agent memory between conversations by saving every turn to a store keyed by the Teams user ID, loading the relevant part of that history before each model call, and writing the new exchange and its outcome back after the reply. Teams delivers each message as a separate activity to a stateless bot, so nothing carries over unless your code saves it and loads it again. Why does a Teams AI agent

Does ZeroMQ Remember Between Runs? There Is No Broker and No Store. The Next Run Still Starts With Only Its Message.

Does ZeroMQ Remember Between Runs? There Is No Broker and No Store. The Next Run Still Starts With Only Its Message. ZeroMQ remembers almost nothing, and that is by design. ZeroMQ is not a broker and it is not a server. It is a messaging library that runs inside an application process and gives that process sockets that act like smarter network sockets. Peers connect directly to each other, messages move from one process to another, and there is no central place where messages are filed away. A