Running Jobs One At A Time

I am currently using Hangfire’s Enqueue functionality to fire background task which is working like a dream! However, I would like to allow one job to finish before starting another.

I can’t find in the documentation if there is a way to queue up jobs in such a way that allows on task to complete before another one can run. Could anyone provide any guidance?

Thanks!

You can enqueue Continuation Jobs: https://www.hangfire.io/overview.html#continuations

var firstJobId = BackgroundJob.Enqueue(() => doSomething());
var secondJobId = HangfireServer.ContinueWith(firstJobId, () => thenDoThis());