SolTechnology.Core.Flow 0.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SolTechnology.Core.Flow --version 0.5.0
                    
NuGet\Install-Package SolTechnology.Core.Flow -Version 0.5.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="SolTechnology.Core.Flow" Version="0.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SolTechnology.Core.Flow" Version="0.5.0" />
                    
Directory.Packages.props
<PackageReference Include="SolTechnology.Core.Flow" />
                    
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 SolTechnology.Core.Flow --version 0.5.0
                    
#r "nuget: SolTechnology.Core.Flow, 0.5.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 SolTechnology.Core.Flow@0.5.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=SolTechnology.Core.Flow&version=0.5.0
                    
Install as a Cake Addin
#tool nuget:?package=SolTechnology.Core.Flow&version=0.5.0
                    
Install as a Cake Tool

Overview

The SolTechnology.Core.Flow library provides a workflow and chain framework with support for pausable flows. It enables building complex, multi-step workflows that can be paused and resumed, with state persistence using either in-memory or SQLite storage.

Registration

For installing the library, reference SolTechnology.Core.Flow nuget package and invoke AddFlowFramework() service collection extension method:

services.AddFlowFramework();

Configuration

By default, the library uses SQLite for persistence. You can customize the repository implementation:

// Use in-memory storage (for testing)
services.AddScoped<IFlowInstanceRepository, InMemoryFlowInstanceRepository>();

// Or use SQLite (default)
services.AddScoped<IFlowInstanceRepository, SqliteFlowInstanceRepository>();

Usage

  1. Define Flow Context
public class MyFlowContext : FlowContext<MyInput, MyOutput>
{
    public string CurrentStepData { get; set; }
}
  1. Define Flow Steps

Automated steps run without user interaction:

public class ProcessDataStep : AutomatedFlowStep<MyFlowContext>
{
    public override async Task Execute(MyFlowContext context)
    {
        // Automated processing logic
        context.CurrentStepData = "processed";
    }
}

Interactive steps pause and wait for user input:

public class AwaitUserApprovalStep : InteractiveFlowStep<MyFlowContext>
{
    public override async Task Execute(MyFlowContext context)
    {
        // Logic before pausing
        context.CurrentStepData = "awaiting approval";

        // Flow pauses here, waiting for resume
    }

    public override async Task Resume(MyFlowContext context)
    {
        // Logic after user provides input
        // Access user input from context
    }
}
  1. Define Flow Handler
public class MyFlowHandler : PausableChainHandler<MyInput, MyFlowContext, MyOutput>
{
    protected override async Task HandleChain()
    {
        await Invoke<ProcessDataStep>();
        await Invoke<AwaitUserApprovalStep>(); // Flow pauses here
        await Invoke<FinalizeStep>();
    }
}
  1. Start a Flow
var flowManager = serviceProvider.GetRequiredService<FlowManager>();
var input = new MyInput { Data = "initial data" };

var flowInstance = await flowManager.StartFlow<MyFlowHandler>(input);
  1. Resume a Paused Flow
// Get the flow instance ID from the initial start
var flowInstanceId = flowInstance.Id;

// Provide user input
var userInput = new Dictionary<string, object>
{
    { "approved", true },
    { "comment", "Looks good!" }
};

await flowManager.ResumeFlow(flowInstanceId, userInput);
  1. Check Flow Status
var status = await flowManager.GetFlowStatus(flowInstanceId);

switch (status)
{
    case FlowStatus.Running:
        // Flow is currently executing
        break;
    case FlowStatus.Paused:
        // Flow is paused, waiting for input
        break;
    case FlowStatus.Completed:
        // Flow has finished successfully
        break;
    case FlowStatus.Failed:
        // Flow encountered an error
        break;
}
  1. Use Flow Controller (Optional)

The library includes a FlowController for HTTP API integration:

// Start flow via HTTP POST
POST /api/flow/start
{
    "flowType": "MyFlowHandler",
    "input": { "data": "initial data" }
}

// Resume flow via HTTP POST
POST /api/flow/resume/{flowInstanceId}
{
    "approved": true,
    "comment": "Looks good!"
}

// Get flow status via HTTP GET
GET /api/flow/status/{flowInstanceId}
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 264 11/30/2025
0.5.0 444 12/10/2025