FlowPilot 1.0.0

dotnet add package FlowPilot --version 1.0.0
                    
NuGet\Install-Package FlowPilot -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FlowPilot" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlowPilot" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FlowPilot" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FlowPilot --version 1.0.0
                    
#r "nuget: FlowPilot, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FlowPilot@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FlowPilot&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FlowPilot&version=1.0.0
                    
Install as a Cake Tool

FlowPilot

Human-friendly orchestration for background work: cooperative pause/resume/cancel, priorities, dependencies, scheduling (with repeat), progress, and supervision all in a small .NET 8+ library.

Why FlowPilot?

  • Cooperative tasks: each FlowTask receives (CancellationToken ct, Func<Task> wait) to pause/resume cleanly.
  • Orchestration primitives: priorities, dependencies, scheduling, optional repeating, and a singleton manager (FlowTaskManager.Shared).
  • Observability: per-task and global events (TaskStateChangedEvent / TaskStateTransitionEvent), progress reporting, timing, and snapshots.
  • Reliability: supervisor jobs with restart/stop/ignore strategies and retry limits.
  • Persistence-friendly: TaskSnapshot captures state/priority/progress for storage.

Requirements

  • .NET 8.0+ (targets net8.0, net9.0, net10.0).

Install

dotnet add package FlowPilot

Quick start

using FlowPilot;
using FlowPilot.Tasks;

var download = FlowTask.NewTask("Download", async (ct, wait) =>
{
    for (int i = 0; i <= 100; i += 10)
    {
        await wait();                 // cooperatively pause if requested
        ct.ThrowIfCancellationRequested();
        await Task.Delay(100, ct);
        Console.WriteLine($"Downloading... {i}%");
    }
})
.Managed()
.WithPriority(TaskPriority.High)
.Schedule(TimeSpan.FromSeconds(5));   // start 5s later

var process = FlowTask.NewTask("Process", async (ct, wait) =>
{
    await Task.Delay(500, ct);
    Console.WriteLine("Processing finished.");
})
.Managed()
.After(download); // run after Download completes

FlowTask.NewTask("Cleanup", async (ct, wait) =>
{
    await wait();
    await Task.Delay(250, ct);
    Console.WriteLine("Cleanup done.");
})
.WithPriority(TaskPriority.Low)
.After(process)
.Managed();

FlowTaskManager.Shared.TaskChanged += e =>
    Console.WriteLine($"[{e.Timestamp:T}] {e.TaskName} -> {e.NewState} ({e.Progress:0}%){(e.ErrorMessage != null ? " | Error: " + e.ErrorMessage : "")}");

await FlowTaskManager.Shared.RunAllAsync();

Control and observe

await FlowTaskManager.Shared.PauseAllAsync();
await FlowTaskManager.Shared.ResumeAllAsync();
await FlowTaskManager.Shared.CancelAsync("Download");

Progress binding

var export = FlowTask.NewTask("Export", async (ct, wait) =>
{
    var progress = (IProgress<double>)export;
    for (int i = 0; i <= 100; i += 5)
    {
        await wait();
        ct.ThrowIfCancellationRequested();
        await Task.Delay(50, ct);
        progress.Report(i);
    }
})
.Managed();

FlowTaskManager.Shared.TaskChanged += e =>
{
    if (e.TaskName == "Export")
        Console.WriteLine($"Export progress: {e.Progress:0}%");
};

Supervision (restarts, retries)

using FlowPilot.Supervision;

var job = DefaultSupervisorJobBuilder.Create()
    .RestartFailed(maxRetries: 3, retryDelay: TimeSpan.FromSeconds(2))
    .AddTasks(download, process)
    .Build();

await job.StartAllAsync();

Strategies (SupervisionStrategy):

  • RestartFailed (default): retry failed tasks up to a limit with delay.
  • StopAll: cancel siblings when any task fails.
  • Ignore: do nothing on failure.

API cheatsheet

  • FlowTask.NewTask(string name, Func<CancellationToken, Func<Task>, Task> action)
  • Managed() register in FlowTaskManager.Shared
  • WithPriority(TaskPriority priority)
  • After(params FlowTask[] dependencies)
  • Schedule(TimeSpan delay, bool repeat = false)
  • StartAsync(), Pause()/PauseAsync(), Resume(), Cancel()
  • Subscribe(IObserver<TaskStateChangedEvent>)
  • Report(double progress) (0..100)
  • Completion (awaitable snapshot)
  • FlowTaskManager.Shared: RunAllAsync(), PauseAllAsync(), ResumeAllAsync(), CancelAllAsync(), CancelAsync(name), TaskChanged event, WithAutoCleanup(bool)

Project layout

  • src/ library source
    • Tasks/ task types and manager
    • Events/ task events and transitions
    • Supervision/ supervisor job, builder, strategies
  • tests/ xUnit test suite (dotnet test)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 216 11/23/2025