I need to implement a complex background process in ASP.NET Core where multiple data import tasks execute in parallel, followed by a final summary email notification once all import tasks complete successfully.
Chaining Jobs in Hangfire
I am trying to determine if standard Hangfire features support continuation workflows for groups of background jobs, or if Hangfire Pro (Batches) is strictly required.
Single Job Continuation Example
// Enqueue the initial background job
string parentJobId = BackgroundJob.Enqueue(() => Console.WriteLine("Importing Chunk 1"));
// Attach a continuation that runs after the parent job finishes
BackgroundJob.ContinueJobWith(parentJobId, () => Console.WriteLine("Chunk 1 complete!"));How can I trigger a final completion task after a dynamic list of N jobs finishes if I am using open-source Hangfire? What strategies exist to achieve batch job behavior without upgrading to a commercial license?
The key difference is that Hangfire’s standard offering supports continuations between individual jobs, while Hangfire Pro adds a native batch API for grouping jobs and continuing after a batch.
Hangfire Pro: fan out, then continue
Use a batch when several independent jobs should be created together and a later step should wait for that group:
The child jobs can run in parallel, subject to available workers, and their execution order is not guaranteed. A batch continuation is the useful fan-in point: it lets you express that later work depends on the batch as a whole. Check the continuation options for your Hangfire Pro version if the follow-up should run under conditions other than the default success behavior.
Standard Hangfire: continuations are per job
Core Hangfire provides
BackgroundJob.ContinueJobWith, which attaches a continuation to one parent job:If you enqueue several jobs in Standard, attaching a continuation to one of them does not make it wait for the others. There is no native batch-level continuation or batch creation API in the standard offering.
Choosing between them
In short, standard Hangfire has individual job continuations; Hangfire Pro adds the batch abstraction. Choose based on whether you need a genuine “after all these jobs” workflow, rather than just a follow-up to one job.