Flowly.Jobs
1.1.0
dotnet add package Flowly.Jobs --version 1.1.0
NuGet\Install-Package Flowly.Jobs -Version 1.1.0
<PackageReference Include="Flowly.Jobs" Version="1.1.0" />
<PackageVersion Include="Flowly.Jobs" Version="1.1.0" />
<PackageReference Include="Flowly.Jobs" />
paket add Flowly.Jobs --version 1.1.0
#r "nuget: Flowly.Jobs, 1.1.0"
#:package Flowly.Jobs@1.1.0
#addin nuget:?package=Flowly.Jobs&version=1.1.0
#tool nuget:?package=Flowly.Jobs&version=1.1.0
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 : JobMessageHandlerBase<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(connectionString)
.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 : RecurringJobHandlerBase
{
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.1.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.7)
NuGet packages (3)
Showing the top 3 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.