WorkflowEngine.Core 0.9.0

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

WorkflowEngine

A flexible, role-based workflow management system for .NET 8+ applications.

Features

  • 🔄 Multi-Route Workflows - Define multiple paths through your workflow
  • 📊 Stage-Based Progression - Clear stages with defined actions
  • 🔐 Role-Based Authorization - Control who can perform actions at each stage
  • 📝 Action History - Complete audit trail of all actions
  • 🎯 Template System - Define reusable workflow templates
  • 🏷️ Tag System - Map stages and routes to your domain enums

Installation

dotnet add package WorkflowEngine.Core
dotnet add package WorkflowEngine.Extensions.DependencyInjection

Quick Start

1. Define Your Enums

public enum InvoiceRoutes
{
    StandardApproval = 1,
    FastTrackApproval = 2
}

public enum InvoiceStages
{
    Draft = 1,
    Review = 2,
    Approval = 3,
    Payment = 4
}

2. Create a Workflow Template

var workflow = new SimpleWorkflowBuilder("Invoice Approval", "Invoice")
    .AddRoute((int)InvoiceRoutes.StandardApproval)
    .AddStage((int)InvoiceStages.Draft, 
        FlowStageActions.Create | FlowStageActions.Edit, 
        "Accountant")
    .AddStage((int)InvoiceStages.Review, 
        FlowStageActions.Approve | FlowStageActions.RequestEdit, 
        "Supervisor")
    .AddStage((int)InvoiceStages.Approval, 
        FlowStageActions.Approve | FlowStageActions.Deny, 
        "Manager")
    .Build();

3. Configure Services

// Program.cs
builder.Services.AddWorkflowEngine();

4. Use in Your Application

public class InvoiceService
{
    private readonly IWorkflowService _workflowService;
    
    public void ProcessInvoice(Invoice invoice, string userId, string[] userRoles)
    {
        // Perform action
        var success = _workflowService.PerformAction(
            invoice.Workflow,
            FlowStageActions.Approve,
            "Approved for payment",
            userId,
            "John Doe",
            userRoles
        );
        
        // Check available actions
        var actions = _workflowService.GetAvailableActions(
            invoice.Workflow, 
            userRoles
        );
    }
}

Advanced Features

Conditional Route Activation

// Activate fast-track route for amounts under $1000
if (invoice.Amount < 1000)
{
    workflow.ActivateRoute((int)InvoiceRoutes.FastTrackApproval, exclusive: true);
}

Route Switching

// Switch from standard to fast-track
workflow.SwitchToRoute((int)InvoiceRoutes.FastTrackApproval);

API Reference

FlowManager

  • StartFlow() - Initialize the workflow
  • GetCurrentRoute() - Get the active route
  • ActivateRoute(tag, exclusive) - Activate a specific route
  • DeactivateRoute(tag) - Deactivate a route
  • SwitchToRoute(tag) - Switch to a different route

IWorkflowService

  • CreateFlowFromTemplate(json) - Create workflow from template
  • PerformAction(...) - Execute an action
  • GetAvailableActions(...) - Get allowed actions for user
  • CanUserPerformAction(...) - Check user permissions

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WorkflowEngine.Core:

Package Downloads
WorkflowEngine.Extensions.DependencyInjection

A flexible, role-based workflow management system for .NET applications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 107 7/29/2025