Does Hangfire Remember Between Runs? Jobs Are Stored in a Database. The Next Job Still Starts With Only Its Arguments.
Does Hangfire Remember Between Runs? Jobs Are Stored in a Database. The Next Job Still Starts With Only Its Arguments. Hangfire remembers jobs very well. It writes every job to persistent storage before it runs, tracks each job through its states, and can show the full history in a dashboard. None of that makes the job itself remember. When a job runs, Hangfire reads back one serialized method call and its arguments, creates the job class, calls the method, and records the outcome. Whatever the
Does Hangfire Remember Between Runs? Jobs Are Stored in a Database. The Next Job Still Starts With Only Its Arguments.
Hangfire remembers jobs very well. It writes every job to persistent storage before it runs, tracks each job through its states, and can show the full history in a dashboard. None of that makes the job itself remember. When a job runs, Hangfire reads back one serialized method call and its arguments, creates the job class, calls the method, and records the outcome. Whatever the previous run worked out, beyond the arguments it was given and the state label it ended in, is not handed to the next run.
A job is a stored method call, not a living object
The core design explains the limit. When code calls BackgroundJob.Enqueue or RecurringJob.AddOrUpdate, the client serializes the method invocation, including its argument values, into storage backed by SQL Server, Redis, PostgreSQL, or another supported store. A Hangfire server later fetches that record, deserializes the call, activates the job type, usually through dependency injection, and invokes the method.
That record is an instruction, not a workspace. It holds the method name, the type, the queue, and the serialized arguments. There is no field in it for what a run concluded, which records it skipped, or why it chose one item over another. An argument value is frozen at enqueue time, which is why the standing guidance for Hangfire is to pass stable identifiers, such as a customer ID or an order ID, and load current data inside the job. The job starts from the ID. It does not start from last time's understanding of that customer.
Fields on the job class behave the same way. A fresh instance is activated for each execution, so a value set on an object during a Monday run is not present on Tuesday. Anything that needs to survive has to be written somewhere else, deliberately, by the job code itself.
What storage actually keeps: states, history, and the recurring registration
Hangfire does keep a real record, and it is worth naming exactly what that record contains. Each job moves through states such as Enqueued, Processing, Succeeded, and Failed, and every state change is written to the job's history. Storage also holds scheduled jobs waiting for their time, retry counts, and exception details for failures. The dashboard reads this record, which is why it can list what ran, what failed, and why it failed.
Recurring jobs add one more stored item: the registration. A recurring job is stored under its unique ID with its cron expression and its serialized method call. On each due time, the scheduler enqueues a new, ordinary fire-and-forget job from that registration. The new job is a copy of the instruction. It carries no output, notes, or partial progress from the previous occurrence.
Retention underlines the point. Succeeded jobs are kept for a limited window by default, commonly one day, and then expire out of storage. Failed jobs stay until someone retries or deletes them. This is an operations log with an expiry policy, designed for monitoring and retries. It was not designed as a place a later run reads its own past reasoning from.
Continuations look like an exception and are not one. A continuation runs after its parent finishes, and it receives the parent job's ID. It does not automatically receive the parent's result, notes, or working context. If the next step needs what the first step learned, the first step has to store that learning somewhere readable and the second step has to fetch it, by hand.
Where this leaves scheduled AI work
Put an AI step inside a Hangfire job and the shape becomes clear. A nightly job scans new support tickets, drafts replies in an approved tone, and flags the ones a human should see first. Hangfire guarantees the job runs, retries it up to ten times by default if it throws, and shows the failure if it keeps failing. The schedule and the delivery are solid.
The memory questions sit one level up. Which tickets did last night's run already draft replies for? Which wording did a reviewer edit before sending, so tonight's drafts use the corrected tone? Which account was flagged yesterday for a problem that is still open? The stored job answers none of these. Its arguments say which queue or account ID to process. Its history says the run succeeded. Between those two facts sits everything the next run actually needs, and teams usually end up building it themselves: a results table here, a summary file there, and a prompt rebuilt from fragments at the start of every run.
A memory layer the next run can actually read
Vilix AI is built for that missing layer. It is cloud-hosted with zero infrastructure to manage, so a Hangfire job, a script, and a chat tool can all reach the same memory without another database to provision or maintain. The memory follows over MCP, which means the same memory is available everywhere the work happens, not locked inside one scheduler's storage or one application's tables.
What is stored matters as much as where it lives. Vilix AI keeps full conversation history, not just extracted facts, so a later run can revisit what was actually decided, drafted, and corrected, in context. The nightly job can save its working history at the end of a run, and the next run can load the relevant part at the start: tickets already handled, tone already approved, flags already raised. Hangfire keeps doing what it is good at, durable delivery of the instruction, while the working memory lives in a layer designed to hold it.
Getting started is kept deliberately light. Vilix AI has a free plan forever, and Pro offers a 7-day trial with no credit card required. Data stays under the user's control, with the ability to export everything or delete it anytime. One recurring job is enough to test the pattern: save the run's history at the end, read it back at the start of the next run.
The short answer
Does Hangfire remember between runs? It remembers the job: the serialized method call, its arguments, its state history, and the recurring registration that creates the next occurrence. It does not remember the run: what the job found, decided, or produced, beyond a state label and, for failures, an exception. For delivery and retries, the stored job is enough. For scheduled AI work that needs its own history back, the memory needs to live outside the job record, in a shared layer like Vilix AI that every run and every tool can read.