KhaosCode.Flow.Abstractions 1.0.6

Additional Details

This was a bit of an experiment to see how to use nuget. I understand a tiny bit more now than before. Please feel free to look at the KhaosKoder.* series of packages. They replace this package - with absolutely minimal code changes required. I will try to keep the packages stable under those names from here on.

dotnet add package KhaosCode.Flow.Abstractions --version 1.0.6
                    
NuGet\Install-Package KhaosCode.Flow.Abstractions -Version 1.0.6
                    
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="KhaosCode.Flow.Abstractions" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KhaosCode.Flow.Abstractions" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="KhaosCode.Flow.Abstractions" />
                    
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 KhaosCode.Flow.Abstractions --version 1.0.6
                    
#r "nuget: KhaosCode.Flow.Abstractions, 1.0.6"
                    
#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 KhaosCode.Flow.Abstractions@1.0.6
                    
#: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=KhaosCode.Flow.Abstractions&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=KhaosCode.Flow.Abstractions&version=1.0.6
                    
Install as a Cake Tool

Khaos.Flow.Abstractions

Core abstractions for state-machine style workflow orchestration with branching and transitions.

Overview

This package provides the interfaces and core types for defining flows - state-machine workflows where each step returns an outcome that determines the next step to execute.

Key characteristics of Flows:

  • Branching: Steps return outcomes (Success, Failure, custom) that map to different transitions
  • Orchestration: Control complex workflows with conditional paths
  • Context-based: All steps share a context (IFlowContext) for state

Key Types

Type Description
IFlowStep<TContext> A single step in a flow that returns a FlowOutcome
IFlowDefinition<TContext> Immutable description of a flow with steps and transitions
IFlowExecutor<TContext> Executes a flow definition with a given context
FlowOutcome The result of a step (Success, Failure, or custom)
IFlowContext Marker interface for flow contexts (must provide IServiceProvider)

Usage

// Define a flow step
public class ValidateDatabaseStep : IFlowStep<StartupContext>
{
    public Task<FlowOutcome> ExecuteAsync(StartupContext context, CancellationToken ct)
    {
        // Validate database connection
        return Task.FromResult(isValid ? FlowOutcome.Success : FlowOutcome.Failure);
    }
}

When to Use Flows vs Pipelines

Use Flows When Use Pipelines When
Need branching logic Need linear transformation
Orchestrating startup/shutdown Processing messages/records
Steps may take different paths Every input produces an output
State-machine workflows Data transformation chains
  • KhaosCode.Flow - Implementation of flow execution
  • KhaosCode.Pipeline.Abstractions - Pipeline abstractions (complementary pattern)
  • KhaosCode.Pipeline - Pipeline implementation

License

MIT License - see LICENSE.md

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 was computed.  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.
  • 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.6 92 3/12/2026 1.0.6 is deprecated because it is no longer maintained.