Skip to content

Surefire

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

Minimal API style

Register jobs the same way you map endpoints. Parameters resolve from DI and run arguments. Native AOT and trimming support.

Distributed

In-memory by default, or use the PostgreSQL, SQL Server, SQLite, or Redis providers for distributed 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>, durable orchestration, and OpenTelemetry.

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSurefire();
builder.Services.AddSurefireDashboard();
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();