EnvelopeFlow.Campaigns.Stores.Postgres 0.1.0-alpha.3.1

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

EnvelopeFlow.Campaigns.Stores.Postgres

This feature exposes an immutable Postgres*Migration*.Catalog for explicit schema inspection/planning/adoption with an application-owned PostgresMigrationRunner. See upgrade operations. Existing initializers stay explicit; construction and worker startup never apply migrations. Select only the installed feature catalog, independently from conversation/history storage.

An optional ICampaignStore using application-owned Npgsql data sources. Explicit transactional initialization creates or upgrades campaign/quota tables. Full-scope row locks fence pause/cancel/restart and per-scope/provider minute quotas. The preparation transaction commits the exact submission, quota reservation and short attempt lease, then releases its connection before the bounded sink callback. A separate checkpoint transaction rechecks the current lease, expiry, offset and attempt at the final update. A definite false refunds quota but preserves the request; ambiguous outcomes retain the original reservation for idempotent recovery. Historical quota pruning preserves active pending reservations and never deletes the current database-clock bucket. Use a durable audience resolver for restart-safe snapshots. This adapter does not store users, delivery payloads or conversation history.

Repeated campaign creation uses immutable CampaignDefinition value equality, matching the in-memory reference. Equivalent timestamp offsets identify the same instant for scheduled time, campaign expiry and audience expiry. A duplicate retains the first persisted definition and runtime state, including its original timestamp offsets; changed instants or metadata still conflict.

Campaign schema version 2 adds indexed next_due; version 3 uses bounded generated scope/campaign/provider keys for state, quotas and due discovery. Historical SQL/checksums remain unchanged. Explicit InitializeAsync now atomically validates/adopts known unversioned baselines and applies the catalog, or validates/upgrades existing history. Operators can instead inspect/adopt/apply with PostgresMigrationRunner. Stop old binaries before this maintenance operation; positional inserts and old conflict targets are incompatible with the new schema. Exact raw scope and identity checks remain required. See bounded-key deployment. Constructors and scheduler startup never migrate.

PostgresCampaignOrchestrationStore is separately initialized using PostgresCampaignOrchestrationMigrations.Catalog. Appended version 2 changes the operational payload from jsonb to text, preserving the canonical bounded JSON bytes written by the shared state machine. PostgreSQL JSONB formatting must not turn a successful bounded write into an unreadable record; valid delivery payloads containing escaped NUL also retain their original text. Existing version-one migration SQL/checksums remain unchanged. Indexed due/retention lookup uses a hash of the full scope plus per-record keys; exact stored scope/kind/ID and document bindings are checked on reads. Terminal workflow discovery avoids JSON extraction, so valid escaped NUL text cannot break retention of an otherwise complete workflow. Schedule discovery still protects pending occurrence evidence. Per-record transaction advisory locks serialize even missing rows; a short creation lock enforces per-scope record capacity. Operational documents, trusted database-clock eligibility, fenced claims and due indexes commit together. External durable admission is an idempotent callback, not a cross-database transaction. Total mutation time is bounded to 30 seconds. Compatible capacity settings and database protection remain application deployment responsibilities; long Unicode identifiers do not become oversized composite index keys.

Occurrence creation, notification admission and condition evaluation use persisted callback identities and run after the orchestration transaction releases its connection. They recheck revision, lease, status and attempt before checkpointing, so cancellation and lease takeover invalidate a late result. Callback waits are at most ten seconds and no longer than the owned lease/expiry. A callback ignoring cancellation may overlap recovery; sinks must deduplicate concurrent calls and reject conflicting bytes. Supplied delivery/outcome writes work through the same saturated pool, including a single connection. These intent fields are additive JSON state with no schema migration; pause old writers during this protocol upgrade so they cannot discard or reject the new operational fields.

PostgresWorkflowOutcomeStore is independently optional, with its own explicit PostgresWorkflowOutcomeMigrations.Catalog version 1. Its full-scope transaction lock atomically protects immutable delivery correlation, monotonic outcome timestamps and event fingerprints; no message bodies are copied. Use the same bounded capacity configuration across clients. Unmapped events make no stored mutation and remain retryable by the delivery event handler. Required-field corruption and scope/key inconsistencies fail before returning facts. Reopening a store applies no DDL; the existing campaign/orchestration migration identities and SQL remain unchanged.

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
0.1.0-alpha.3.1 43 11/22/2026
0.1.0-alpha.2.1 57 11/9/2026