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
<PackageReference Include="Xpandables.AspNetCore.Sagas" Version="11.0.0" />
<PackageVersion Include="Xpandables.AspNetCore.Sagas" Version="11.0.0" />
<PackageReference Include="Xpandables.AspNetCore.Sagas" />
paket add Xpandables.AspNetCore.Sagas --version 11.0.0
#r "nuget: Xpandables.AspNetCore.Sagas, 11.0.0"
#:package Xpandables.AspNetCore.Sagas@11.0.0
#addin nuget:?package=Xpandables.AspNetCore.Sagas&version=11.0.0
#tool nuget:?package=Xpandables.AspNetCore.Sagas&version=11.0.0
📦 AspNetCore.Sagas
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Xpandables.AspNetCore.Net (>= 11.0.0)
- Xpandables.Sagas (>= 11.0.0)
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 |