StellaOps.Workflow.DataStore.PostgreSQL
PostgreSQL store for the workflow engine: definitions, runtime state, projections, signals and schedules; applies its schema migrations at host startup. Install Installing Stella Ops packagesWorkflow downloads and signaturesnet10.01.0.1-20261118T121708Zdotnet add package StellaOps.
Namespaces
| Namespace | Types |
|---|---|
StellaOps. | 29 |
namespace StellaOps.Workflow.DataStore.PostgreSQL
| Type | Kind | Description |
|---|---|---|
PostgresWorkflowBackendOptions | class | Operator knobs of the Workflow PostgreSQL store. |
PostgresWorkflowChildLinkStore | class | PostgreSQL IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation transaction when there is one. |
PostgresWorkflowDataStoreExtensions | class | Registers the PostgreSQL workflow store. |
PostgresWorkflowDataStoreRegistrationOptions | class | Optional parts of PostgresWorkflowDataStoreExtensions.. |
PostgresWorkflowDataStoreRoutine | class | Dependency-injection routine of the PostgreSQL store. |
PostgresWorkflowDatabase | class | The PostgreSQL connection and change scope of the workflow store. |
PostgresWorkflowDefinitionStore | class | PostgreSQL-backed implementation of IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore. |
PostgresWorkflowDurableMaintenanceStore | class | PostgreSQL IWorkflowDurableMaintenanceStore: read-only probes over the durable tables. |
PostgresWorkflowDurableStartStore | class | PostgreSQL IWorkflowDurableStartStore. |
PostgresWorkflowExecutionConsoleReadStore | class | PostgreSQL IWorkflowExecutionConsoleReadStore. |
PostgresWorkflowExternalActivityStore | class | PostgreSQL IWorkflowExternalActivityStore. |
PostgresWorkflowFirstSeenLedger | class | The durable first-seen ledger in workflow. (the schema script). |
PostgresWorkflowHistoryStore | class | PostgreSQL IWorkflowHistoryStore: events in wf_execution_events, the history cursor (floor, next sequence, legal hold, retention policy) on the instance row. |
PostgresWorkflowHostedJobLockService | class | The hosted job lock, in PostgreSQL. |
PostgresWorkflowMapStore | class | PostgreSQL IWorkflowMapStore. |
PostgresWorkflowMutationCoordinator | class | Begins the change scopes of the PostgreSQL workflow store. |
PostgresWorkflowMutationSessionAccessor | class | Holds the PostgreSQL session of the open change scope. |
PostgresWorkflowOutboxStore | class | PostgreSQL IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox. |
PostgresWorkflowProjectionRetentionStore | class | PostgreSQL IWorkflowProjectionRetentionStore. |
PostgresWorkflowProjectionStore | class | The instance and task projections, in PostgreSQL. |
PostgresWorkflowRegisteredSignalStore | class | PostgreSQL IWorkflowRegisteredSignalStore: each PostgresWorkflowRegisteredSignalStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind. |
PostgresWorkflowRuntimeStateStore | class | The runtime states of instances, in PostgreSQL. |
PostgresWorkflowScheduleBus | class | Schedules signals in the PostgreSQL signal store. |
PostgresWorkflowSignalBus | class | The native PostgreSQL signal driver: the signal store delivers the wakes. |
PostgresWorkflowSignalDeadLetterStore | class | The dead-lettered signals, in PostgreSQL. |
PostgresWorkflowSignalStore | class | The signal queue, in PostgreSQL. |
PostgresWorkflowSqlBuilder | class | Run-time statements of the Workflow store. |
PostgresWorkflowWakeOutbox | class | The wake outbox, in PostgreSQL. |
WorkflowTables | class | The fixed names of the Workflow PostgreSQL store. |
class PostgresWorkflowBackendOptions
public sealed class PostgresWorkflowBackendOptions
Operator knobs of the Workflow PostgreSQL store. The schema and table names are fixed, not options (see WorkflowTables), and the connection comes only from PostgresWorkflowBackendOptions.: there is no connection string name and no generic fallback.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowBackendOptions( | constructor | Creates an instance of Postgres. |
ConnectionEnvironmentVariable | constant | The Workflow service’s own database connection key; fail closed without it. |
SectionName | constant | The configuration section the options bind from: Workflow. |
ApplicationName | property | The application name the connections report to PostgreSQL; stellaops-workflow when not set. |
BlockingWaitSeconds | property | How long a receive waits for a signal before it returns empty, in seconds; a value below 1 counts as 1. |
ClaimTimeoutSeconds | property | How long a claimed signal stays leased to its consumer, in seconds. |
ConnectionIdleLifetimeSeconds | property | How long an idle pooled connection is kept, in seconds; the driver default applies when not set or not positive. |
MaxPoolSize | property | The largest number of pooled connections, at least PostgresWorkflowBackendOptions.. |
MinPoolSize | property | The smallest number of pooled connections; a negative value counts as 0. |
NotifyChannel | property | The PostgreSQL notification channel that announces new signals. |
Pooling | property | Whether connections are pooled. |
WakeOutboxNotifyChannel | property | The PostgreSQL notification channel of the wake outbox. |
constructor PostgresWorkflowBackendOptions() #
PostgresWorkflowBackendOptions() #public PostgresWorkflowBackendOptions()
Creates an instance of Postgres.
constant ConnectionEnvironmentVariable #
ConnectionEnvironmentVariable #public const string ConnectionEnvironmentVariable = "STELLAOPS_POSTGRES_WORKFLOW_CONNECTION"
The Workflow service’s own database connection key; fail closed without it.
constant SectionName #
SectionName #public const string SectionName = "WorkflowBackend:Postgres"
The configuration section the options bind from: Workflow.
property ApplicationName #
ApplicationName #public string? ApplicationName { get; set; }
The application name the connections report to PostgreSQL; stellaops-workflow when not set.
property BlockingWaitSeconds #
BlockingWaitSeconds #public int BlockingWaitSeconds { get; set; }
How long a receive waits for a signal before it returns empty, in seconds; a value below 1 counts as 1. The default is 30.
property ClaimTimeoutSeconds #
ClaimTimeoutSeconds #public int ClaimTimeoutSeconds { get; set; }
How long a claimed signal stays leased to its consumer, in seconds. The default is 60.
property ConnectionIdleLifetimeSeconds #
ConnectionIdleLifetimeSeconds #public int? ConnectionIdleLifetimeSeconds { get; set; }
How long an idle pooled connection is kept, in seconds; the driver default applies when not set or not positive. The default is 300.
property MaxPoolSize #
MaxPoolSize #public int MaxPoolSize { get; set; }
The largest number of pooled connections, at least PostgresWorkflowBackendOptions.. The default is 100.
property MinPoolSize #
MinPoolSize #public int MinPoolSize { get; set; }
The smallest number of pooled connections; a negative value counts as 0. The default is 1.
property NotifyChannel #
NotifyChannel #public string NotifyChannel { get; set; }
The PostgreSQL notification channel that announces new signals. The default is workflow_signal.
property Pooling #
Pooling #public bool Pooling { get; set; }
Whether connections are pooled. The default is true.
property WakeOutboxNotifyChannel #
WakeOutboxNotifyChannel #public string WakeOutboxNotifyChannel { get; set; }
The PostgreSQL notification channel of the wake outbox. The default is workflow_.
class PostgresWorkflowChildLinkStore
public sealed class PostgresWorkflowChildLinkStore : IWorkflowChildLinkStore
PostgreSQL IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation transaction when there is one.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowChildLinkStore( | constructor | PostgreSQL IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation transaction when there is one. |
GetAsync( | method | Reads a child link. |
InsertAsync( | method | Inserts the link and appends the message; throws WorkflowStoreDuplicateExceptionwhen the link exists. |
UpdateAsync( | method | Replaces the link when its stored version is expectedVersion and appends the message, if any; throws WorkflowStoreConcurrencyExceptionon a version mismatch. |
constructor PostgresWorkflowChildLinkStore(PostgresWorkflowDatabase) #
PostgresWorkflowChildLinkStore(PostgresWorkflowDatabase) #public PostgresWorkflowChildLinkStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation transaction when there is one.
method GetAsync(string, CancellationToken) #
GetAsync(string, CancellationToken) #public Task<WorkflowChildLink?> GetAsync(string linkId, CancellationToken cancellationToken = default)
Reads a child link.
Parameters
linkId: The link.cancellationToken: Cancels the operation.
Returns
The link, or null.
method InsertAsync(WorkflowChildLink, WorkflowOutboxMessage, CancellationToken) #
InsertAsync(WorkflowChildLink, WorkflowOutboxMessage, CancellationToken) #public Task InsertAsync(WorkflowChildLink link, WorkflowOutboxMessage message, CancellationToken cancellationToken = default)
Inserts the link and appends the message; throws WorkflowStoreDuplicateExceptionwhen the link exists.
method UpdateAsync(WorkflowChildLink, long, WorkflowOutboxMessage, CancellationToken) #
UpdateAsync(WorkflowChildLink, long, WorkflowOutboxMessage, CancellationToken) #public Task UpdateAsync(WorkflowChildLink link, long expectedVersion, WorkflowOutboxMessage? message, CancellationToken cancellationToken = default)
Replaces the link when its stored version is expectedVersion and appends the message, if any; throws WorkflowStoreConcurrencyExceptionon a version mismatch.
class PostgresWorkflowDataStoreExtensions
public static class PostgresWorkflowDataStoreExtensions
Registers the PostgreSQL workflow store.
Members
| Member | Kind | Summary |
|---|---|---|
AddWorkflowPostgresDataStore( | extension method | Registers the PostgreSQL workflow store when Workflow is Postgres or unset; otherwise it only records the store module. |
extension method AddWorkflowPostgresDataStore(IServiceCollection, IConfiguration, Action<PostgresWorkflowDataStoreRegistrationOptions>) #
AddWorkflowPostgresDataStore(IServiceCollection, IConfiguration, Action<PostgresWorkflowDataStoreRegistrationOptions>) #public static IServiceCollection AddWorkflowPostgresDataStore(this IServiceCollection services, IConfiguration configuration, Action<PostgresWorkflowDataStoreRegistrationOptions>? configure = null)
Registers the PostgreSQL workflow store when Workflow is Postgres or unset; otherwise it only records the store module. The connection string is the STELLAOPS_ setting; registration fails without it.
Parameters
services: The service collection to add the services to.configuration: The host configuration.configure: Changes what is registered besides the store, for example the start-up schema script.
Returns
The same service collection, for chaining.
class PostgresWorkflowDataStoreRegistrationOptions
public sealed class PostgresWorkflowDataStoreRegistrationOptions
Optional parts of PostgresWorkflowDataStoreExtensions..
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowDataStoreRegistrationOptions( | constructor | Creates an instance of Postgres. |
ApplyMigrationsOnStartup | property | Apply the schema script of Stella at host start (startup migrations). |
RegisterDefinitionStore | property | Replace IWorkflowDefinitionStorewith PostgresWorkflowDefinitionStore. |
RegisterWakeOutbox | property | Replace the wake outbox and its receiver with PostgresWorkflowWakeOutbox. |
constructor PostgresWorkflowDataStoreRegistrationOptions() #
PostgresWorkflowDataStoreRegistrationOptions() #public PostgresWorkflowDataStoreRegistrationOptions()
Creates an instance of Postgres.
property ApplyMigrationsOnStartup #
ApplyMigrationsOnStartup #public bool ApplyMigrationsOnStartup { get; set; }
Apply the schema script of Stella at host start (startup migrations).
property RegisterDefinitionStore #
RegisterDefinitionStore #public bool RegisterDefinitionStore { get; set; }
Replace IWorkflowDefinitionStorewith PostgresWorkflowDefinitionStore.
property RegisterWakeOutbox #
RegisterWakeOutbox #public bool RegisterWakeOutbox { get; set; }
Replace the wake outbox and its receiver with PostgresWorkflowWakeOutbox.
class PostgresWorkflowDataStoreRoutine
public sealed class PostgresWorkflowDataStoreRoutine : IDependencyInjectionRoutine
Dependency-injection routine of the PostgreSQL store. A host that loads this assembly as a plugin discovers the routine; it registers exactly what PostgresWorkflowDataStoreExtensions.registers.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowDataStoreRoutine( | constructor | Creates an instance of Postgres. |
Register( | method | Registers what Add registers. |
constructor PostgresWorkflowDataStoreRoutine() #
PostgresWorkflowDataStoreRoutine() #public PostgresWorkflowDataStoreRoutine()
Creates an instance of Postgres.
method Register(IServiceCollection, IConfiguration) #
Register(IServiceCollection, IConfiguration) #public IServiceCollection Register(IServiceCollection services, IConfiguration configuration)
Registers what Add registers.
Parameters
services: The service collection.configuration: The host configuration.
Returns
The same service collection.
class PostgresWorkflowDatabase
public sealed class PostgresWorkflowDatabase
The PostgreSQL connection and change scope of the workflow store.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowDatabase( | constructor | The PostgreSQL connection and change scope of the workflow store. |
constructor PostgresWorkflowDatabase(IConfiguration, IOptions<PostgresWorkflowBackendOptions>, PostgresWorkflowMutationSessionAccessor, IWorkflowMutationScopeAccessor) #
PostgresWorkflowDatabase(IConfiguration, IOptions<PostgresWorkflowBackendOptions>, PostgresWorkflowMutationSessionAccessor, IWorkflowMutationScopeAccessor) #public PostgresWorkflowDatabase(IConfiguration configuration, IOptions<PostgresWorkflowBackendOptions> options, PostgresWorkflowMutationSessionAccessor sessionAccessor, IWorkflowMutationScopeAccessor scopeAccessor)
The PostgreSQL connection and change scope of the workflow store.
class PostgresWorkflowDefinitionStore
public sealed class PostgresWorkflowDefinitionStore : IWorkflowDefinitionStore, IWorkflowDefinitionGovernanceStore
PostgreSQL-backed implementation of IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore. Stores versioned canonical workflow definitions with their provenance in the wf_definitions table; a stored version is immutable, a managed definition is activated only through governance, and every governed activation leaves a row in wf_definition_audit.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowDefinitionStore( | constructor | PostgreSQL-backed implementation of IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore. |
ActivateAsync( | method | Sets a specific version as active for a workflow name. |
ActivateGovernedAsync( | method | Activates a version under the activation fence and the rollback rule, and records the activation for the audit. |
FindByHashAsync( | method | Finds any definition record matching the given content hash, regardless of version. |
GetActiveAsync( | method | Gets the active definition for a workflow name. |
GetAllActiveAsync( | method | Gets all active definitions across all workflow names. |
GetAsync( | method | Gets a specific version of a workflow definition. |
GetVersionsAsync( | method | Gets all versions of a workflow definition, ordered by creation date descending. |
UpsertAsync( | method | Inserts or updates a definition record. |
constructor PostgresWorkflowDefinitionStore(PostgresWorkflowDatabase) #
PostgresWorkflowDefinitionStore(PostgresWorkflowDatabase) #public PostgresWorkflowDefinitionStore(PostgresWorkflowDatabase db)
PostgreSQL-backed implementation of IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore. Stores versioned canonical workflow definitions with their provenance in the wf_definitions table; a stored version is immutable, a managed definition is activated only through governance, and every governed activation leaves a row in wf_definition_audit.
method ActivateAsync(string, string, CancellationToken) #
ActivateAsync(string, string, CancellationToken) #public Task ActivateAsync(string workflowName, string version, CancellationToken cancellationToken = default)
Sets a specific version as active for a workflow name. Deactivates all other versions of the same workflow.
method ActivateGovernedAsync(WorkflowDefinitionActivationRecord, CancellationToken) #
ActivateGovernedAsync(WorkflowDefinitionActivationRecord, CancellationToken) #public Task ActivateGovernedAsync(WorkflowDefinitionActivationRecord activation, CancellationToken cancellationToken = default)
Activates a version under the activation fence and the rollback rule, and records the activation for the audit.
Parameters
activation: The activation.cancellationToken: Cancels the operation.
Returns
A task that completes when the version is active.
Exceptions
Invalid: The fence or the rollback rule refuses the activation; the message is theOperation Exception WORKFLOW_code.DEFINITION_ *
method FindByHashAsync(string, string, CancellationToken) #
FindByHashAsync(string, string, CancellationToken) #public Task<WorkflowDefinitionRecord?> FindByHashAsync(string workflowName, string contentHash, CancellationToken cancellationToken = default)
Finds any definition record matching the given content hash, regardless of version. Used to detect duplicate imports.
method GetActiveAsync(string, CancellationToken) #
GetActiveAsync(string, CancellationToken) #public Task<WorkflowDefinitionRecord?> GetActiveAsync(string workflowName, CancellationToken cancellationToken = default)
Gets the active definition for a workflow name. Returns null if no definition is stored for this workflow.
method GetAllActiveAsync(CancellationToken) #
GetAllActiveAsync(CancellationToken) #public Task<IReadOnlyCollection<WorkflowDefinitionRecord>> GetAllActiveAsync(CancellationToken cancellationToken = default)
Gets all active definitions across all workflow names.
method GetAsync(string, string, CancellationToken) #
GetAsync(string, string, CancellationToken) #public Task<WorkflowDefinitionRecord?> GetAsync(string workflowName, string version, CancellationToken cancellationToken = default)
Gets a specific version of a workflow definition.
method GetVersionsAsync(string, CancellationToken) #
GetVersionsAsync(string, CancellationToken) #public Task<IReadOnlyCollection<WorkflowDefinitionRecord>> GetVersionsAsync(string workflowName, CancellationToken cancellationToken = default)
Gets all versions of a workflow definition, ordered by creation date descending.
method UpsertAsync(WorkflowDefinitionRecord, CancellationToken) #
UpsertAsync(WorkflowDefinitionRecord, CancellationToken) #public Task UpsertAsync(WorkflowDefinitionRecord record, CancellationToken cancellationToken = default)
Inserts or updates a definition record.
class PostgresWorkflowDurableMaintenanceStore
public sealed class PostgresWorkflowDurableMaintenanceStore : IWorkflowDurableMaintenanceStore
PostgreSQL IWorkflowDurableMaintenanceStore: read-only probes over the durable tables.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowDurableMaintenanceStore( | constructor | PostgreSQL IWorkflowDurableMaintenanceStore: read-only probes over the durable tables. |
HasOrphanedStepAttemptsAsync( | method | True when a step attempt exists whose step (same step, execution and scope ids) does not. |
constructor PostgresWorkflowDurableMaintenanceStore(PostgresWorkflowDatabase) #
PostgresWorkflowDurableMaintenanceStore(PostgresWorkflowDatabase) #public PostgresWorkflowDurableMaintenanceStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowDurableMaintenanceStore: read-only probes over the durable tables.
method HasOrphanedStepAttemptsAsync(CancellationToken) #
HasOrphanedStepAttemptsAsync(CancellationToken) #public Task<bool> HasOrphanedStepAttemptsAsync(CancellationToken cancellationToken = default)
True when a step attempt exists whose step (same step, execution and scope ids) does not.
class PostgresWorkflowDurableStartStore
public sealed class PostgresWorkflowDurableStartStore : IWorkflowDurableStartStore
PostgreSQL IWorkflowDurableStartStore. Each write and its durable outbox messages run in one savepoint of the ambient mutation transaction (or their own transaction). A root start writes the instance and runtime-state rows in the shape PostgresWorkflowProjectionStoreand PostgresWorkflowRuntimeStateStorewrite them: the instance key is the workflow execution id, as for every PostgreSQL instance row, so no surrogate id is drawn.
Members
constructor PostgresWorkflowDurableStartStore(PostgresWorkflowDatabase) #
PostgresWorkflowDurableStartStore(PostgresWorkflowDatabase) #public PostgresWorkflowDurableStartStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowDurableStartStore. Each write and its durable outbox messages run in one savepoint of the ambient mutation transaction (or their own transaction). A root start writes the instance and runtime-state rows in the shape PostgresWorkflowProjectionStoreand PostgresWorkflowRuntimeStateStorewrite them: the instance key is the workflow execution id, as for every PostgreSQL instance row, so no surrogate id is drawn.
method GetFenceAsync(string, CancellationToken) #
GetFenceAsync(string, CancellationToken) #public Task<WorkflowPrestartTerminalFence?> GetFenceAsync(string startRequestId, CancellationToken cancellationToken = default)
Reads the prestart terminal fence of a start request.
Parameters
startRequestId: The start request.cancellationToken: Cancels the operation.
Returns
The fence, or null.
method GetReceiptAsync(string, CancellationToken) #
GetReceiptAsync(string, CancellationToken) #public Task<WorkflowStartReceipt?> GetReceiptAsync(string startRequestId, CancellationToken cancellationToken = default)
Reads the receipt of a start request.
Parameters
startRequestId: The start request.cancellationToken: Cancels the operation.
Returns
The receipt, or null.
method GetTerminalInboxAsync(string, CancellationToken) #
GetTerminalInboxAsync(string, CancellationToken) #public Task<WorkflowTerminalInboxEntry?> GetTerminalInboxAsync(string commandEventId, CancellationToken cancellationToken = default)
Reads a terminal inbox entry.
Parameters
commandEventId: The command.cancellationToken: Cancels the operation.
Returns
The entry, or null.
method HasOpenExecutionAsync(string, string, string, CancellationToken) #
HasOpenExecutionAsync(string, string, string, CancellationToken) #public Task<bool> HasOpenExecutionAsync(string definitionCode, string businessReferenceSha256, string openStatus, CancellationToken cancellationToken = default)
True when an execution of the definition is open for the business reference.
method RecordPrestartTerminalAsync(WorkflowPrestartTerminalFence, WorkflowStartReceipt, WorkflowTerminalInboxEntry, WorkflowOutboxMessage, CancellationToken) #
RecordPrestartTerminalAsync(WorkflowPrestartTerminalFence, WorkflowStartReceipt, WorkflowTerminalInboxEntry, WorkflowOutboxMessage, CancellationToken) #public Task RecordPrestartTerminalAsync(WorkflowPrestartTerminalFence fence, WorkflowStartReceipt? newReceipt, WorkflowTerminalInboxEntry inbox, WorkflowOutboxMessage message, CancellationToken cancellationToken = default)
Records a prestart terminal command: the fence, the fenced receipt when none exists, the inbox entry and the acknowledgement.
method RecordStartDecisionAsync(WorkflowStartReceipt, WorkflowRootExecutionStart, IReadOnlyList<WorkflowOutboxMessage>, CancellationToken) #
RecordStartDecisionAsync(WorkflowStartReceipt, WorkflowRootExecutionStart, IReadOnlyList<WorkflowOutboxMessage>, CancellationToken) #public Task RecordStartDecisionAsync(WorkflowStartReceipt receipt, WorkflowRootExecutionStart? root, IReadOnlyList<WorkflowOutboxMessage> messages, CancellationToken cancellationToken = default)
Records a start decision: the receipt, the root execution rows when the start created one (the store allocates the instance id), and the messages.
method TryCompleteReceiptAsync(WorkflowStartReceipt, WorkflowOutboxMessage, CancellationToken) #
TryCompleteReceiptAsync(WorkflowStartReceipt, WorkflowOutboxMessage, CancellationToken) #public Task<bool> TryCompleteReceiptAsync(WorkflowStartReceipt receipt, WorkflowOutboxMessage message, CancellationToken cancellationToken = default)
Writes the result into a receipt that has none yet, with its message. Returns false, and writes nothing, when the stored receipt already carries a result.
class PostgresWorkflowExecutionConsoleReadStore
public sealed class PostgresWorkflowExecutionConsoleReadStore : IWorkflowExecutionConsoleReadStore
PostgreSQL IWorkflowExecutionConsoleReadStore. Identifiers compare and sort with the C collation (byte order), whatever the database collation, so the list cursor pages the same rows.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowExecutionConsoleReadStore( | constructor | PostgreSQL IWorkflowExecutionConsoleReadStore. |
GetAttemptsAsync( | method | Up to maxCount step attempts of the execution, by creation time. |
GetDeliveriesAsync( | method | All activity dispatches of the execution, then all its completions, unsorted. |
GetExecutionAsync( | method | Reads one execution. |
GetMapItemsAsync( | method | Up to maxCount items of the execution’s maps, by map execution id, then ordinal. |
GetMapsAsync( | method | Up to maxCount map executions of the execution, in the backend’s natural order. |
GetScopesAsync( | method | Up to maxCount scopes of the execution; ordered by creation time when orderByCreation is set, otherwise in the backend’s natural order. |
GetStepsAsync( | method | Up to maxCount steps of the execution, by creation time. |
ListExecutionsAsync( | method | Up to take executions, newest first (created time, then execution id, both descending), strictly after the cursor position when createdBeforeUtc is set. |
constructor PostgresWorkflowExecutionConsoleReadStore(PostgresWorkflowDatabase) #
PostgresWorkflowExecutionConsoleReadStore(PostgresWorkflowDatabase) #public PostgresWorkflowExecutionConsoleReadStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowExecutionConsoleReadStore. Identifiers compare and sort with the C collation (byte order), whatever the database collation, so the list cursor pages the same rows.
method GetAttemptsAsync(string, int, CancellationToken) #
GetAttemptsAsync(string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleAttemptRecord>> GetAttemptsAsync(string workflowExecutionId, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount step attempts of the execution, by creation time.
method GetDeliveriesAsync(string, CancellationToken) #
GetDeliveriesAsync(string, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleDeliveryRecord>> GetDeliveriesAsync(string workflowExecutionId, CancellationToken cancellationToken = default)
All activity dispatches of the execution, then all its completions, unsorted.
method GetExecutionAsync(string, CancellationToken) #
GetExecutionAsync(string, CancellationToken) #public Task<WorkflowConsoleExecutionRecord?> GetExecutionAsync(string workflowExecutionId, CancellationToken cancellationToken = default)
Reads one execution.
Parameters
workflowExecutionId: The execution.cancellationToken: Cancels the operation.
Returns
The execution, or null.
method GetMapItemsAsync(string, int, CancellationToken) #
GetMapItemsAsync(string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleMapItemRecord>> GetMapItemsAsync(string workflowExecutionId, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount items of the execution’s maps, by map execution id, then ordinal.
method GetMapsAsync(string, int, CancellationToken) #
GetMapsAsync(string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleMapRecord>> GetMapsAsync(string workflowExecutionId, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount map executions of the execution, in the backend’s natural order.
method GetScopesAsync(string, int, bool, CancellationToken) #
GetScopesAsync(string, int, bool, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleScopeRecord>> GetScopesAsync(string workflowExecutionId, int maxCount, bool orderByCreation, CancellationToken cancellationToken = default)
Up to maxCount scopes of the execution; ordered by creation time when orderByCreation is set, otherwise in the backend’s natural order.
method GetStepsAsync(string, int, CancellationToken) #
GetStepsAsync(string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleStepRecord>> GetStepsAsync(string workflowExecutionId, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount steps of the execution, by creation time.
method ListExecutionsAsync(DateTime?, string, int, CancellationToken) #
ListExecutionsAsync(DateTime?, string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowConsoleExecutionRecord>> ListExecutionsAsync(DateTime? createdBeforeUtc, string? executionIdBefore, int take, CancellationToken cancellationToken = default)
Up to take executions, newest first (created time, then execution id, both descending), strictly after the cursor position when createdBeforeUtc is set.
class PostgresWorkflowExternalActivityStore
public sealed class PostgresWorkflowExternalActivityStore : IWorkflowExternalActivityStore
PostgreSQL IWorkflowExternalActivityStore. Each PostgresWorkflowExternalActivityStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind. Versioned rows are updated before anything is inserted, in one fixed order (map executions, map items, runtime states, instance cursors, steps, lineages), so two decisions on the same execution queue on the same row lock instead of deadlocking; the loser then matches no row and reports a version conflict.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowExternalActivityStore( | constructor | PostgreSQL IWorkflowExternalActivityStore. |
GetAttemptAsync( | method | Reads an attempt. |
GetAttemptByNumberAsync( | method | Reads an attempt of a step by number. |
GetCompletionAsync( | method | Reads a completion. |
GetDispatchForAttemptAsync( | method | Reads the dispatch of an attempt. |
GetLastAttemptNumberAsync( | method | The highest attempt number recorded for the step; 0 when it has none. |
GetLastReprocessOccurrenceAsync( | method | The highest reprocess occurrence of the scope; 0 when it has none. |
GetLineageAsync( | method | Reads a lineage. |
GetLineagesAsync( | method | The step’s lineages in status, highest generation first, optionally limited to one source attempt. |
GetMapItemsAsync( | method | Reads the items of a map in a status. |
GetMapsForStopAsync( | method | The map executions a stop targets, in any status. |
GetReadyCancelsAsync( | method | Reads up to maxCount READY cancels, oldest first. |
GetReadyDispatchesAsync( | method | Reads up to maxCount READY dispatches, oldest first. |
GetRootScopeExecutionIdAsync( | method | Reads the root scope of an execution. |
GetRuntimeAsync( | method | Reads the runtime state of an execution. |
GetStepAsync( | method | Reads a step. |
GetStepsForStopAsync( | method | The steps a stop targets, ordered by step execution id; for a map, the items’ active steps. |
MarkCancelPublishedAsync( | method | Marks a cancel PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist. |
MarkDispatchPublishedAsync( | method | Marks a dispatch PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist. |
WriteAsync( | method | Writes the changes atomically. |
constructor PostgresWorkflowExternalActivityStore(PostgresWorkflowDatabase) #
PostgresWorkflowExternalActivityStore(PostgresWorkflowDatabase) #public PostgresWorkflowExternalActivityStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowExternalActivityStore. Each PostgresWorkflowExternalActivityStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind. Versioned rows are updated before anything is inserted, in one fixed order (map executions, map items, runtime states, instance cursors, steps, lineages), so two decisions on the same execution queue on the same row lock instead of deadlocking; the loser then matches no row and reports a version conflict.
method GetAttemptAsync(string, CancellationToken) #
GetAttemptAsync(string, CancellationToken) #public Task<WorkflowActivityAttempt?> GetAttemptAsync(string attemptId, CancellationToken cancellationToken = default)
Reads an attempt.
Parameters
attemptId: The attempt.cancellationToken: Cancels the operation.
Returns
The attempt, or null.
method GetAttemptByNumberAsync(string, int, CancellationToken) #
GetAttemptByNumberAsync(string, int, CancellationToken) #public Task<WorkflowActivityAttempt?> GetAttemptByNumberAsync(string stepExecutionId, int attemptNumber, CancellationToken cancellationToken = default)
Reads an attempt of a step by number.
Parameters
stepExecutionId: The step execution.attemptNumber: The attempt number.cancellationToken: Cancels the operation.
Returns
The attempt, or null.
method GetCompletionAsync(string, CancellationToken) #
GetCompletionAsync(string, CancellationToken) #public Task<WorkflowActivityCompletionEntry?> GetCompletionAsync(string eventId, CancellationToken cancellationToken = default)
Reads a completion.
Parameters
eventId: The completion event.cancellationToken: Cancels the operation.
Returns
The completion, or null.
method GetDispatchForAttemptAsync(string, CancellationToken) #
GetDispatchForAttemptAsync(string, CancellationToken) #public Task<WorkflowActivityDispatchEntry?> GetDispatchForAttemptAsync(string attemptId, CancellationToken cancellationToken = default)
Reads the dispatch of an attempt.
Parameters
attemptId: The attempt.cancellationToken: Cancels the operation.
Returns
The dispatch, or null.
method GetLastAttemptNumberAsync(string, CancellationToken) #
GetLastAttemptNumberAsync(string, CancellationToken) #public Task<int> GetLastAttemptNumberAsync(string stepExecutionId, CancellationToken cancellationToken = default)
The highest attempt number recorded for the step; 0 when it has none.
method GetLastReprocessOccurrenceAsync(string, CancellationToken) #
GetLastReprocessOccurrenceAsync(string, CancellationToken) #public Task<int> GetLastReprocessOccurrenceAsync(string sourceScopeExecutionId, CancellationToken cancellationToken = default)
The highest reprocess occurrence of the scope; 0 when it has none.
method GetLineageAsync(string, CancellationToken) #
GetLineageAsync(string, CancellationToken) #public Task<WorkflowContinuationLineage?> GetLineageAsync(string lineageId, CancellationToken cancellationToken = default)
Reads a lineage.
Parameters
lineageId: The lineage.cancellationToken: Cancels the operation.
Returns
The lineage, or null.
method GetLineagesAsync(string, string, string, CancellationToken) #
GetLineagesAsync(string, string, string, CancellationToken) #public Task<IReadOnlyList<WorkflowContinuationLineage>> GetLineagesAsync(string stepExecutionId, string? sourceAttemptId, string status, CancellationToken cancellationToken = default)
The step’s lineages in status, highest generation first, optionally limited to one source attempt.
method GetMapItemsAsync(string, string, CancellationToken) #
GetMapItemsAsync(string, string, CancellationToken) #public Task<IReadOnlyList<WorkflowActivityMapItemState>> GetMapItemsAsync(string mapExecutionId, string status, CancellationToken cancellationToken = default)
Reads the items of a map in a status.
Parameters
mapExecutionId: The map execution.status: The status.cancellationToken: Cancels the operation.
Returns
The items.
method GetMapsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken) #
GetMapsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken) #public Task<IReadOnlyList<WorkflowActivityMapState>> GetMapsForStopAsync(WorkflowActivityStopTargetKind targetKind, string targetId, CancellationToken cancellationToken = default)
The map executions a stop targets, in any status.
method GetReadyCancelsAsync(int, CancellationToken) #
GetReadyCancelsAsync(int, CancellationToken) #public Task<IReadOnlyList<WorkflowActivityCancelEntry>> GetReadyCancelsAsync(int maxCount, CancellationToken cancellationToken = default)
Reads up to maxCount READY cancels, oldest first.
method GetReadyDispatchesAsync(int, CancellationToken) #
GetReadyDispatchesAsync(int, CancellationToken) #public Task<IReadOnlyList<WorkflowActivityDispatchEntry>> GetReadyDispatchesAsync(int maxCount, CancellationToken cancellationToken = default)
Reads up to maxCount READY dispatches, oldest first.
method GetRootScopeExecutionIdAsync(string, CancellationToken) #
GetRootScopeExecutionIdAsync(string, CancellationToken) #public Task<string?> GetRootScopeExecutionIdAsync(string workflowExecutionId, CancellationToken cancellationToken = default)
Reads the root scope of an execution.
Parameters
workflowExecutionId: The execution.cancellationToken: Cancels the operation.
Returns
The root scope, or null.
method GetRuntimeAsync(string, CancellationToken) #
GetRuntimeAsync(string, CancellationToken) #public Task<WorkflowActivityRuntimeState?> GetRuntimeAsync(string workflowExecutionId, CancellationToken cancellationToken = default)
Reads the runtime state of an execution.
Parameters
workflowExecutionId: The execution.cancellationToken: Cancels the operation.
Returns
The runtime state, or null.
method GetStepAsync(string, CancellationToken) #
GetStepAsync(string, CancellationToken) #public Task<WorkflowActivityStep?> GetStepAsync(string stepExecutionId, CancellationToken cancellationToken = default)
Reads a step.
Parameters
stepExecutionId: The step execution.cancellationToken: Cancels the operation.
Returns
The step, or null.
method GetStepsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken) #
GetStepsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken) #public Task<IReadOnlyList<WorkflowActivityStep>> GetStepsForStopAsync(WorkflowActivityStopTargetKind targetKind, string targetId, CancellationToken cancellationToken = default)
The steps a stop targets, ordered by step execution id; for a map, the items’ active steps.
method MarkCancelPublishedAsync(string, DateTime, CancellationToken) #
MarkCancelPublishedAsync(string, DateTime, CancellationToken) #public Task MarkCancelPublishedAsync(string cancelId, DateTime publishedAtUtc, CancellationToken cancellationToken = default)
Marks a cancel PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist.
method MarkDispatchPublishedAsync(string, DateTime, CancellationToken) #
MarkDispatchPublishedAsync(string, DateTime, CancellationToken) #public Task MarkDispatchPublishedAsync(string dispatchId, DateTime publishedAtUtc, CancellationToken cancellationToken = default)
Marks a dispatch PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist.
method WriteAsync(WorkflowExternalActivityWrite, CancellationToken) #
WriteAsync(WorkflowExternalActivityWrite, CancellationToken) #public Task WriteAsync(WorkflowExternalActivityWrite write, CancellationToken cancellationToken = default)
Writes the changes atomically. Throws WorkflowStoreConcurrencyExceptionwhen a changed row’s version moved and WorkflowStoreDuplicateExceptionwhen a new row’s key exists.
class PostgresWorkflowFirstSeenLedger
public sealed class PostgresWorkflowFirstSeenLedger : IWorkflowFirstSeenLedger
The durable first-seen ledger in workflow. (the schema script). It only inserts: a workflow already recorded keeps its first row (ON CONFLICT DO NOTHING), and the table’s trigger refuses UPDATE, DELETE and TRUNCATE. Its row count is the cumulative Designated Workflow technical count, which survives restarts and the removal of a workflow from the code catalogue. Every recording locks the table for its transaction, so engine instances that share the database are serialised and record each name once. Recording never refuses a workflow.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowFirstSeenLedger( | constructor | The durable first-seen ledger in workflow. (the schema script). |
IsDurable | property | true when the record survives a restart (the PostgreSQL and MongoDB ledgers); false for the process-memory ledger of a host without a workflow store, which counts only what this process has seen. |
CountAsync( | method | The number of distinct workflows ever recorded. |
ListAsync( | method | Every workflow ever recorded, one entry per workflow with its first sighting, ordered by WorkflowFirstSeenIdentity.(ordinal). |
RecordAsync( | method | Records the workflows in workflowNames that the ledger has not seen, with source (WorkflowFirstSeenSources) and seenOnUtc. |
RecordStoredDefinitionsAsync( | method | Records every workflow the definition store holds that the ledger has not seen, active or not, with the creation time of its first stored version. |
constructor PostgresWorkflowFirstSeenLedger(PostgresWorkflowDatabase) #
PostgresWorkflowFirstSeenLedger(PostgresWorkflowDatabase) #public PostgresWorkflowFirstSeenLedger(PostgresWorkflowDatabase db)
The durable first-seen ledger in workflow. (the schema script). It only inserts: a workflow already recorded keeps its first row (ON CONFLICT DO NOTHING), and the table’s trigger refuses UPDATE, DELETE and TRUNCATE. Its row count is the cumulative Designated Workflow technical count, which survives restarts and the removal of a workflow from the code catalogue. Every recording locks the table for its transaction, so engine instances that share the database are serialised and record each name once. Recording never refuses a workflow.
property IsDurable #
IsDurable #public bool IsDurable { get; }
true when the record survives a restart (the PostgreSQL and MongoDB ledgers); false for the process-memory ledger of a host without a workflow store, which counts only what this process has seen.
method CountAsync(CancellationToken) #
CountAsync(CancellationToken) #public Task<int> CountAsync(CancellationToken cancellationToken = default)
The number of distinct workflows ever recorded.
method ListAsync(CancellationToken) #
ListAsync(CancellationToken) #public Task<IReadOnlyList<WorkflowFirstSeenRecord>> ListAsync(CancellationToken cancellationToken = default)
Every workflow ever recorded, one entry per workflow with its first sighting, ordered by WorkflowFirstSeenIdentity.(ordinal). The number of entries is the count IWorkflowFirstSeenLedger.returns for the same ledger state. Reads only; records nothing.
method RecordAsync(IReadOnlyCollection<string>, string, DateTimeOffset, CancellationToken) #
RecordAsync(IReadOnlyCollection<string>, string, DateTimeOffset, CancellationToken) #public Task RecordAsync(IReadOnlyCollection<string> workflowNames, string source, DateTimeOffset seenOnUtc, CancellationToken cancellationToken = default)
Records the workflows in workflowNames that the ledger has not seen, with source (WorkflowFirstSeenSources) and seenOnUtc. A workflow already recorded is left as it is. Every recording is serialised against every other recording of the same ledger, so engines that share it record each name once.
method RecordStoredDefinitionsAsync(CancellationToken) #
RecordStoredDefinitionsAsync(CancellationToken) #public Task RecordStoredDefinitionsAsync(CancellationToken cancellationToken = default)
Records every workflow the definition store holds that the ledger has not seen, active or not, with the creation time of its first stored version. It reconciles imports whose ledger write was interrupted and definitions stored before the ledger existed. A ledger without a durable definition store records nothing here.
class PostgresWorkflowHistoryStore
public sealed class PostgresWorkflowHistoryStore : IWorkflowHistoryStore
PostgreSQL IWorkflowHistoryStore: events in wf_execution_events, the history cursor (floor, next sequence, legal hold, retention policy) on the instance row.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowHistoryStore( | constructor | PostgreSQL IWorkflowHistoryStore: events in wf_execution_events, the history cursor (floor, next sequence, legal hold, retention policy) on the instance row. |
CompactPrefixAsync( | method | Deletes, in one write, up to maxCount events from the history floor through throughSequence, stopping before the first retention-held event, and moves the floor to the first event kept. |
GetCursorAsync( | method | Reads the history cursor; throws when the execution does not exist. |
GetEventsAsync( | method | Reads up to maxCount events after afterSequence, in sequence order. |
constructor PostgresWorkflowHistoryStore(PostgresWorkflowDatabase) #
PostgresWorkflowHistoryStore(PostgresWorkflowDatabase) #public PostgresWorkflowHistoryStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowHistoryStore: events in wf_execution_events, the history cursor (floor, next sequence, legal hold, retention policy) on the instance row.
method CompactPrefixAsync(string, long, int, CancellationToken) #
CompactPrefixAsync(string, long, int, CancellationToken) #public Task<WorkflowHistoryCompactionResult> CompactPrefixAsync(string workflowExecutionId, long throughSequence, int maxCount, CancellationToken cancellationToken = default)
Deletes, in one write, up to maxCount events from the history floor through throughSequence, stopping before the first retention-held event, and moves the floor to the first event kept.
method GetCursorAsync(string, CancellationToken) #
GetCursorAsync(string, CancellationToken) #public Task<WorkflowHistoryCursor> GetCursorAsync(string workflowExecutionId, CancellationToken cancellationToken = default)
Reads the history cursor; throws when the execution does not exist.
method GetEventsAsync(string, long, int, CancellationToken) #
GetEventsAsync(string, long, int, CancellationToken) #public Task<IReadOnlyList<WorkflowHistoryEvent>> GetEventsAsync(string workflowExecutionId, long afterSequence, int maxCount, CancellationToken cancellationToken = default)
Reads up to maxCount events after afterSequence, in sequence order.
class PostgresWorkflowHostedJobLockService
public sealed class PostgresWorkflowHostedJobLockService : IWorkflowHostedJobLockService
The hosted job lock, in PostgreSQL.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowHostedJobLockService( | constructor | The hosted job lock, in PostgreSQL. |
ReleaseAsync( | method | Releases a lock the owner holds. |
TryAcquireAsync( | method | Takes a lock for an owner unless another owner holds an unexpired lease. |
constructor PostgresWorkflowHostedJobLockService(PostgresWorkflowDatabase) #
PostgresWorkflowHostedJobLockService(PostgresWorkflowDatabase) #public PostgresWorkflowHostedJobLockService(PostgresWorkflowDatabase database)
The hosted job lock, in PostgreSQL.
method ReleaseAsync(string, string, CancellationToken) #
ReleaseAsync(string, string, CancellationToken) #public Task ReleaseAsync(string lockName, string lockOwner, CancellationToken cancellationToken = default)
Releases a lock the owner holds.
Parameters
lockName: The lock.lockOwner: The owner.cancellationToken: Cancels the operation.
Returns
A task that completes when the lock is released.
method TryAcquireAsync(string, string, DateTime, TimeSpan, CancellationToken) #
TryAcquireAsync(string, string, DateTime, TimeSpan, CancellationToken) #public Task<bool> TryAcquireAsync(string lockName, string lockOwner, DateTime acquiredOnUtc, TimeSpan lease, CancellationToken cancellationToken = default)
Takes a lock for an owner unless another owner holds an unexpired lease.
Parameters
lockName: The lock.lockOwner: The owner.acquiredOnUtc: The time, in UTC.lease: How long the lock is held.cancellationToken: Cancels the operation.
Returns
Whether the owner holds the lock.
class PostgresWorkflowMapStore
public sealed class PostgresWorkflowMapStore : IWorkflowMapStore
PostgreSQL IWorkflowMapStore. Each PostgresWorkflowMapStore.runs in one savepoint of the ambient mutation transaction (or its own transaction). Changed rows are updated before anything is inserted, the map executions first and then the items, each in key order: two claims on the same map queue on the map row, and the one that commits second matches no row and loses as a whole with a version conflict.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowMapStore( | constructor | PostgreSQL IWorkflowMapStore. |
CountActiveClaimsAsync( | method | Counts the map’s CLAIMED items that hold capacity at nowUtc: an active step, or an unexpired lease. |
CountGlobalActiveClaimsAsync( | method | Counts the active claims (as above) across every map of the global activity class. |
GetClaimableItemsAsync( | method | Up to maxCount items that can be claimed at nowUtc, ordered by ordinal: READY items, and CLAIMED items with no active step whose lease has expired. |
GetGlobalMaxConcurrencyAsync( | method | The lowest declared max concurrency among the maps of the global activity class. |
GetItemAsync( | method | Reads a map item. |
GetItemsAsync( | method | All items of the map, ordered by ordinal. |
GetItemsByActiveStepAsync( | method | Up to maxCount items whose active step is active. |
GetMapAsync( | method | Reads a map execution. |
WriteAsync( | method | Writes the changes atomically. |
constructor PostgresWorkflowMapStore(PostgresWorkflowDatabase) #
PostgresWorkflowMapStore(PostgresWorkflowDatabase) #public PostgresWorkflowMapStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowMapStore. Each PostgresWorkflowMapStore.runs in one savepoint of the ambient mutation transaction (or its own transaction). Changed rows are updated before anything is inserted, the map executions first and then the items, each in key order: two claims on the same map queue on the map row, and the one that commits second matches no row and loses as a whole with a version conflict.
method CountActiveClaimsAsync(string, DateTime, CancellationToken) #
CountActiveClaimsAsync(string, DateTime, CancellationToken) #public Task<int> CountActiveClaimsAsync(string mapExecutionId, DateTime nowUtc, CancellationToken cancellationToken = default)
Counts the map’s CLAIMED items that hold capacity at nowUtc: an active step, or an unexpired lease.
method CountGlobalActiveClaimsAsync(string, DateTime, CancellationToken) #
CountGlobalActiveClaimsAsync(string, DateTime, CancellationToken) #public Task<int> CountGlobalActiveClaimsAsync(string globalActivityClass, DateTime nowUtc, CancellationToken cancellationToken = default)
Counts the active claims (as above) across every map of the global activity class.
method GetClaimableItemsAsync(string, DateTime, int, CancellationToken) #
GetClaimableItemsAsync(string, DateTime, int, CancellationToken) #public Task<IReadOnlyList<WorkflowMapItemRecord>> GetClaimableItemsAsync(string mapExecutionId, DateTime nowUtc, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount items that can be claimed at nowUtc, ordered by ordinal: READY items, and CLAIMED items with no active step whose lease has expired.
method GetGlobalMaxConcurrencyAsync(string, CancellationToken) #
GetGlobalMaxConcurrencyAsync(string, CancellationToken) #public Task<int> GetGlobalMaxConcurrencyAsync(string globalActivityClass, CancellationToken cancellationToken = default)
The lowest declared max concurrency among the maps of the global activity class.
method GetItemAsync(string, CancellationToken) #
GetItemAsync(string, CancellationToken) #public Task<WorkflowMapItemRecord?> GetItemAsync(string mapItemId, CancellationToken cancellationToken = default)
Reads a map item.
Parameters
mapItemId: The map item.cancellationToken: Cancels the operation.
Returns
The item, or null.
method GetItemsAsync(string, CancellationToken) #
GetItemsAsync(string, CancellationToken) #public Task<IReadOnlyList<WorkflowMapItemRecord>> GetItemsAsync(string mapExecutionId, CancellationToken cancellationToken = default)
All items of the map, ordered by ordinal.
method GetItemsByActiveStepAsync(string, int, CancellationToken) #
GetItemsByActiveStepAsync(string, int, CancellationToken) #public Task<IReadOnlyList<WorkflowMapItemRecord>> GetItemsByActiveStepAsync(string activeStepExecutionId, int maxCount, CancellationToken cancellationToken = default)
Up to maxCount items whose active step is active.
method GetMapAsync(string, CancellationToken) #
GetMapAsync(string, CancellationToken) #public Task<WorkflowMapExecutionRecord?> GetMapAsync(string mapExecutionId, CancellationToken cancellationToken = default)
Reads a map execution.
Parameters
mapExecutionId: The map execution.cancellationToken: Cancels the operation.
Returns
The map, or null.
method WriteAsync(WorkflowMapWrite, CancellationToken) #
WriteAsync(WorkflowMapWrite, CancellationToken) #public Task WriteAsync(WorkflowMapWrite write, CancellationToken cancellationToken = default)
Writes the changes atomically. Throws WorkflowStoreConcurrencyExceptionwhen a changed row’s version moved and WorkflowStoreDuplicateExceptionwhen a new row’s key exists.
class PostgresWorkflowMutationCoordinator
public sealed class PostgresWorkflowMutationCoordinator : IWorkflowMutationCoordinator
Begins the change scopes of the PostgreSQL workflow store.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowMutationCoordinator( | constructor | Begins the change scopes of the PostgreSQL workflow store. |
BeginAsync( | method | Begins a change scope. |
constructor PostgresWorkflowMutationCoordinator(PostgresWorkflowDatabase) #
PostgresWorkflowMutationCoordinator(PostgresWorkflowDatabase) #public PostgresWorkflowMutationCoordinator(PostgresWorkflowDatabase database)
Begins the change scopes of the PostgreSQL workflow store.
method BeginAsync(CancellationToken) #
BeginAsync(CancellationToken) #public Task<IWorkflowMutationScope> BeginAsync(CancellationToken cancellationToken = default)
Begins a change scope.
Parameters
cancellationToken: Cancels the operation.
Returns
The scope.
class PostgresWorkflowMutationSessionAccessor
public sealed class PostgresWorkflowMutationSessionAccessor
Holds the PostgreSQL session of the open change scope.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowMutationSessionAccessor( | constructor | Creates an instance of Postgres. |
constructor PostgresWorkflowMutationSessionAccessor() #
PostgresWorkflowMutationSessionAccessor() #public PostgresWorkflowMutationSessionAccessor()
Creates an instance of Postgres.
class PostgresWorkflowOutboxStore
public sealed class PostgresWorkflowOutboxStore : IWorkflowOutboxStore
PostgreSQL IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowOutboxStore( | constructor | PostgreSQL IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox. |
CompactDeliveredAsync( | method | Deletes up to batchSize rows per outbox published before cutoffUtc, and as many activity-completion inbox rows applied before it. |
GetReadyAsync( | method | Reads up to maxCount READY entries, oldest first, optionally limited to some channels. |
RecordDeliveryAttemptAsync( | method | Counts one delivery attempt; a non-null publishedAtUtc marks the entry PUBLISHED. |
TryMarkPublishedAsync( | method | Marks a READY entry PUBLISHED; false when it is not READY (already published or missing). |
constructor PostgresWorkflowOutboxStore(PostgresWorkflowDatabase) #
PostgresWorkflowOutboxStore(PostgresWorkflowDatabase) #public PostgresWorkflowOutboxStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.
method CompactDeliveredAsync(DateTime, int, CancellationToken) #
CompactDeliveredAsync(DateTime, int, CancellationToken) #public Task CompactDeliveredAsync(DateTime cutoffUtc, int batchSize, CancellationToken cancellationToken = default)
Deletes up to batchSize rows per outbox published before cutoffUtc, and as many activity-completion inbox rows applied before it.
method GetReadyAsync(WorkflowOutboxKind, IReadOnlyCollection<string>, int, CancellationToken) #
GetReadyAsync(WorkflowOutboxKind, IReadOnlyCollection<string>, int, CancellationToken) #public Task<IReadOnlyList<WorkflowOutboxEntry>> GetReadyAsync(WorkflowOutboxKind kind, IReadOnlyCollection<string>? channels, int maxCount, CancellationToken cancellationToken = default)
Reads up to maxCount READY entries, oldest first, optionally limited to some channels.
method RecordDeliveryAttemptAsync(WorkflowOutboxEntry, DateTime?, CancellationToken) #
RecordDeliveryAttemptAsync(WorkflowOutboxEntry, DateTime?, CancellationToken) #public Task RecordDeliveryAttemptAsync(WorkflowOutboxEntry entry, DateTime? publishedAtUtc, CancellationToken cancellationToken = default)
Counts one delivery attempt; a non-null publishedAtUtc marks the entry PUBLISHED.
method TryMarkPublishedAsync(WorkflowOutboxKind, string, DateTime, CancellationToken) #
TryMarkPublishedAsync(WorkflowOutboxKind, string, DateTime, CancellationToken) #public Task<bool> TryMarkPublishedAsync(WorkflowOutboxKind kind, string entryKey, DateTime publishedAtUtc, CancellationToken cancellationToken = default)
Marks a READY entry PUBLISHED; false when it is not READY (already published or missing).
class PostgresWorkflowProjectionRetentionStore
public sealed class PostgresWorkflowProjectionRetentionStore : IWorkflowProjectionRetentionStore
PostgreSQL IWorkflowProjectionRetentionStore. Marks stale instances and tasks, then purges each eligible instance with its tasks and every durable row it owns, all in one transaction. An instance under legal hold or the HOLD_ALL policy or with a READY outbox row is kept; an instance in a child link goes only with its whole child family and the family’s links (WorkflowChildFamilyRetention), as in MongoDB. A task also goes on its own purge_after_utc (set when it completes), with its events, while its instance stays, unless that instance is held.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowProjectionRetentionStore( | constructor | PostgreSQL IWorkflowProjectionRetentionStore. |
RunAsync( | method | Marks stale and purges the projections whose dates have passed. |
constructor PostgresWorkflowProjectionRetentionStore(PostgresWorkflowDatabase) #
PostgresWorkflowProjectionRetentionStore(PostgresWorkflowDatabase) #public PostgresWorkflowProjectionRetentionStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowProjectionRetentionStore. Marks stale instances and tasks, then purges each eligible instance with its tasks and every durable row it owns, all in one transaction. An instance under legal hold or the HOLD_ALL policy or with a READY outbox row is kept; an instance in a child link goes only with its whole child family and the family’s links (WorkflowChildFamilyRetention), as in MongoDB. A task also goes on its own purge_after_utc (set when it completes), with its events, while its instance stays, unless that instance is held.
method RunAsync(DateTime, WorkflowRetentionOverride, CancellationToken) #
RunAsync(DateTime, WorkflowRetentionOverride, CancellationToken) #public Task<WorkflowProjectionRetentionBatch> RunAsync(DateTime nowUtc, WorkflowRetentionOverride? retentionOverride = null, CancellationToken cancellationToken = default)
Marks stale and purges the projections whose dates have passed.
Parameters
nowUtc: The time the dates are compared with, in UTC.retentionOverride: Age thresholds that replace the stored dates; none when not set.cancellationToken: Cancels the operation.
Returns
What was marked and purged.
class PostgresWorkflowProjectionStore
public sealed class PostgresWorkflowProjectionStore : IWorkflowProjectionStore
The instance and task projections, in PostgreSQL.
Members
constructor PostgresWorkflowProjectionStore(PostgresWorkflowDatabase, IConfiguration) #
PostgresWorkflowProjectionStore(PostgresWorkflowDatabase, IConfiguration) #public PostgresWorkflowProjectionStore(PostgresWorkflowDatabase database, IConfiguration configuration)
The instance and task projections, in PostgreSQL.
method ApplyRuntimeProgressAsync(string, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken) #
ApplyRuntimeProgressAsync(string, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken) #public Task ApplyRuntimeProgressAsync(string workflowInstanceId, WorkflowTaskCompletionPlan progressPlan, WorkflowBusinessReference? businessReference, CancellationToken cancellationToken = default)
Applies the progress of an instance that moved without a task completion, such as after a signal.
Parameters
workflowInstanceId: The instance.progressPlan: The plan.businessReference: The business reference.cancellationToken: Cancels the operation.
Returns
A task that completes when the progress is applied.
method ApplyTaskCompletionAsync(string, string, IDictionary<string, object>, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken) #
ApplyTaskCompletionAsync(string, string, IDictionary<string, object>, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken) #public Task<WorkflowTaskSummary> ApplyTaskCompletionAsync(string workflowTaskId, string actorId, IDictionary<string, object?> payload, WorkflowTaskCompletionPlan completionPlan, WorkflowBusinessReference? businessReference, CancellationToken cancellationToken = default)
Completes a task and applies the completion plan: new tasks, state and instance status.
Parameters
workflowTaskId: The task.actorId: Who acts.payload: The completion payload.completionPlan: The plan.businessReference: The business reference after the completion.cancellationToken: Cancels the operation.
Returns
The completed task.
method AssignTaskAsync(string, string, string, CancellationToken) #
AssignTaskAsync(string, string, string, CancellationToken) #public Task<WorkflowTaskSummary> AssignTaskAsync(string workflowTaskId, string actorId, string assignee, CancellationToken cancellationToken = default)
Assigns a task to a user.
Parameters
workflowTaskId: The task.actorId: Who acts.assignee: The user.cancellationToken: Cancels the operation.
Returns
The task.
method AssignTaskRolesAsync(string, string, IReadOnlyCollection<string>, CancellationToken) #
AssignTaskRolesAsync(string, string, IReadOnlyCollection<string>, CancellationToken) #public Task<WorkflowTaskSummary> AssignTaskRolesAsync(string workflowTaskId, string actorId, IReadOnlyCollection<string> targetRoles, CancellationToken cancellationToken = default)
Assigns a task to roles.
Parameters
workflowTaskId: The task.actorId: Who acts.targetRoles: The roles.cancellationToken: Cancels the operation.
Returns
The task.
method CreateWorkflowAsync(WorkflowDefinitionDescriptor, WorkflowBusinessReference, WorkflowStartExecutionPlan, CancellationToken) #
CreateWorkflowAsync(WorkflowDefinitionDescriptor, WorkflowBusinessReference, WorkflowStartExecutionPlan, CancellationToken) #public Task<StartWorkflowResponse> CreateWorkflowAsync(WorkflowDefinitionDescriptor definition, WorkflowBusinessReference? businessReference, WorkflowStartExecutionPlan executionPlan, CancellationToken cancellationToken = default)
Creates the projection of a new instance with the tasks of its start plan.
Parameters
definition: The workflow definition.businessReference: The business reference.executionPlan: The start plan.cancellationToken: Cancels the operation.
Returns
The new instance.
method GetExecutionSnapshotAsync(string, CancellationToken) #
GetExecutionSnapshotAsync(string, CancellationToken) #public Task<WorkflowExecutionSnapshot?> GetExecutionSnapshotAsync(string workflowTaskId, CancellationToken cancellationToken = default)
Reads a task with the state of its instance.
Parameters
workflowTaskId: The task.cancellationToken: Cancels the operation.
Returns
The snapshot, or null.
method GetInstanceAsync(string, CancellationToken) #
GetInstanceAsync(string, CancellationToken) #public Task<WorkflowInstanceSummary?> GetInstanceAsync(string workflowInstanceId, CancellationToken cancellationToken = default)
Reads an instance.
Parameters
workflowInstanceId: The instance.cancellationToken: Cancels the operation.
Returns
The instance, or null.
method GetInstanceDetailsAsync(string, CancellationToken) #
GetInstanceDetailsAsync(string, CancellationToken) #public Task<WorkflowInstanceProjectionDetails?> GetInstanceDetailsAsync(string workflowInstanceId, CancellationToken cancellationToken = default)
Reads an instance with its state, tasks and task events.
Parameters
workflowInstanceId: The instance.cancellationToken: Cancels the operation.
Returns
The details, or null.
method GetInstancesAsync(WorkflowInstancesGetRequest, CancellationToken) #
GetInstancesAsync(WorkflowInstancesGetRequest, CancellationToken) #public Task<IReadOnlyCollection<WorkflowInstanceSummary>> GetInstancesAsync(WorkflowInstancesGetRequest request, CancellationToken cancellationToken = default)
Lists instances.
Parameters
request: The filter.cancellationToken: Cancels the operation.
Returns
The instances.
method GetTaskAsync(string, CancellationToken) #
GetTaskAsync(string, CancellationToken) #public Task<WorkflowTaskSummary?> GetTaskAsync(string workflowTaskId, CancellationToken cancellationToken = default)
Reads a task.
Parameters
workflowTaskId: The task.cancellationToken: Cancels the operation.
Returns
The task, or null.
method GetTasksAsync(WorkflowTasksGetRequest, CancellationToken) #
GetTasksAsync(WorkflowTasksGetRequest, CancellationToken) #public Task<IReadOnlyCollection<WorkflowTaskSummary>> GetTasksAsync(WorkflowTasksGetRequest request, CancellationToken cancellationToken = default)
Lists tasks.
Parameters
request: The filter.cancellationToken: Cancels the operation.
Returns
The tasks.
method ReleaseTaskAsync(string, string, CancellationToken) #
ReleaseTaskAsync(string, string, CancellationToken) #public Task<WorkflowTaskSummary> ReleaseTaskAsync(string workflowTaskId, string actorId, CancellationToken cancellationToken = default)
Releases an assigned task.
Parameters
workflowTaskId: The task.actorId: Who acts.cancellationToken: Cancels the operation.
Returns
The task.
class PostgresWorkflowRegisteredSignalStore
public sealed class PostgresWorkflowRegisteredSignalStore : IWorkflowRegisteredSignalStore
PostgreSQL IWorkflowRegisteredSignalStore: each PostgresWorkflowRegisteredSignalStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowRegisteredSignalStore( | constructor | PostgreSQL IWorkflowRegisteredSignalStore: each PostgresWorkflowRegisteredSignalStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind. |
FindWaitAsync( | method | Finds the wait of an execution for a signal code and audience, by registration id when one is given and by signal key otherwise. |
GetInboxAsync( | method | Reads a signal inbox entry. |
GetOldestUncorrelatedInboxAsync( | method | The oldest signal received for this execution, key, code and audience that no wait has taken yet. |
GetTimerAsync( | method | Reads a deadline timer. |
GetTimerForWaitAsync( | method | Reads the deadline timer of a wait. |
GetWaitAsync( | method | Reads a registered wait. |
WriteAsync( | method | Writes the changes atomically. |
constructor PostgresWorkflowRegisteredSignalStore(PostgresWorkflowDatabase) #
PostgresWorkflowRegisteredSignalStore(PostgresWorkflowDatabase) #public PostgresWorkflowRegisteredSignalStore(PostgresWorkflowDatabase database)
PostgreSQL IWorkflowRegisteredSignalStore: each PostgresWorkflowRegisteredSignalStore.runs in one savepoint of the ambient mutation transaction (or its own transaction), so a version conflict or a duplicate key leaves nothing behind.
method FindWaitAsync(string, string, string, string, string, CancellationToken) #
FindWaitAsync(string, string, string, string, string, CancellationToken) #public Task<WorkflowRegisteredSignalWait?> FindWaitAsync(string workflowExecutionId, string signalCode, string? serviceAudience, string? signalRegistrationId, string? signalKey, CancellationToken cancellationToken = default)
Finds the wait of an execution for a signal code and audience, by registration id when one is given and by signal key otherwise.
method GetInboxAsync(string, CancellationToken) #
GetInboxAsync(string, CancellationToken) #public Task<WorkflowRegisteredSignalInboxEntry?> GetInboxAsync(string signalEventId, CancellationToken cancellationToken = default)
Reads a signal inbox entry.
Parameters
signalEventId: The signal event.cancellationToken: Cancels the operation.
Returns
The entry, or null.
method GetOldestUncorrelatedInboxAsync(string, string, string, string, string, CancellationToken) #
GetOldestUncorrelatedInboxAsync(string, string, string, string, string, CancellationToken) #public Task<WorkflowRegisteredSignalInboxEntry?> GetOldestUncorrelatedInboxAsync(string workflowExecutionId, string signalKey, string signalCode, string serviceAudience, string uncorrelatedDisposition, CancellationToken cancellationToken = default)
The oldest signal received for this execution, key, code and audience that no wait has taken yet.
method GetTimerAsync(string, CancellationToken) #
GetTimerAsync(string, CancellationToken) #public Task<WorkflowSignalDeadlineTimer?> GetTimerAsync(string timerId, CancellationToken cancellationToken = default)
Reads a deadline timer.
Parameters
timerId: The timer.cancellationToken: Cancels the operation.
Returns
The timer, or null.
method GetTimerForWaitAsync(string, CancellationToken) #
GetTimerForWaitAsync(string, CancellationToken) #public Task<WorkflowSignalDeadlineTimer?> GetTimerForWaitAsync(string signalRegistrationId, CancellationToken cancellationToken = default)
Reads the deadline timer of a wait.
Parameters
signalRegistrationId: The wait.cancellationToken: Cancels the operation.
Returns
The timer, or null.
method GetWaitAsync(string, CancellationToken) #
GetWaitAsync(string, CancellationToken) #public Task<WorkflowRegisteredSignalWait?> GetWaitAsync(string signalRegistrationId, CancellationToken cancellationToken = default)
Reads a registered wait.
Parameters
signalRegistrationId: The wait.cancellationToken: Cancels the operation.
Returns
The wait, or null.
method WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken) #
WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken) #public Task WriteAsync(WorkflowRegisteredSignalWrite write, CancellationToken cancellationToken = default)
Writes the changes atomically. Throws WorkflowStoreConcurrencyExceptionwhen the changed wait’s version moved and WorkflowStoreDuplicateExceptionwhen a new row’s key exists.
class PostgresWorkflowRuntimeStateStore
public sealed class PostgresWorkflowRuntimeStateStore : IWorkflowRuntimeStateStore
The runtime states of instances, in PostgreSQL.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowRuntimeStateStore( | constructor | The runtime states of instances, in PostgreSQL. |
DeleteAsync( | method | Deletes the runtime states of instances. |
GetAsync( | method | Reads the runtime state of an instance. |
GetManyAsync( | method | Reads the runtime states of instances. |
MarkStaleAsync( | method | Marks instances stale. |
UpsertAsync( | method | Writes a runtime state whose version is one above the stored one (or the first). |
constructor PostgresWorkflowRuntimeStateStore(PostgresWorkflowDatabase) #
PostgresWorkflowRuntimeStateStore(PostgresWorkflowDatabase) #public PostgresWorkflowRuntimeStateStore(PostgresWorkflowDatabase database)
The runtime states of instances, in PostgreSQL.
method DeleteAsync(IReadOnlyCollection<string>, CancellationToken) #
DeleteAsync(IReadOnlyCollection<string>, CancellationToken) #public Task<int> DeleteAsync(IReadOnlyCollection<string> workflowInstanceIds, CancellationToken cancellationToken = default)
Deletes the runtime states of instances.
Parameters
workflowInstanceIds: The instances.cancellationToken: Cancels the operation.
Returns
The states deleted.
method GetAsync(string, CancellationToken) #
GetAsync(string, CancellationToken) #public Task<WorkflowRuntimeStateRecord?> GetAsync(string workflowInstanceId, CancellationToken cancellationToken = default)
Reads the runtime state of an instance.
Parameters
workflowInstanceId: The instance.cancellationToken: Cancels the operation.
Returns
The state, or null.
method GetManyAsync(IReadOnlyCollection<string>, CancellationToken) #
GetManyAsync(IReadOnlyCollection<string>, CancellationToken) #public Task<IReadOnlyCollection<WorkflowRuntimeStateRecord>> GetManyAsync(IReadOnlyCollection<string> workflowInstanceIds, CancellationToken cancellationToken = default)
Reads the runtime states of instances.
Parameters
workflowInstanceIds: The instances.cancellationToken: Cancels the operation.
Returns
The states found.
method MarkStaleAsync(IReadOnlyCollection<string>, DateTime, CancellationToken) #
MarkStaleAsync(IReadOnlyCollection<string>, DateTime, CancellationToken) #public Task<int> MarkStaleAsync(IReadOnlyCollection<string> workflowInstanceIds, DateTime updatedOnUtc, CancellationToken cancellationToken = default)
Marks instances stale.
Parameters
workflowInstanceIds: The instances.updatedOnUtc: The change time, in UTC.cancellationToken: Cancels the operation.
Returns
The instances marked.
method UpsertAsync(WorkflowRuntimeStateRecord, CancellationToken) #
UpsertAsync(WorkflowRuntimeStateRecord, CancellationToken) #public Task UpsertAsync(WorkflowRuntimeStateRecord state, CancellationToken cancellationToken = default)
Writes a runtime state whose version is one above the stored one (or the first).
Parameters
state: The state.cancellationToken: Cancels the operation.
Returns
A task that completes when the state is written.
Exceptions
WorkflowRuntimeStateConcurrencyException: Another write changed the instance first.
class PostgresWorkflowScheduleBus
public sealed class PostgresWorkflowScheduleBus : IWorkflowSignalScheduler
Schedules signals in the PostgreSQL signal store.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowScheduleBus( | constructor | Schedules signals in the PostgreSQL signal store. |
ScheduleAsync( | method | Stores a signal that becomes available at dueAtUtc. |
constructor PostgresWorkflowScheduleBus(PostgresWorkflowSignalStore) #
PostgresWorkflowScheduleBus(PostgresWorkflowSignalStore) #public PostgresWorkflowScheduleBus(PostgresWorkflowSignalStore signalStore)
Schedules signals in the PostgreSQL signal store.
method ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken) #
ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken) #public Task ScheduleAsync(WorkflowSignalEnvelope envelope, DateTime dueAtUtc, CancellationToken cancellationToken = default)
Stores a signal that becomes available at dueAtUtc.
Parameters
envelope: The signal.dueAtUtc: When the signal is due, in UTC.cancellationToken: Cancels the operation.
Returns
A task that completes when the signal is stored.
class PostgresWorkflowSignalBus
public sealed class PostgresWorkflowSignalBus : IWorkflowSignalDriver
The native PostgreSQL signal driver: the signal store delivers the wakes.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowSignalBus( | constructor | The native PostgreSQL signal driver: the signal store delivers the wakes. |
DispatchMode | property | When the engine tells the driver that a signal is available. |
DriverName | property | The driver name, as Workflow selects it. |
NotifySignalAvailableAsync( | method | Tells the consumers that a signal is available. |
ReceiveAsync( | method | Waits up to the driver’s blocking wait for a signal to claim. |
constructor PostgresWorkflowSignalBus(PostgresWorkflowSignalStore) #
PostgresWorkflowSignalBus(PostgresWorkflowSignalStore) #public PostgresWorkflowSignalBus(PostgresWorkflowSignalStore signalStore)
The native PostgreSQL signal driver: the signal store delivers the wakes.
property DispatchMode #
DispatchMode #public WorkflowSignalDriverDispatchMode DispatchMode { get; }
When the engine tells the driver that a signal is available.
property DriverName #
DriverName #public string DriverName { get; }
The driver name, as Workflow selects it.
method NotifySignalAvailableAsync(WorkflowSignalWakeNotification, CancellationToken) #
NotifySignalAvailableAsync(WorkflowSignalWakeNotification, CancellationToken) #public Task NotifySignalAvailableAsync(WorkflowSignalWakeNotification notification, CancellationToken cancellationToken = default)
Tells the consumers that a signal is available.
Parameters
notification: The available signal.cancellationToken: Cancels the operation.
Returns
A task that completes when the notification is sent.
method ReceiveAsync(string, CancellationToken) #
ReceiveAsync(string, CancellationToken) #public Task<IWorkflowSignalLease?> ReceiveAsync(string consumerName, CancellationToken cancellationToken = default)
Waits up to the driver’s blocking wait for a signal to claim.
Parameters
consumerName: The consumer.cancellationToken: Cancels the operation.
Returns
The lease of the claimed signal, or null when none arrives in time.
class PostgresWorkflowSignalDeadLetterStore
public sealed class PostgresWorkflowSignalDeadLetterStore : IWorkflowSignalDeadLetterStore
The dead-lettered signals, in PostgreSQL.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowSignalDeadLetterStore( | constructor | The dead-lettered signals, in PostgreSQL. |
GetMessagesAsync( | method | Lists the dead-lettered signals. |
ReplayAsync( | method | Puts a dead letter back on the signal queue. |
constructor PostgresWorkflowSignalDeadLetterStore(PostgresWorkflowSignalStore) #
PostgresWorkflowSignalDeadLetterStore(PostgresWorkflowSignalStore) #public PostgresWorkflowSignalDeadLetterStore(PostgresWorkflowSignalStore signalStore)
The dead-lettered signals, in PostgreSQL.
method GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken) #
GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken) #public Task<WorkflowSignalDeadLettersGetResponse> GetMessagesAsync(WorkflowSignalDeadLettersGetRequest request, CancellationToken cancellationToken = default)
Lists the dead-lettered signals.
Parameters
request: The request.cancellationToken: Cancels the operation.
Returns
A page of dead letters.
method ReplayAsync(WorkflowSignalDeadLetterReplayRequest, CancellationToken) #
ReplayAsync(WorkflowSignalDeadLetterReplayRequest, CancellationToken) #public Task<WorkflowSignalDeadLetterReplayResponse> ReplayAsync(WorkflowSignalDeadLetterReplayRequest request, CancellationToken cancellationToken = default)
Puts a dead letter back on the signal queue.
Parameters
request: The request.cancellationToken: Cancels the operation.
Returns
The outcome.
class PostgresWorkflowSignalStore
public sealed class PostgresWorkflowSignalStore : IWorkflowSignalStore, IWorkflowSignalClaimStore
The signal queue, in PostgreSQL.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowSignalStore( | constructor | The signal queue, in PostgreSQL. |
PublishAsync( | method | Stores a signal for delivery. |
PublishDeadLetterAsync( | method | Stores a signal that could not be processed as a dead letter. |
TryClaimAsync( | method | Claims one available signal for a consumer. |
constructor PostgresWorkflowSignalStore(PostgresWorkflowDatabase, PostgresWorkflowSqlBuilder) #
PostgresWorkflowSignalStore(PostgresWorkflowDatabase, PostgresWorkflowSqlBuilder) #public PostgresWorkflowSignalStore(PostgresWorkflowDatabase database, PostgresWorkflowSqlBuilder sqlBuilder)
The signal queue, in PostgreSQL.
method PublishAsync(WorkflowSignalEnvelope, CancellationToken) #
PublishAsync(WorkflowSignalEnvelope, CancellationToken) #public Task PublishAsync(WorkflowSignalEnvelope envelope, CancellationToken cancellationToken = default)
Stores a signal for delivery.
Parameters
envelope: The signal.cancellationToken: Cancels the operation.
Returns
A task that completes when the signal is stored.
method PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken) #
PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken) #public Task PublishDeadLetterAsync(WorkflowSignalEnvelope envelope, CancellationToken cancellationToken = default)
Stores a signal that could not be processed as a dead letter.
Parameters
envelope: The signal.cancellationToken: Cancels the operation.
Returns
A task that completes when the signal is stored.
method TryClaimAsync(string, CancellationToken) #
TryClaimAsync(string, CancellationToken) #public Task<IWorkflowSignalLease?> TryClaimAsync(string consumerName, CancellationToken cancellationToken = default)
Claims one available signal for a consumer.
Parameters
consumerName: The consumer.cancellationToken: Cancels the operation.
Returns
The lease of the claimed signal, or null when none is available.
class PostgresWorkflowSqlBuilder
public sealed class PostgresWorkflowSqlBuilder
Run-time statements of the Workflow store. It emits no DDL: the schema script in StellaOps.Workflow.Persistence is the only DDL authority, and every table is named as that script creates it.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowSqlBuilder( | constructor | Run-time statements of the Workflow store. |
BuildNotifySql( | method | The SQL that notifies the signal channel. |
BuildReadySignalClaimSql( | method | The SQL that claims one ready signal for a consumer. |
BuildWakeOutboxClaimSql( | method | The SQL that claims one wake outbox notification. |
BuildWakeOutboxNotifySql( | method | The SQL that notifies the wake outbox channel. |
constructor PostgresWorkflowSqlBuilder(IOptions<PostgresWorkflowBackendOptions>) #
PostgresWorkflowSqlBuilder(IOptions<PostgresWorkflowBackendOptions>) #public PostgresWorkflowSqlBuilder(IOptions<PostgresWorkflowBackendOptions> options)
Run-time statements of the Workflow store. It emits no DDL: the schema script in StellaOps.Workflow.Persistence is the only DDL authority, and every table is named as that script creates it.
method BuildNotifySql() #
BuildNotifySql() #public string BuildNotifySql()
The SQL that notifies the signal channel.
Returns
The SQL.
method BuildReadySignalClaimSql() #
BuildReadySignalClaimSql() #public string BuildReadySignalClaimSql()
The SQL that claims one ready signal for a consumer.
Returns
The SQL.
method BuildWakeOutboxClaimSql() #
BuildWakeOutboxClaimSql() #public string BuildWakeOutboxClaimSql()
The SQL that claims one wake outbox notification.
Returns
The SQL.
method BuildWakeOutboxNotifySql() #
BuildWakeOutboxNotifySql() #public string BuildWakeOutboxNotifySql()
The SQL that notifies the wake outbox channel.
Returns
The SQL.
class PostgresWorkflowWakeOutbox
public sealed class PostgresWorkflowWakeOutbox : IWorkflowWakeOutbox, IWorkflowWakeOutboxReceiver
The wake outbox, in PostgreSQL.
Members
| Member | Kind | Summary |
|---|---|---|
PostgresWorkflowWakeOutbox( | constructor | The wake outbox, in PostgreSQL. |
EnqueueAsync( | method | Writes a wake notification to the outbox. |
ReceiveAsync( | method | Claims one wake notification of the outbox for a consumer. |
constructor PostgresWorkflowWakeOutbox(PostgresWorkflowDatabase, PostgresWorkflowSqlBuilder) #
PostgresWorkflowWakeOutbox(PostgresWorkflowDatabase, PostgresWorkflowSqlBuilder) #public PostgresWorkflowWakeOutbox(PostgresWorkflowDatabase database, PostgresWorkflowSqlBuilder sqlBuilder)
The wake outbox, in PostgreSQL.
method EnqueueAsync(WorkflowSignalWakeNotification, CancellationToken) #
EnqueueAsync(WorkflowSignalWakeNotification, CancellationToken) #public Task EnqueueAsync(WorkflowSignalWakeNotification notification, CancellationToken cancellationToken = default)
Writes a wake notification to the outbox.
Parameters
notification: The notification.cancellationToken: Cancels the operation.
Returns
A task that completes when the notification is written.
method ReceiveAsync(string, CancellationToken) #
ReceiveAsync(string, CancellationToken) #public Task<IWorkflowWakeOutboxLease?> ReceiveAsync(string consumerName, CancellationToken cancellationToken = default)
Claims one wake notification of the outbox for a consumer.
Parameters
consumerName: The consumer.cancellationToken: Cancels the operation.
Returns
The lease of the notification, or null when there is none.
class WorkflowTables
public static class WorkflowTables
The fixed names of the Workflow PostgreSQL store. The schema script in Stella is the only DDL authority and creates exactly these tables in exactly this schema; nothing here is configurable. Every statement in this store names its table literally.
Members
| Member | Kind | Summary |
|---|---|---|
DeadLetters | constant | The dead-lettered signals. |
DefinitionAudit | constant | The definition activation audit. |
Definitions | constant | The stored definitions. |
FirstSeenWorkflows | constant | The first-seen ledger. |
HostLocks | constant | The hosted job locks. |
Instances | constant | The instance projections. |
RuntimeStates | constant | The runtime states. |
Schema | constant | The schema the schema script creates. |
SignalQueue | constant | The signal queue. |
TaskEvents | constant | The task events. |
Tasks | constant | The task projections. |
WakeOutbox | constant | The wake outbox. |
constant DeadLetters #
DeadLetters #public const string DeadLetters = "workflow.wf_signal_dead_letters"
The dead-lettered signals.
constant DefinitionAudit #
DefinitionAudit #public const string DefinitionAudit = "workflow.wf_definition_audit"
The definition activation audit.
constant Definitions #
Definitions #public const string Definitions = "workflow.wf_definitions"
The stored definitions.
constant FirstSeenWorkflows #
FirstSeenWorkflows #public const string FirstSeenWorkflows = "workflow.wf_first_seen_workflows"
The first-seen ledger.
constant HostLocks #
HostLocks #public const string HostLocks = "workflow.wf_host_locks"
The hosted job locks.
constant Instances #
Instances #public const string Instances = "workflow.wf_instances"
The instance projections.
constant RuntimeStates #
RuntimeStates #public const string RuntimeStates = "workflow.wf_runtime_states"
The runtime states.
constant Schema #
Schema #public const string Schema = "workflow"
The schema the schema script creates.
constant SignalQueue #
SignalQueue #public const string SignalQueue = "workflow.wf_signal_queue"
The signal queue.
constant TaskEvents #
TaskEvents #public const string TaskEvents = "workflow.wf_task_events"
The task events.
constant Tasks #
Tasks #public const string Tasks = "workflow.wf_tasks"
The task projections.
constant WakeOutbox #
WakeOutbox #public const string WakeOutbox = "workflow.wf_signal_wake_outbox"
The wake outbox.