Cohesive.Processes 0.1.0-alpha.3

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

Cohesive.Processes

Declarative process definitions and runtime infrastructure for multistep workflows over entities, queries, waits, signals, and effects.

Install

dotnet add package Cohesive.Processes

Use When

  • You need process definitions that coordinate entity transitions, repository reads, waits, requests, and effects.
  • You want deterministic process planning and runtime state that can be interpreted by different storage or orchestration adapters.
  • You need a semantic process model separate from a specific queue, workflow engine, or database.

Example

using Cohesive.Processes.Model;
using Cohesive.Relations.Queries;

[GenerateProcessDefinition(nameof(Build))]
public partial class DispatchCustomerProcess : IProcessDefinition<string, DispatchCustomerResult>
{
    static readonly CustomerEntity Customers = CustomerEntity.Instance;
    static readonly CarrierEntity Carriers = CarrierEntity.Instance;
    static readonly QuerySource SegmentSource = QuerySource.For<SegmentReadModel>("segments");
    static readonly QuerySource OrderSource = QuerySource.For<OrderReadModel>("orders");

    async ProcessTask<DispatchCustomerResult> Build(
        ProcessAuthoringContext<string, DispatchCustomerResult> process,
        string customerId)
    {
        var customer = await process.Read(Customers.ReadById(customerId, snapshot =>
            new CustomerReadModel(
                CustomerId: snapshot.Require(entity => entity.Id),
                Name: snapshot.Require(entity => entity.Name),
                SegmentId: snapshot.Require(entity => entity.SegmentId))));

        var profiles = await process.Query(Query
            .From<CustomerReadModel>([customer], rootId: static root => root.CustomerId)
            .JoinOne<CustomerReadModel, string>(
                alias: "segment",
                source: SegmentSource,
                rootKeySelector: static root => root.SegmentId)
            .JoinMany<CustomerReadModel, OrderReadModel, string>(
                alias: "orders",
                source: OrderSource,
                rootKey: static root => root.CustomerId,
                foreignKey: static order => order.CustomerId)
            .Select(static join => new CustomerProfile(
                CustomerId: join.RootAs<CustomerReadModel>().CustomerId,
                Segment: join.RequireOne<SegmentReadModel>("segment"),
                Orders: join.Many<OrderReadModel>("orders"))));

        var profile = profiles[0];
        var reservation = await process.Request(new ReserveCarrierRequest(
            CustomerId: profile.CustomerId,
            OrderCount: profile.Orders.Count));

        var customerUpdate = await process.Transition(
            Customers.MarkDispatched,
            entityId: profile.CustomerId,
            input: new(reservation.CarrierId));

        var carrierUpdate = await process.Transition(
            Carriers.ReserveCapacity,
            entityId: reservation.CarrierId,
            input: new(reservation.ReservedOrderCount));

        return process.Return(new(
            CustomerId: profile.CustomerId,
            CarrierId: reservation.CarrierId,
            CustomerVersion: customerUpdate.NewVersion,
            CarrierVersion: carrierUpdate.NewVersion));
    }
}

public sealed record ReserveCarrierRequest(string CustomerId, int OrderCount)
    : IEffectRequest<CarrierReservation>
{
    public static string RequestName => "ReserveCarrier";
}

public sealed record CarrierReservation(string CarrierId, int ReservedOrderCount);

public sealed record DispatchCustomerResult(
    string CustomerId,
    string CarrierId,
    long CustomerVersion,
    long CarrierVersion);
  • Cohesive.Transitions for entity transition semantics.
  • Cohesive.Storage for repository adapters.
  • Cohesive.Adapters.DurableTask for Azure Durable Task execution.
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 (4)

Showing the top 4 NuGet packages that depend on Cohesive.Processes:

Package Downloads
Cohesive.Storage

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.DurableTask

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Host

Cohesive semantic system definition and orchestration building blocks.

Cohesive.Adapters.Cosmos

Cohesive semantic system definition and orchestration building blocks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.3 40 7/8/2026
0.1.0-alpha.2 57 7/7/2026