Xpandables.AspNetCore.Sagas 11.0.0

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

📦 AspNetCore.Sagas

License .NET Version

ASP.NET Core operations endpoints of Xpandables.Sagas: query saga instances, read their history, cancel, retry and draw their definitions, behind a required authorization policy; Native AOT compatible.


🚀 Getting started

dotnet add package Xpandables.AspNetCore.Sagas
builder.Services.AddXSagas().AddXSaga<OrderSaga>();
builder.Services.AddAuthorizationBuilder().AddPolicy("ops", policy => policy.RequireRole("operator"));

app.UseAuthentication();
app.UseAuthorization();
app.MapXSagaOperations("ops");      // under /_ops/sagas
app.MapXEventOperations("ops");     // the outbox and inbox dead letters (Xpandables.AspNetCore.Net), under /_ops/events

The policy name is required: no anonymous operations endpoint can be mapped. MapXSagaOperations returns the route group, for more conventions (rate limiting, OpenAPI tags).


🛠️ Endpoints

Endpoint Answer
GET /?name=&status=&deadlineBefore=&skip=&take= The instances (SagaInstance), newest first; status is a SagaStatus name, take 1 to 1000 (50 by default)
GET /counts?name= The instances by status: {"Running": n, "Compensating": n, "Completed": n, "Compensated": n, "Failed": n}
GET /definitions The registered definitions: name, version, states, steps, deadline
GET /definitions/{name}/{version}/diagram The state machine as a Mermaid diagram (text/plain)
GET /{sagaId} An instance, or 404
GET /{sagaId}/history Its audit trail (SagaHistoryRecord), oldest first, or 404
POST /{sagaId}/cancel with {"reason": "…"} 202 once the cancellation is enqueued to the saga (it compensates; refused past its pivot), 404, or 400 without a reason
POST /{sagaId}/retry 202 once the retry is enqueued (a failed saga sends its active steps or compensations again), or 404
  • Operator audit. Cancel and retry record the user's name (HttpContext.User.Identity.Name) in the saga's history.
  • Idempotent. Cancel and retry are messages to the saga, through the outbox: asking twice changes nothing more, the saga ignores a cancellation when it no longer runs and a retry when it has not failed.
  • JSON. Web defaults (camelCase), enums as strings, source-generated: Native AOT compatible, independent of the application's JSON options.

The runbooks that use these endpoints are in the Xpandables.Sagas README.


📄 License

Apache License 2.0 — see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.0 0 11/29/2026