Skip to content

Configuration

Pass options to AddSurefire to tune runtime behavior:

builder.Services.AddSurefire(options =>
{
options.NodeName = "worker-1";
options.PollingInterval = TimeSpan.FromSeconds(5);
options.ShutdownTimeout = TimeSpan.FromSeconds(30);
options.RetentionPeriod = TimeSpan.FromDays(14);
options.MaxNodeConcurrency = 16;
});
OptionDefaultDescription
NodeNameMachine nameName reported in node views and logs
PollingInterval5sFallback polling interval when notifications are not available
HeartbeatInterval30sNode heartbeat interval
InactiveThreshold2minInactivity window used for node/run recovery decisions
RetentionPeriod7 daysHow long completed runs are kept. Set to null to disable purge
RetentionCheckInterval5minHow often retention cleanup runs
ShutdownTimeout15sTime allowed for in-flight runs during host shutdown
MaxNodeConcurrencynullMaximum concurrent executions on this node
AutoMigratetrueRuns store migrations at startup
SerializerOptionsJsonSerializerOptions.Web-basedJSON options for arguments and results

AddSurefire already registers a health check named surefire. To expose it:

app.MapHealthChecks("/health");
app.MapSurefireDashboard(); // /surefire
app.MapSurefireDashboard("/admin"); // /admin

The dashboard is embedded in the Surefire.Dashboard package. No separate frontend build step is required.

In production, secure the dashboard endpoints:

app.MapSurefireDashboard()
.RequireAuthorization("AdminPolicy");