Skip to content

Surefire

Distributed job scheduling for .NET with a minimal API style.

Minimal API style

Register jobs with delegates using the same fluent style as endpoint mapping. Parameters resolve from DI and from arguments passed when triggering a run.

Distributed

Runs across multiple nodes with coordinated claiming and retry handling. Nodes can register the same or different jobs.

Built-in dashboard

Live logs, progress, run history, node monitoring, and a REST API.

Job configuration

Cron, retries, queues, rate limits, timeouts, lifecycle callbacks, filters, streaming with IAsyncEnumerable<T>, and OpenTelemetry.

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSurefire();
var app = builder.Build();
app.AddJob("Add", (int a, int b) => a + b);
app.AddJob("DataImport", async (ILogger<Program> logger, CancellationToken ct) =>
{
for (var i = 1; i <= 10; i++)
{
logger.LogInformation("Step {Step}/10", i);
await Task.Delay(1000, ct);
}
}).WithDescription("Imports data")
.WithCron("* * * * *");
app.MapSurefireDashboard();
app.Run();