LiteBus saga support is an Extension tier feature. It adds correlated state persistence around inbox command dispatch through IProcessorEnvelopeHook and ISagaContext.
Saga registration is composed from the inbox axis. There is no public top-level AddSagaModule(...) API in v6. Register saga through builder.AddInbox(inbox => inbox.EnableSaga(...)) and select exactly one store in the saga callback.
Accept correlated inbox command
-> lease inbox envelope
-> SagaProcessorHook.BeforeDispatchAsync (load state)
-> SagaProcessorHook.PrepareDispatchScope (attach message scope)
-> in-process command dispatch
-> SagaInboxCommandScopePreHandler (nested scope re-attach)
-> ICommandHandler<TCommand> uses ISagaContext
-> SagaProcessorHook.AfterDispatchAsync (save or complete)
-> inbox terminal status persistence
Package Role Why it exists LiteBus.DurableMessaging.AbstractionsDurable contracts Hook contract (IProcessorEnvelopeHook, IProcessorEnvelope) shared by inbox and outbox processors LiteBus.Saga.AbstractionsDurable contracts Saga contracts (ISagaStore, ISagaContext, SagaCorrelation, query and purge filters) LiteBus.SagaCore implementation Saga runtime, nested builder, and explicit in-memory storage module LiteBus.Saga.InboxIntegrationFeature bridge Inbox builder entry point (EnableSaga) and command pre-handler module LiteBus.Saga.Storage.PostgreSqlFeature bridge PostgreSQL ISagaStore, schema scripts, startup initializer
services. AddLiteBus ( builder =>
{
builder. AddMessaging ( _ => { });
builder. AddInbox ( inbox =>
{
inbox.Contracts. Register < AdvanceOrderSagaCommand >( "orders.saga.advance" );
inbox. UseInProcessDispatch ();
inbox. EnableSaga ( saga =>
{
saga. MapState < OrderSagaState >( "orders.saga.advance" );
saga. UseInMemoryStorage ();
});
});
});
Test executor Project and path Coverage focus Unit tests/LiteBus.Storage.UnitTests/Saga/Hook phases, same-correlation scope isolation, registry resolution, in-memory concurrency, query, purge, and schema bootstrap Integration tests/LiteBus.Storage.IntegrationTests/PostgreSql/End-to-end inbox plus saga plus PostgreSQL, orchestration depth, compensation, optimistic concurrency, connection ownership Composition smoke tests/LiteBus.Runtime.UnitTests/Runtime/Composition/v6 composition wiring (EnableSaga) and correlated state persistence
Gap Status in v6 Outbox saga support Not implemented Single transaction for inbox terminal plus saga save Not implemented Built-in scheduler, timeout orchestration, compensation DSL Not implemented EF Core saga store adapter Not implemented Saga-specific metrics and activity source Not implemented Automatic correlation id generation Not implemented Saga metrics and tracing Use inbox processor signals; no saga-specific instruments in v6