PouryaKit.Messaging.Wolverine.Sagas 0.1.0-preview.2

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

PouryaKit.Messaging.Wolverine.Sagas

NuGet .NET 10 License: MIT

PouryaKit.Messaging.Wolverine.Sagas

Sagas on Wolverine. A Saga is a Module's long-running reaction across Integration Events: they start it and advance it, it keeps its own state between steps, and its timeouts end it. The Kit routes each step, claims it once in its own transaction, keys the saga by the event's tenant and business id, and writes what a step emits into the Module's Outbox.

Install

dotnet add package PouryaKit.Messaging.Wolverine.Sagas --prerelease

When to use it

  • A reaction spans several Integration Events and must remember what it saw between them.
  • Waiting has a deadline: a timeout ends the process when an event never arrives.
  • Several payments, approvals or replies must all arrive before one outcome is published.

It builds on PouryaKit.Messaging.Wolverine and keeps its state in the PostgreSQL message store of PouryaKit.Messaging.Wolverine.EFCore.

Quick start

Declare the saga, with its system Actor, in the Composition Root, as the Kit's tests do:

module.AddPouryaKitSaga<FulfilmentSaga>(
    Fulfilment,
    systemActor: Fulfilment,
    saga => saga.Input<OrderPlacedV1>(placed => placed.OrderId)
        .Input<PaymentReceivedV1>(paid => paid.OrderId)
        .Input<PaymentReceivedV2>(paid => paid.OrderId)
        .Timeout<FulfilmentTimeout>()
);

An Integration Event starts it and schedules its timeout, and the timeout ends it:

public static (FulfilmentSaga, FulfilmentTimeout) Start(
    SagaInput<FulfilmentSaga, OrderPlacedV1> placed
) =>
    (
        new FulfilmentSaga
        {
            Order = placed.Event.OrderId,
            Installments = placed.Event.Installments,
        },
        new FulfilmentTimeout(TimeSpan.FromSeconds(placed.Event.PayWithinSeconds))
    );

public async Task Handle(FulfilmentTimeout timeout)
{
    await PublishAsync(new OrderCancelledV1(Order, Paid));
    MarkCompleted();
}

What you get

  • State kept between steps, on Wolverine's lightweight saga storage in the message store.
  • Each step claimed once, in its own transaction.
  • A saga keyed by the event's tenant and business id, so two tenants never share one.
  • Emitted Integration Events written to the Module's Outbox under the saga's system Actor.

A step runs outside every Operation: no authorizer, validator or Unit of Work runs for it, and a step that dies before its commit runs again. So a step only changes the saga's state, emits and schedules timeouts. A call to another service belongs to a subscription that receives what the saga emits.

Learn more

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

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
0.1.0-preview.2 66 11/1/2026
0.1.0-preview.1 75 10/31/2026
0.1.0-preview.0.28 67 10/26/2026