JobMaster

June 21, 2026 ยท View on GitHub

Distributed job orchestration engine for .NET. Built for horizontal scale, designed for resilience.

NuGet (pre)

๐Ÿ“– docs.jobmaster.hugoj0s3.dev


Quick Start

Standalone is the simplest way to run JobMaster. A single database connection handles coordination, job storage, and the transport layer โ€” no additional brokers required.

Register in Program.cs

builder.Services.AddJobMasterCluster(config =>
{
    config.UseStandaloneCluster()
          .ClusterId("Local-Cluster-01")
          .UsePostgres("Host=localhost;Database=jobmaster_db;Username=postgres;Password=pwd")
          .AddWorker();
});

var app = builder.Build();

await app.Services.StartJobMasterRuntimeAsync();

Implement a Job Handler

public sealed class HelloJobHandler : IJobHandler
{
    public async Task HandleAsync(JobContext job)
    {
        var name = job.MsgData.TryGetStringValue("Name") ?? "World";
        Console.WriteLine($"Hello {name}");
        await Task.CompletedTask;
    }
}

Handlers are resolved from the .NET DI container โ€” inject your services (repositories, HTTP clients, etc.) directly into the constructor.

Schedule a Job

IJobMasterScheduler is registered automatically. Inject it anywhere in your application.

app.MapPost("/schedule-job", async (IJobMasterScheduler jobScheduler) =>
{
    var msg = WriteableMessageData.New().SetStringValue("Name", "John Doe");

    await jobScheduler.OnceNowAsync<HelloJobHandler>(msg);

    return Results.Accepted();
}).WithOpenApi();

Core Concepts

JobMaster separates responsibilities into three layers:

  • Cluster Database (Master) โ€” source of truth. Stores jobs, coordinates agents, and persists configuration.
  • Agents (Transport Layer) โ€” ephemeral, high-speed buffers for in-flight jobs. Supports PostgreSQL, MySQL, SQL Server, and NATS JetStream.
  • Workers (Execution Layer) โ€” claim and execute jobs using atomic locks. Scale horizontally with zero downtime.

Recurring Schedules

JobMaster supports recurrence expressions using the NaturalCron library.

// Fluent builder
var expression = NaturalCronBuilder.Every(1).Minutes().Build();
await jobScheduler.RecurringAsync<HelloJobHandler>(expression);

// Expression string
await jobScheduler.RecurringAsync<HelloJobHandler>(NaturalCronExprCompiler.TypeId, "every 1 minutes");

Dashboard & API

JobMaster ships a browser-based dashboard and a REST API for monitoring clusters, jobs, workers, buckets, and agent connections in real time.

dotnet add package JobMaster.Api
dotnet add package JobMaster.Dashboard

Both can run in a completely separate process from your workers โ€” all they need is access to the master database.


Documentation

Full documentation is available at docs.jobmaster.hugoj0s3.dev:


Roadmap

See docs.jobmaster.hugoj0s3.dev/docs/roadmap.