Flowly.Jobs
1.3.1
dotnet add package Flowly.Jobs --version 1.3.1
NuGet\Install-Package Flowly.Jobs -Version 1.3.1
<PackageReference Include="Flowly.Jobs" Version="1.3.1" />
<PackageVersion Include="Flowly.Jobs" Version="1.3.1" />
<PackageReference Include="Flowly.Jobs" />
paket add Flowly.Jobs --version 1.3.1
#r "nuget: Flowly.Jobs, 1.3.1"
#:package Flowly.Jobs@1.3.1
#addin nuget:?package=Flowly.Jobs&version=1.3.1
#tool nuget:?package=Flowly.Jobs&version=1.3.1
Flowly.Jobs
Job state tracking and CRON scheduling for Flowly. Track long-running work through Created → Started → Completed / Failed with persistent state in SQL Server or PostgreSQL.
Quick Start
Also install a database backend: Flowly.Jobs.SqlServer or Flowly.Jobs.Postgres.
Define a job message
public record ProcessReportJob(Guid ReportId, DateOnly Period) : IJobMessage
{
public string Description => $"Process report {ReportId}";
public string JobTypeName => nameof(ProcessReportJob);
}
Write a job handler
[RetryPolicy(maxRetries: 2, delaySeconds: 120)]
public class ProcessReportJobHandler : JobHandler<ProcessReportJob>
{
public override async Task Handle(IJobMessageContext<ProcessReportJob> ctx)
{
await ctx.SaveState(new { Step = "Fetching data" });
var data = await FetchData(ctx.Message.ReportId, ctx.CancellationToken);
await ctx.SaveState(new { Step = "Generating PDF", Rows = data.Count });
await GeneratePdf(data, ctx.CancellationToken);
}
}
Register and submit
builder.AddFlowly(configure => configure
.UseAzureServiceBus("AzureServiceBus")
.AddSqlServerJobStateTracking("Jobs")
.AddJobHandler<ProcessReportJob, ProcessReportJobHandler>()
.AddJobSubmitter<ProcessReportJob>());
public class ReportController(IJobMessageSender jobSender)
{
public Task<Guid> StartReport(DateOnly period, CancellationToken ct)
=> jobSender.QueueJob(new ProcessReportJob(Guid.NewGuid(), period), ct);
}
Recurring Jobs
[RecurringJob("Nightly Report", "0 2 * * *")]
public class NightlyReportJob : RecurringJobHandler
{
public override async Task Handle(CancellationToken ct)
=> await GenerateReport(ct);
}
builder.AddRecurringJob<NightlyReportJob>();
The scheduler polls every 5 seconds and guarantees single execution across replicas using session-based queues.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Flowly (>= 1.3.1)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.9)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Flowly.Jobs:
| Package | Downloads |
|---|---|
|
Flowly.Jobs.Postgres
PostgreSQL backend for Flowly job state tracking. |
|
|
Flowly.Jobs.SqlServer
SQL Server backend for Flowly job state tracking. |
|
|
Flowly.Jobs.SQLite
SQLite backend for Flowly job state tracking. |
|
|
Flowly.Dashboard
Embedded web dashboard middleware for Flowly. Mounts a management UI at a configurable path prefix, providing live views of jobs, dead letters, recurring jobs, and dynamic message submission. Feature-detects Flowly.Jobs and Flowly.DeadLetters from the DI container automatically. |
GitHub repositories
This package is not used by any popular GitHub repositories.