WorkflowForge 1.0.1

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

WorkflowForge Core

The foundational workflow orchestration framework for .NET with zero dependencies, built-in compensation, and sub-20 microsecond operation performance.

๐ŸŽฏ Package Overview

WorkflowForge Core is the dependency-free foundation providing:

  • ๐Ÿญ Foundry & Smith Architecture: Industrial-strength metaphor with IWorkflowFoundry for execution context and IWorkflowSmith for orchestration
  • โš™๏ธ Flexible Operations: Support for sync/async operations, lambda expressions, and typed operations
  • ๐Ÿ”„ Compensation Support: Built-in saga pattern with automatic rollback capabilities
  • ๐Ÿงฉ Middleware Pipeline: Extensible middleware system for cross-cutting concerns
  • ๐Ÿ“Š Data Management: Thread-safe shared data with ConcurrentDictionary
  • ๐Ÿ—๏ธ Builder Pattern: Fluent API for constructing workflows
  • ๐Ÿ”ง Zero Dependencies: Core framework has no external dependencies
  • โšก High Performance: Optimized for production workloads

๐Ÿ“ฆ Installation

dotnet add package WorkflowForge

๐Ÿš€ Quick Start

using WorkflowForge;

// Create a workflow using the forge
var workflow = WorkflowForge.CreateWorkflow()
    .WithName("ProcessOrder")
    .AddOperation("ValidateOrder", async (order, foundry, ct) => 
    {
        foundry.Logger.LogInformation("Validating order {OrderId}", order.Id);
        return order;
    })
    .Build();

// Execute the workflow
using var foundry = WorkflowForge.CreateFoundry("ProcessOrder");
using var smith = WorkflowForge.CreateSmith();

await smith.ForgeAsync(workflow, foundry);

๐Ÿ—๏ธ Core Architecture

The WorkflowForge Metaphor

  • The Forge (WorkflowForge static class) - Main factory for creating workflows and components
  • Foundries (IWorkflowFoundry) - Execution environments where operations are performed
  • Smiths (IWorkflowSmith) - Skilled craftsmen who manage foundries and forge workflows
  • Operations (IWorkflowOperation) - Individual tasks performed in the foundry
  • Workflows (IWorkflow) - Complete workflow definitions with operations

Core Abstractions

IWorkflowFoundry - Execution Environment
public interface IWorkflowFoundry : IDisposable
{
    Guid ExecutionId { get; }
    IWorkflow? CurrentWorkflow { get; }
    ConcurrentDictionary<string, object?> Properties { get; }
    IWorkflowForgeLogger Logger { get; }
    IServiceProvider? ServiceProvider { get; }
    
    void SetCurrentWorkflow(IWorkflow? workflow);
    void AddOperation(IWorkflowOperation operation);
}
IWorkflowSmith - Orchestration Engine
public interface IWorkflowSmith : IDisposable
{
    Task ForgeAsync(IWorkflow workflow, IWorkflowFoundry foundry, CancellationToken cancellationToken = default);
    Task ForgeAsync(IWorkflow workflow, ConcurrentDictionary<string, object?> data, CancellationToken cancellationToken = default);
}
IWorkflowOperation - Individual Tasks
public interface IWorkflowOperation : IDisposable
{
    Guid Id { get; }
    string Name { get; }
    bool SupportsRestore { get; }
    
    Task<object?> ForgeAsync(object? inputData, IWorkflowFoundry foundry, CancellationToken cancellationToken);
    Task RestoreAsync(object? outputData, IWorkflowFoundry foundry, CancellationToken cancellationToken);
}

๐Ÿ“š Documentation & Examples

๐Ÿ”ง Built-in Operations

Delegate Operations

// Simple operation
workflow.AddOperation("LogMessage", (input, foundry, ct) => 
{
    foundry.Logger.LogInformation("Processing: {Input}", input);
    return input;
});

// Async operation
workflow.AddOperation("ProcessAsync", async (input, foundry, ct) => 
{
    await Task.Delay(100, ct);
    return $"Processed: {input}";
});

Conditional Operations

var conditionalOp = ConditionalWorkflowOperation.Create(
    condition: foundry => foundry.Properties.ContainsKey("IsPremium"),
    trueOperation: new PremiumProcessingOperation(),
    falseOperation: new StandardProcessingOperation()
);

ForEach Operations

var forEachOp = ForEachWorkflowOperation.Create<string>(
    items: new[] { "item1", "item2", "item3" },
    operation: new ProcessItemOperation(),
    parallelExecution: true
);

๐Ÿ”„ Compensation (Saga Pattern)

Built-in support for automatic rollback:

public class PaymentOperation : IWorkflowOperation
{
    public string Name => "ProcessPayment";
    public bool SupportsRestore => true;

    public async Task<object?> ForgeAsync(object? inputData, IWorkflowFoundry foundry, CancellationToken cancellationToken)
    {
        var paymentResult = await ProcessPaymentAsync((Order)inputData!, cancellationToken);
        foundry.Properties["PaymentId"] = paymentResult.PaymentId;
        return paymentResult;
    }
    
    public async Task RestoreAsync(object? outputData, IWorkflowFoundry foundry, CancellationToken cancellationToken)
    {
        if (foundry.Properties.TryGetValue("PaymentId", out var paymentId))
        {
            await RefundPaymentAsync((string)paymentId!, cancellationToken);
        }
    }
}

๐Ÿงช Testing

Built for testability with mockable interfaces:

[Fact]
public async Task Should_Execute_Workflow_Successfully()
{
    // Arrange
    var mockOperation = new Mock<IWorkflowOperation>();
    mockOperation.Setup(x => x.ForgeAsync(It.IsAny<object>(), It.IsAny<IWorkflowFoundry>(), It.IsAny<CancellationToken>()))
             .ReturnsAsync("result");

    var workflow = WorkflowForge.CreateWorkflow()
        .AddOperation(mockOperation.Object)
        .Build();

    // Act & Assert
    var result = await smith.ForgeAsync(workflow, foundry);
    Assert.Equal("result", result);
}

Zero-dependency workflow orchestration for .NET

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on WorkflowForge:

Package Downloads
WorkflowForge.Extensions.Resilience

Resilience and retry extension for WorkflowForge workflow engine. Provides circuit breakers, retry strategies, and timeout management for robust workflow execution.

WorkflowForge.Extensions.Logging.Serilog

Serilog adapter for WorkflowForge providing professional structured logging capabilities with rich context and correlation.

WorkflowForge.Extensions.Observability.HealthChecks

Health monitoring and diagnostics extension for WorkflowForge providing comprehensive health checks, dependency monitoring, and system status reporting for production workflows.

WorkflowForge.Extensions.Observability.Performance

Performance monitoring and profiling extension for WorkflowForge providing detailed metrics, execution timing, memory usage tracking, and performance optimization insights for production workflows.

WorkflowForge.Extensions.Observability.OpenTelemetry

OpenTelemetry integration for WorkflowForge providing distributed tracing, metrics collection, and observability instrumentation for comprehensive workflow monitoring and debugging.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 241 6/3/2025

Initial release v1.0.0 of WorkflowForge:
- Powerful workflow orchestration framework
- Extensible architecture with dependency injection
- Built-in logging, resilience, and observability
- Production-ready with comprehensive testing