ConvergeERP.Shared.Workflow.Core 0.0.3-preview

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

ConvergeERP.Shared.Workflow.Core

Core contracts, DTOs, and interfaces for the ConvergeERP Workflow Runtime SDK. This package provides lightweight, dependency-minimal types for integrating domain services with the centralized workflow system.

Purpose

This package is designed to be referenced by:

  • Domain Services (Finance, Procurement, HR) that need to integrate with workflow
  • Consumer services that handle workflow events
  • API projects that need workflow DTOs
  • Test projects that need workflow contracts for mocking

For full SDK functionality (HTTP clients, resilience, caching), reference ConvergeERP.Shared.Workflow instead.

Package Structure

ConvergeERP.Shared.Workflow.Core
├── Abstractions/
│   ├── IWorkflowRuntimeClient.cs   # HTTP client for runtime operations
│   ├── IWorkflowDefinitionClient.cs # HTTP client for definition queries
│   ├── IPostingGateway.cs          # IsPostingAllowed helper
│   ├── IWorkflowEventPublisher.cs  # Event publishing interface
│   └── IWorkflowSubscriber.cs      # Event subscription helper
├── DTOs/
│   ├── WorkflowDefinitionDto.cs    # Definition summary
│   ├── WorkflowInstanceDto.cs      # Instance state
│   ├── InboxItemDto.cs             # My Approvals item
│   └── PostingCheckResult.cs       # Posting check result
├── Requests/
│   ├── CreateInstanceRequest.cs
│   ├── WorkflowActionRequest.cs
│   └── InboxQuery.cs
├── Responses/
│   ├── CreateInstanceResponse.cs
│   ├── WorkflowActionResponse.cs
│   └── InboxResponse.cs
├── Events/
│   ├── WorkflowInstanceCreatedEvent.cs
│   ├── WorkflowStepCompletedEvent.cs
│   └── WorkflowCompletedEvent.cs
├── Domain/
│   ├── Workflow.cs
│   └── WorkflowInstance.cs
└── Enums.cs

Key Interfaces

IWorkflowRuntimeClient

Primary interface for domain services to interact with the workflow runtime:

public interface IWorkflowRuntimeClient
{
    // Instance Management
    Task<CreateInstanceResponse> CreateInstanceAsync(CreateInstanceRequest request, CancellationToken ct = default);
    Task<WorkflowInstanceDto?> GetInstanceAsync(Guid instanceId, CancellationToken ct = default);
    Task<WorkflowInstanceDto?> GetInstanceByDocumentAsync(string documentType, Guid documentId, CancellationToken ct = default);

    // Actions
    Task<WorkflowActionResponse> ApproveAsync(Guid instanceId, WorkflowActionRequest request, CancellationToken ct = default);
    Task<WorkflowActionResponse> RejectAsync(Guid instanceId, WorkflowActionRequest request, CancellationToken ct = default);
    Task<WorkflowActionResponse> CancelAsync(Guid instanceId, WorkflowActionRequest request, CancellationToken ct = default);

    // Inbox
    Task<InboxResponse> GetMyApprovalsAsync(InboxQuery? query = null, CancellationToken ct = default);
}

IPostingGateway

Critical helper for domain services to check if posting is allowed:

public interface IPostingGateway
{
    Task<PostingCheckResult> IsPostingAllowedAsync(
        string documentType,
        Guid documentId,
        Guid? workflowInstanceId = null,
        CancellationToken ct = default);
}

Usage Examples

Submit Document for Approval

using ConvergeERP.Shared.Workflow.Core.Abstractions;
using ConvergeERP.Shared.Workflow.Core.Requests;

public class InvoiceService
{
    private readonly IWorkflowRuntimeClient _workflowClient;

    public async Task SubmitForApprovalAsync(Invoice invoice)
    {
        var response = await _workflowClient.CreateInstanceAsync(new CreateInstanceRequest
        {
            DocumentType = "Invoice",
            DocumentId = invoice.Id,
            DocumentRef = invoice.InvoiceNumber,
            Metadata = new Dictionary<string, string>
            {
                ["Amount"] = invoice.TotalAmount.ToString("C"),
                ["Vendor"] = invoice.VendorName
            }
        });

        if (response.Success)
        {
            invoice.WorkflowInstanceId = response.InstanceId;
            await SaveAsync(invoice);
        }
    }
}

Check Posting Allowed

public async Task<bool> CanPostInvoiceAsync(Invoice invoice)
{
    var result = await _postingGateway.IsPostingAllowedAsync(
        "Invoice",
        invoice.Id,
        invoice.WorkflowInstanceId);

    return result.IsAllowed;
}

Consume Workflow Events

using ConvergeERP.Shared.Workflow.Core.Events;
using MassTransit;

public class WorkflowCompletedConsumer : IConsumer<WorkflowCompletedEvent>
{
    public async Task Consume(ConsumeContext<WorkflowCompletedEvent> context)
    {
        var evt = context.Message;

        if (evt.IsPostingAllowed && evt.DocumentType == "Invoice")
        {
            // Auto-post or notify user
            await NotifyUserAsync(evt.DocumentId, "Invoice approved - ready to post");
        }
    }
}

Dependencies

  • ConvergeERP.Shared.Domain - Base entity types with multi-tenant support
  • ConvergeERP.Shared.Workflow - Full SDK implementation with HTTP clients and resilience
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 (1)

Showing the top 1 NuGet packages that depend on ConvergeERP.Shared.Workflow.Core:

Package Downloads
ConvergeERP.Shared.Workflow

Shared workflow models, events, and HTTP client SDK for ConvergeERP services. Includes resilience patterns, correlation propagation, and definition caching.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3-preview 258 6/11/2026
0.0.2-preview 342 4/2/2026
0.0.1-preview 177 3/22/2026