KhaosCode.Flow.Abstractions
1.0.6
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
<PackageReference Include="KhaosCode.Flow.Abstractions" Version="1.0.6" />
<PackageVersion Include="KhaosCode.Flow.Abstractions" Version="1.0.6" />
<PackageReference Include="KhaosCode.Flow.Abstractions" />
paket add KhaosCode.Flow.Abstractions --version 1.0.6
#r "nuget: KhaosCode.Flow.Abstractions, 1.0.6"
#:package KhaosCode.Flow.Abstractions@1.0.6
#addin nuget:?package=KhaosCode.Flow.Abstractions&version=1.0.6
#tool nuget:?package=KhaosCode.Flow.Abstractions&version=1.0.6
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 |
Related Packages
KhaosCode.Flow- Implementation of flow executionKhaosCode.Pipeline.Abstractions- Pipeline abstractions (complementary pattern)KhaosCode.Pipeline- Pipeline implementation
License
MIT License - see LICENSE.md
| Product | Versions 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. |
-
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 |