FlowOrchestrator

Code-first workflow orchestration for .NET — runs on Hangfire, in-process, or Azure Service Bus.

Define multi-step background workflows as plain C# classes. Connect them with runAfter dependencies. Run them on SQL Server, PostgreSQL, or in-memory. Monitor everything from a built-in dashboard.

Get Started API Reference


Why FlowOrchestrator?

No YAML. No JSON files.

Flows are C# classes — refactorable, IDE-navigable, and version-controlled alongside the code they orchestrate.

Three runtime adapters

Hangfire (production default — durable job execution you already trust), InMemory (Channel<T>-backed, zero-infra dev mode), or Azure Service Bus (cloud-native multi-replica with self-perpetuating scheduled cron messages). Same flow code on all three — though not the same capacity: see issue 192 before picking Service Bus for a high-volume ingress.

Three trigger types

Manual (dashboard/API), Cron (recurring schedule), and Webhook (external HTTP POST) — declared in the same manifest, no extra config.

DAG execution planner

runAfter dependencies power fan-out, fan-in, and conditional branching. Multiple entry steps run in parallel automatically.

Built-in polling

PollableStepHandler<T> waits for external systems without holding a thread. Hangfire reschedules after each interval, with configurable timeout and min-attempt guards.

One dashboard, full history

Step-by-step timeline, input/output capture, retry button for failed steps, cooperative cancellation, and schedule management — all at /flows.


Install

dotnet add package FlowOrchestrator.Core           # engine + AddFlowOrchestrator()
dotnet add package FlowOrchestrator.Hangfire       # runtime — or .InMemory / .ServiceBus (no Hangfire needed)
dotnet add package FlowOrchestrator.SqlServer      # storage — or .PostgreSQL / .InMemory
dotnet add package FlowOrchestrator.Dashboard      # optional REST API + SPA
dotnet add package FlowOrchestrator.Testing        # optional test host, for test projects
// 1. Register Hangfire (required separately before FlowOrchestrator)
builder.Services.AddHangfire(c => c.UseSqlServerStorage(connectionString));
builder.Services.AddHangfireServer();

// 2. Register FlowOrchestrator
builder.Services.AddFlowOrchestrator(options =>
{
    options.UseSqlServer(connectionString);
    options.UseHangfire();                 // or .UseInMemoryRuntime() / .UseAzureServiceBusRuntime(...)
    options.AddFlow<MyFlow>();
});

// 3. Register step handlers
builder.Services.AddStepHandler<MyStepHandler>("MyStepType");

// 4. Map the dashboard (optional)
app.MapFlowDashboard("/flows");

Packages

Package Purpose NuGet
FlowOrchestrator.Core Abstractions, execution engine and AddFlowOrchestrator() DI registration NuGet
FlowOrchestrator.Hangfire Hangfire runtime adapter (UseHangfire()) NuGet
FlowOrchestrator.SqlServer SQL Server persistence (Dapper) NuGet
FlowOrchestrator.PostgreSQL PostgreSQL persistence (Npgsql) NuGet
FlowOrchestrator.InMemory In-process runtime and storage (dev/testing) NuGet
FlowOrchestrator.ServiceBus Azure Service Bus runtime adapter (multi-replica) NuGet
FlowOrchestrator.Dashboard REST API + embedded SPA NuGet
FlowOrchestrator.Testing FlowTestHost — run flows in-process in tests NuGet

All packages target net10.0 and net11.0. MIT license.