StellaOps.Workflow.DataStore.MongoDB

MongoDB store for the workflow engine: runtime state, projections, signals, schedules and definitions.

library
Component
Workflow
Licence
BUSL-1.1 (Workflow licence)
Target framework
net10.0
Latest release
1.0.1-20261118T121708Z

Install

dotnet add package StellaOps.Workflow.DataStore.MongoDB --version 1.0.1-20261118T121708Z

Namespaces

NamespaceTypes
StellaOps.Workflow.DataStore.MongoDB26

namespace StellaOps.Workflow.DataStore.MongoDB

TypeKindDescription
MongoWorkflowChildLinkStoreclassMongoDB IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation session when there is one.
MongoWorkflowDataStoreExtensionsclassRegisters the MongoDB workflow store.
MongoWorkflowDataStoreRoutineclassDependency-injection routine of the MongoDB store.
MongoWorkflowDatabaseclassThe MongoDB connection and change scope of the workflow store.
MongoWorkflowDefinitionStoreclassMongoDB IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore, with the behaviour of the PostgreSQL store: one document per workflow name and version with its provenance; a stored version is immutable; a managed definition is activated only through governance, which is fenced on the active version and hash, needs authorisation to go back to an older version, advances VersionNo on every document it changes and writes one audit document per activation or rollback.
MongoWorkflowDurableMaintenanceStoreclassMongoDB IWorkflowDurableMaintenanceStore: read-only probes over the durable collections.
MongoWorkflowDurableStartStoreclassMongoDB IWorkflowDurableStartStore.
MongoWorkflowExecutionConsoleReadStoreclassMongoDB IWorkflowExecutionConsoleReadStore.
MongoWorkflowExternalActivityStoreclassMongoDB IWorkflowExternalActivityStore: each MongoWorkflowExternalActivityStore.WriteAsync(WorkflowExternalActivityWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
MongoWorkflowFirstSeenLedgerclassThe durable first-seen ledger in the workflow_first_seen_workflows collection (WorkflowStoreMongoOptions.FirstSeenWorkflowsCollectionName), unique on the invariant upper-case workflow name (created by the store initialization).
MongoWorkflowHistoryStoreclassMongoDB IWorkflowHistoryStore: events in their own collection, the history cursor (floor, next sequence, legal hold, retention policy) on the instance document.
MongoWorkflowHostedJobLockServiceclassThe hosted job lock, in MongoDB.
MongoWorkflowMapStoreclassMongoDB IWorkflowMapStore: each MongoWorkflowMapStore.WriteAsync(WorkflowMapWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
MongoWorkflowMutationCoordinatorclassBegins the change scopes of the MongoDB workflow store.
MongoWorkflowMutationSessionAccessorclassHolds the MongoDB session of the open change scope.
MongoWorkflowOutboxStoreclassMongoDB IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.
MongoWorkflowProjectionRetentionStoreclassMongoDB IWorkflowProjectionRetentionStore.
MongoWorkflowProjectionStoreclassThe instance and task projections, in MongoDB.
MongoWorkflowRegisteredSignalStoreclassMongoDB IWorkflowRegisteredSignalStore: each MongoWorkflowRegisteredSignalStore.WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
MongoWorkflowRuntimeStateStoreclassThe runtime states of instances, in MongoDB.
MongoWorkflowScheduleBusclassSchedules signals in the MongoDB signal store.
MongoWorkflowSignalBusclassThe native MongoDB signal driver: the signal store delivers the wakes.
MongoWorkflowSignalDeadLetterStoreclassThe dead-lettered signals, in MongoDB.
MongoWorkflowSignalStoreclassThe signal queue, in MongoDB.
MongoWorkflowWakeOutboxclassThe wake outbox, in MongoDB.
WorkflowStoreMongoOptionsclassSettings of the MongoDB workflow store (WorkflowBackend:Mongo): the connection string name, the database, the collection names and the signal timing.

class MongoWorkflowChildLinkStore

public sealed class MongoWorkflowChildLinkStore : IWorkflowChildLinkStore

MongoDB IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation session when there is one.

Members

MemberKindSummary
MongoWorkflowChildLinkStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation session when there is one.
GetAsync(string, CancellationToken)methodReads a child link.
InsertAsync(WorkflowChildLink, WorkflowOutboxMessage, CancellationToken)methodInserts the link and appends the message; throws WorkflowStoreDuplicateExceptionwhen the link exists.
UpdateAsync(WorkflowChildLink, long, WorkflowOutboxMessage, CancellationToken)methodReplaces the link when its stored version is expectedVersion and appends the message, if any; throws WorkflowStoreConcurrencyExceptionon a version mismatch.

constructor MongoWorkflowChildLinkStore(MongoWorkflowDatabase) #

public MongoWorkflowChildLinkStore(MongoWorkflowDatabase database)

MongoDB IWorkflowChildLinkStore: each write and its durable outbox message commit together, in the ambient mutation session when there is one.

method 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) #

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) #

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 MongoWorkflowDataStoreExtensions

public static class MongoWorkflowDataStoreExtensions

Registers the MongoDB workflow store.

Members

MemberKindSummary
AddWorkflowMongoDataStore(IServiceCollection, IConfiguration)extension methodRegisters the MongoDB workflow store when WorkflowBackend:Provider is Mongo; otherwise it only records the store module.

extension method AddWorkflowMongoDataStore(IServiceCollection, IConfiguration) #

public static IServiceCollection AddWorkflowMongoDataStore(this IServiceCollection services, IConfiguration configuration)

Registers the MongoDB workflow store when WorkflowBackend:Provider is Mongo; otherwise it only records the store module. The connection string is ConnectionStrings:WorkflowMongo, or the connection string that WorkflowBackend:Mongo:ConnectionStringName names; without one, resolving the client fails.

Parameters

  • services: The service collection to add the services to.
  • configuration: The host configuration.

Returns

The same service collection, for chaining.

class MongoWorkflowDataStoreRoutine

public sealed class MongoWorkflowDataStoreRoutine : IDependencyInjectionRoutine

Dependency-injection routine of the MongoDB store. A host that loads this assembly as a plugin discovers the routine; it registers exactly what MongoWorkflowDataStoreExtensions.AddWorkflowMongoDataStore(IServiceCollection, IConfiguration)registers.

Members

MemberKindSummary
MongoWorkflowDataStoreRoutine()constructorCreates an instance of MongoWorkflowDataStoreRoutine.
Register(IServiceCollection, IConfiguration)methodRegisters what AddWorkflowMongoDataStore registers.

constructor MongoWorkflowDataStoreRoutine() #

public MongoWorkflowDataStoreRoutine()

Creates an instance of MongoWorkflowDataStoreRoutine.

method Register(IServiceCollection, IConfiguration) #

public IServiceCollection Register(IServiceCollection services, IConfiguration configuration)

Registers what AddWorkflowMongoDataStore registers.

Parameters

  • services: The service collection.
  • configuration: The host configuration.

Returns

The same service collection.

class MongoWorkflowDatabase

public sealed class MongoWorkflowDatabase

The MongoDB connection and change scope of the workflow store.

Members

MemberKindSummary
MongoWorkflowDatabase(IMongoClient, IConfiguration, IOptions<WorkflowStoreMongoOptions>, MongoWorkflowMutationSessionAccessor, IWorkflowMutationScopeAccessor)constructorThe MongoDB connection and change scope of the workflow store.

constructor MongoWorkflowDatabase(IMongoClient, IConfiguration, IOptions<WorkflowStoreMongoOptions>, MongoWorkflowMutationSessionAccessor, IWorkflowMutationScopeAccessor) #

public MongoWorkflowDatabase(IMongoClient mongoClient, IConfiguration configuration, IOptions<WorkflowStoreMongoOptions> options, MongoWorkflowMutationSessionAccessor sessionAccessor, IWorkflowMutationScopeAccessor scopeAccessor)

The MongoDB connection and change scope of the workflow store.

class MongoWorkflowDefinitionStore

public sealed class MongoWorkflowDefinitionStore : IWorkflowDefinitionStore, IWorkflowDefinitionGovernanceStore

MongoDB IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore, with the behaviour of the PostgreSQL store: one document per workflow name and version with its provenance; a stored version is immutable; a managed definition is activated only through governance, which is fenced on the active version and hash, needs authorisation to go back to an older version, advances VersionNo on every document it changes and writes one audit document per activation or rollback.

Members

MemberKindSummary
MongoWorkflowDefinitionStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore, with the behaviour of the PostgreSQL store: one document per workflow name and version with its provenance; a stored version is immutable; a managed definition is activated only through governance, which is fenced on the active version and hash, needs authorisation to go back to an older version, advances VersionNo on every document it changes and writes one audit document per activation or rollback.
ActivateAsync(string, string, CancellationToken)methodSets a specific version as active for a workflow name.
ActivateGovernedAsync(WorkflowDefinitionActivationRecord, CancellationToken)methodActivates a version under the activation fence and the rollback rule, and records the activation for the audit.
FindByHashAsync(string, string, CancellationToken)methodFinds any definition record matching the given content hash, regardless of version.
GetActiveAsync(string, CancellationToken)methodGets the active definition for a workflow name.
GetAllActiveAsync(CancellationToken)methodGets all active definitions across all workflow names.
GetAsync(string, string, CancellationToken)methodGets a specific version of a workflow definition.
GetVersionsAsync(string, CancellationToken)methodGets all versions of a workflow definition, ordered by creation date descending.
UpsertAsync(WorkflowDefinitionRecord, CancellationToken)methodInserts or updates a definition record.

constructor MongoWorkflowDefinitionStore(MongoWorkflowDatabase) #

public MongoWorkflowDefinitionStore(MongoWorkflowDatabase database)

MongoDB IWorkflowDefinitionStoreand IWorkflowDefinitionGovernanceStore, with the behaviour of the PostgreSQL store: one document per workflow name and version with its provenance; a stored version is immutable; a managed definition is activated only through governance, which is fenced on the active version and hash, needs authorisation to go back to an older version, advances VersionNo on every document it changes and writes one audit document per activation or rollback.

method 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) #

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

  • InvalidOperationException: The fence or the rollback rule refuses the activation; the message is the WORKFLOW_DEFINITION_* code.

method 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) #

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) #

public Task<IReadOnlyCollection<WorkflowDefinitionRecord>> GetAllActiveAsync(CancellationToken cancellationToken = default)

Gets all active definitions across all workflow names.

method 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) #

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) #

public Task UpsertAsync(WorkflowDefinitionRecord record, CancellationToken cancellationToken = default)

Inserts or updates a definition record.

class MongoWorkflowDurableMaintenanceStore

public sealed class MongoWorkflowDurableMaintenanceStore : IWorkflowDurableMaintenanceStore

MongoDB IWorkflowDurableMaintenanceStore: read-only probes over the durable collections.

Members

MemberKindSummary
MongoWorkflowDurableMaintenanceStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowDurableMaintenanceStore: read-only probes over the durable collections.
HasOrphanedStepAttemptsAsync(CancellationToken)methodTrue when a step attempt exists whose step (same step, execution and scope ids) does not.

constructor MongoWorkflowDurableMaintenanceStore(MongoWorkflowDatabase) #

public MongoWorkflowDurableMaintenanceStore(MongoWorkflowDatabase database)

MongoDB IWorkflowDurableMaintenanceStore: read-only probes over the durable collections.

method 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 MongoWorkflowDurableStartStore

public sealed class MongoWorkflowDurableStartStore : IWorkflowDurableStartStore

MongoDB IWorkflowDurableStartStore. Each write and its durable outbox messages commit in one transaction, the ambient mutation session’s when there is one. A root start writes the instance and runtime-state documents with the elements MongoWorkflowProjectionStoreand MongoWorkflowRuntimeStateStoreuse: the instance key is the workflow execution id (the document _id), as for every MongoDB instance, so no surrogate id is drawn.

Members

MemberKindSummary
MongoWorkflowDurableStartStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowDurableStartStore.
GetFenceAsync(string, CancellationToken)methodReads the prestart terminal fence of a start request.
GetReceiptAsync(string, CancellationToken)methodReads the receipt of a start request.
GetTerminalInboxAsync(string, CancellationToken)methodReads a terminal inbox entry.
HasOpenExecutionAsync(string, string, string, CancellationToken)methodTrue when an execution of the definition is open for the business reference.
RecordPrestartTerminalAsync(WorkflowPrestartTerminalFence, WorkflowStartReceipt, WorkflowTerminalInboxEntry, WorkflowOutboxMessage, CancellationToken)methodRecords a prestart terminal command: the fence, the fenced receipt when none exists, the inbox entry and the acknowledgement.
RecordStartDecisionAsync(WorkflowStartReceipt, WorkflowRootExecutionStart, IReadOnlyList<WorkflowOutboxMessage>, CancellationToken)methodRecords a start decision: the receipt, the root execution rows when the start created one (the store allocates the instance id), and the messages.
TryCompleteReceiptAsync(WorkflowStartReceipt, WorkflowOutboxMessage, CancellationToken)methodWrites the result into a receipt that has none yet, with its message.

constructor MongoWorkflowDurableStartStore(MongoWorkflowDatabase) #

public MongoWorkflowDurableStartStore(MongoWorkflowDatabase database)

MongoDB IWorkflowDurableStartStore. Each write and its durable outbox messages commit in one transaction, the ambient mutation session’s when there is one. A root start writes the instance and runtime-state documents with the elements MongoWorkflowProjectionStoreand MongoWorkflowRuntimeStateStoreuse: the instance key is the workflow execution id (the document _id), as for every MongoDB instance, so no surrogate id is drawn.

method 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) #

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) #

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) #

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) #

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) #

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) #

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 MongoWorkflowExecutionConsoleReadStore

public sealed class MongoWorkflowExecutionConsoleReadStore : IWorkflowExecutionConsoleReadStore

MongoDB IWorkflowExecutionConsoleReadStore. Identifiers compare and sort in binary order, the order of the PostgreSQL store, so the list cursor pages the same documents on both stores.

Members

MemberKindSummary
MongoWorkflowExecutionConsoleReadStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowExecutionConsoleReadStore.
GetAttemptsAsync(string, int, CancellationToken)methodUp to maxCount step attempts of the execution, by creation time.
GetDeliveriesAsync(string, CancellationToken)methodAll activity dispatches of the execution, then all its completions, unsorted.
GetExecutionAsync(string, CancellationToken)methodReads one execution.
GetMapItemsAsync(string, int, CancellationToken)methodUp to maxCount items of the execution’s maps, by map execution id, then ordinal.
GetMapsAsync(string, int, CancellationToken)methodUp to maxCount map executions of the execution, in the backend’s natural order.
GetScopesAsync(string, int, bool, CancellationToken)methodUp to maxCount scopes of the execution; ordered by creation time when orderByCreation is set, otherwise in the backend’s natural order.
GetStepsAsync(string, int, CancellationToken)methodUp to maxCount steps of the execution, by creation time.
ListExecutionsAsync(DateTime?, string, int, CancellationToken)methodUp to take executions, newest first (created time, then execution id, both descending), strictly after the cursor position when createdBeforeUtc is set.

constructor MongoWorkflowExecutionConsoleReadStore(MongoWorkflowDatabase) #

public MongoWorkflowExecutionConsoleReadStore(MongoWorkflowDatabase database)

MongoDB IWorkflowExecutionConsoleReadStore. Identifiers compare and sort in binary order, the order of the PostgreSQL store, so the list cursor pages the same documents on both stores.

method 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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 MongoWorkflowExternalActivityStore

public sealed class MongoWorkflowExternalActivityStore : IWorkflowExternalActivityStore

MongoDB IWorkflowExternalActivityStore: each MongoWorkflowExternalActivityStore.WriteAsync(WorkflowExternalActivityWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one. The runtime-state and instance documents are patched in place (only the version, snapshot, status and history cursor), so they stay the runtime-state and projection stores’ own documents.

Members

MemberKindSummary
MongoWorkflowExternalActivityStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowExternalActivityStore: each MongoWorkflowExternalActivityStore.WriteAsync(WorkflowExternalActivityWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
GetAttemptAsync(string, CancellationToken)methodReads an attempt.
GetAttemptByNumberAsync(string, int, CancellationToken)methodReads an attempt of a step by number.
GetCompletionAsync(string, CancellationToken)methodReads a completion.
GetDispatchForAttemptAsync(string, CancellationToken)methodReads the dispatch of an attempt.
GetLastAttemptNumberAsync(string, CancellationToken)methodThe highest attempt number recorded for the step; 0 when it has none.
GetLastReprocessOccurrenceAsync(string, CancellationToken)methodThe highest reprocess occurrence of the scope; 0 when it has none.
GetLineageAsync(string, CancellationToken)methodReads a lineage.
GetLineagesAsync(string, string, string, CancellationToken)methodThe step’s lineages in status, highest generation first, optionally limited to one source attempt.
GetMapItemsAsync(string, string, CancellationToken)methodReads the items of a map in a status.
GetMapsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken)methodThe map executions a stop targets, in any status.
GetReadyCancelsAsync(int, CancellationToken)methodReads up to maxCount READY cancels, oldest first.
GetReadyDispatchesAsync(int, CancellationToken)methodReads up to maxCount READY dispatches, oldest first.
GetRootScopeExecutionIdAsync(string, CancellationToken)methodReads the root scope of an execution.
GetRuntimeAsync(string, CancellationToken)methodReads the runtime state of an execution.
GetStepAsync(string, CancellationToken)methodReads a step.
GetStepsForStopAsync(WorkflowActivityStopTargetKind, string, CancellationToken)methodThe steps a stop targets, ordered by step execution id; for a map, the items’ active steps.
MarkCancelPublishedAsync(string, DateTime, CancellationToken)methodMarks a cancel PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist.
MarkDispatchPublishedAsync(string, DateTime, CancellationToken)methodMarks a dispatch PUBLISHED and counts the delivery attempt; does nothing when it is already PUBLISHED and throws when it does not exist.
WriteAsync(WorkflowExternalActivityWrite, CancellationToken)methodWrites the changes atomically.

constructor MongoWorkflowExternalActivityStore(MongoWorkflowDatabase) #

public MongoWorkflowExternalActivityStore(MongoWorkflowDatabase database)

MongoDB IWorkflowExternalActivityStore: each MongoWorkflowExternalActivityStore.WriteAsync(WorkflowExternalActivityWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one. The runtime-state and instance documents are patched in place (only the version, snapshot, status and history cursor), so they stay the runtime-state and projection stores’ own documents.

method 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

public Task<IReadOnlyList<WorkflowActivityCancelEntry>> GetReadyCancelsAsync(int maxCount, CancellationToken cancellationToken = default)

Reads up to maxCount READY cancels, oldest first.

method 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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 MongoWorkflowFirstSeenLedger

public sealed class MongoWorkflowFirstSeenLedger : IWorkflowFirstSeenLedger

The durable first-seen ledger in the workflow_first_seen_workflows collection (WorkflowStoreMongoOptions.FirstSeenWorkflowsCollectionName), unique on the invariant upper-case workflow name (created by the store initialization). It only inserts: a workflow already recorded keeps its first document, and the ledger has no update or delete path. Its document count is the cumulative Designated Workflow technical count, which survives restarts and the removal of a workflow from the code catalogue. The unique index lets one of several concurrent first sightings in, across the engine instances that share the database; the others find the name recorded. Recording never refuses a workflow.

Remarks

Recording writes outside any mutation session: a duplicate key inside a MongoDB transaction would abort the whole transaction, and a sighting is recorded on its own.

Members

MemberKindSummary
MongoWorkflowFirstSeenLedger(MongoWorkflowDatabase)constructorThe durable first-seen ledger in the workflow_first_seen_workflows collection (WorkflowStoreMongoOptions.FirstSeenWorkflowsCollectionName), unique on the invariant upper-case workflow name (created by the store initialization).
IsDurablepropertytrue 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(CancellationToken)methodThe number of distinct workflows ever recorded.
ListAsync(CancellationToken)methodEvery workflow ever recorded, one entry per workflow with its first sighting, ordered by WorkflowFirstSeenIdentity.Key(string)(ordinal).
RecordAsync(IReadOnlyCollection<string>, string, DateTimeOffset, CancellationToken)methodRecords the workflows in workflowNames that the ledger has not seen, with source (WorkflowFirstSeenSources) and seenOnUtc.
RecordStoredDefinitionsAsync(CancellationToken)methodRecords 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 MongoWorkflowFirstSeenLedger(MongoWorkflowDatabase) #

public MongoWorkflowFirstSeenLedger(MongoWorkflowDatabase database)

The durable first-seen ledger in the workflow_first_seen_workflows collection (WorkflowStoreMongoOptions.FirstSeenWorkflowsCollectionName), unique on the invariant upper-case workflow name (created by the store initialization). It only inserts: a workflow already recorded keeps its first document, and the ledger has no update or delete path. Its document count is the cumulative Designated Workflow technical count, which survives restarts and the removal of a workflow from the code catalogue. The unique index lets one of several concurrent first sightings in, across the engine instances that share the database; the others find the name recorded. Recording never refuses a workflow.

Remarks

Recording writes outside any mutation session: a duplicate key inside a MongoDB transaction would abort the whole transaction, and a sighting is recorded on its own.

property 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) #

public Task<int> CountAsync(CancellationToken cancellationToken = default)

The number of distinct workflows ever recorded.

method 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.Key(string)(ordinal). The number of entries is the count IWorkflowFirstSeenLedger.CountAsync(CancellationToken)returns for the same ledger state. Reads only; records nothing.

method 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) #

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 MongoWorkflowHistoryStore

public sealed class MongoWorkflowHistoryStore : IWorkflowHistoryStore

MongoDB IWorkflowHistoryStore: events in their own collection, the history cursor (floor, next sequence, legal hold, retention policy) on the instance document.

Members

MemberKindSummary
MongoWorkflowHistoryStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowHistoryStore: events in their own collection, the history cursor (floor, next sequence, legal hold, retention policy) on the instance document.
CompactPrefixAsync(string, long, int, CancellationToken)methodDeletes, 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(string, CancellationToken)methodReads the history cursor; throws when the execution does not exist.
GetEventsAsync(string, long, int, CancellationToken)methodReads up to maxCount events after afterSequence, in sequence order.

constructor MongoWorkflowHistoryStore(MongoWorkflowDatabase) #

public MongoWorkflowHistoryStore(MongoWorkflowDatabase database)

MongoDB IWorkflowHistoryStore: events in their own collection, the history cursor (floor, next sequence, legal hold, retention policy) on the instance document.

method 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) #

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) #

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 MongoWorkflowHostedJobLockService

public sealed class MongoWorkflowHostedJobLockService : IWorkflowHostedJobLockService

The hosted job lock, in MongoDB.

Members

MemberKindSummary
MongoWorkflowHostedJobLockService(MongoWorkflowDatabase)constructorThe hosted job lock, in MongoDB.
ReleaseAsync(string, string, CancellationToken)methodReleases a lock the owner holds.
TryAcquireAsync(string, string, DateTime, TimeSpan, CancellationToken)methodTakes a lock for an owner unless another owner holds an unexpired lease.

constructor MongoWorkflowHostedJobLockService(MongoWorkflowDatabase) #

public MongoWorkflowHostedJobLockService(MongoWorkflowDatabase database)

The hosted job lock, in MongoDB.

method 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) #

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 MongoWorkflowMapStore

public sealed class MongoWorkflowMapStore : IWorkflowMapStore

MongoDB IWorkflowMapStore: each MongoWorkflowMapStore.WriteAsync(WorkflowMapWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one. Every changed map and item is replaced only at its expected version, so of two claims on the same map the second loses as a whole: its map replace matches nothing or meets the first claim’s write conflict, and after that claim commits it reports a version conflict.

Members

MemberKindSummary
MongoWorkflowMapStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowMapStore: each MongoWorkflowMapStore.WriteAsync(WorkflowMapWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
CountActiveClaimsAsync(string, DateTime, CancellationToken)methodCounts the map’s CLAIMED items that hold capacity at nowUtc: an active step, or an unexpired lease.
CountGlobalActiveClaimsAsync(string, DateTime, CancellationToken)methodCounts the active claims (as above) across every map of the global activity class.
GetClaimableItemsAsync(string, DateTime, int, CancellationToken)methodUp 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(string, CancellationToken)methodThe lowest declared max concurrency among the maps of the global activity class.
GetItemAsync(string, CancellationToken)methodReads a map item.
GetItemsAsync(string, CancellationToken)methodAll items of the map, ordered by ordinal.
GetItemsByActiveStepAsync(string, int, CancellationToken)methodUp to maxCount items whose active step is activeStepExecutionId.
GetMapAsync(string, CancellationToken)methodReads a map execution.
WriteAsync(WorkflowMapWrite, CancellationToken)methodWrites the changes atomically.

constructor MongoWorkflowMapStore(MongoWorkflowDatabase) #

public MongoWorkflowMapStore(MongoWorkflowDatabase database)

MongoDB IWorkflowMapStore: each MongoWorkflowMapStore.WriteAsync(WorkflowMapWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one. Every changed map and item is replaced only at its expected version, so of two claims on the same map the second loses as a whole: its map replace matches nothing or meets the first claim’s write conflict, and after that claim commits it reports a version conflict.

method 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) #

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) #

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) #

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) #

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) #

public Task<IReadOnlyList<WorkflowMapItemRecord>> GetItemsAsync(string mapExecutionId, CancellationToken cancellationToken = default)

All items of the map, ordered by ordinal.

method GetItemsByActiveStepAsync(string, int, CancellationToken) #

public Task<IReadOnlyList<WorkflowMapItemRecord>> GetItemsByActiveStepAsync(string activeStepExecutionId, int maxCount, CancellationToken cancellationToken = default)

Up to maxCount items whose active step is activeStepExecutionId.

method 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) #

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 MongoWorkflowMutationCoordinator

public sealed class MongoWorkflowMutationCoordinator : IWorkflowMutationCoordinator

Begins the change scopes of the MongoDB workflow store.

Members

MemberKindSummary
MongoWorkflowMutationCoordinator(MongoWorkflowDatabase)constructorBegins the change scopes of the MongoDB workflow store.
BeginAsync(CancellationToken)methodBegins a change scope.

constructor MongoWorkflowMutationCoordinator(MongoWorkflowDatabase) #

public MongoWorkflowMutationCoordinator(MongoWorkflowDatabase database)

Begins the change scopes of the MongoDB workflow store.

method BeginAsync(CancellationToken) #

public Task<IWorkflowMutationScope> BeginAsync(CancellationToken cancellationToken = default)

Begins a change scope.

Parameters

  • cancellationToken: Cancels the operation.

Returns

The scope.

class MongoWorkflowMutationSessionAccessor

public sealed class MongoWorkflowMutationSessionAccessor

Holds the MongoDB session of the open change scope.

Members

MemberKindSummary
MongoWorkflowMutationSessionAccessor()constructorCreates an instance of MongoWorkflowMutationSessionAccessor.

constructor MongoWorkflowMutationSessionAccessor() #

public MongoWorkflowMutationSessionAccessor()

Creates an instance of MongoWorkflowMutationSessionAccessor.

class MongoWorkflowOutboxStore

public sealed class MongoWorkflowOutboxStore : IWorkflowOutboxStore

MongoDB IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.

Members

MemberKindSummary
MongoWorkflowOutboxStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.
CompactDeliveredAsync(DateTime, int, CancellationToken)methodDeletes up to batchSize rows per outbox published before cutoffUtc, and as many activity-completion inbox rows applied before it.
GetReadyAsync(WorkflowOutboxKind, IReadOnlyCollection<string>, int, CancellationToken)methodReads up to maxCount READY entries, oldest first, optionally limited to some channels.
RecordDeliveryAttemptAsync(WorkflowOutboxEntry, DateTime?, CancellationToken)methodCounts one delivery attempt; a non-null publishedAtUtc marks the entry PUBLISHED.
TryMarkPublishedAsync(WorkflowOutboxKind, string, DateTime, CancellationToken)methodMarks a READY entry PUBLISHED; false when it is not READY (already published or missing).

constructor MongoWorkflowOutboxStore(MongoWorkflowDatabase) #

public MongoWorkflowOutboxStore(MongoWorkflowDatabase database)

MongoDB IWorkflowOutboxStoreover the durable, activity-dispatch and activity-cancel outboxes and the activity-completion inbox.

method 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) #

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) #

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) #

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 MongoWorkflowProjectionRetentionStore

public sealed class MongoWorkflowProjectionRetentionStore : IWorkflowProjectionRetentionStore

MongoDB IWorkflowProjectionRetentionStore. Marks stale instances and tasks, then purges each eligible instance with its tasks and every durable document it owns, all in one transaction. An instance under legal hold or the HOLD_ALL policy or with a READY outbox document is kept; an instance in a child link goes only with its whole child family and the family’s links (WorkflowChildFamilyRetention), as in PostgreSQL.

Members

MemberKindSummary
MongoWorkflowProjectionRetentionStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowProjectionRetentionStore.
RunAsync(DateTime, WorkflowRetentionOverride, CancellationToken)methodMarks stale and purges the projections whose dates have passed.

constructor MongoWorkflowProjectionRetentionStore(MongoWorkflowDatabase) #

public MongoWorkflowProjectionRetentionStore(MongoWorkflowDatabase database)

MongoDB IWorkflowProjectionRetentionStore. Marks stale instances and tasks, then purges each eligible instance with its tasks and every durable document it owns, all in one transaction. An instance under legal hold or the HOLD_ALL policy or with a READY outbox document is kept; an instance in a child link goes only with its whole child family and the family’s links (WorkflowChildFamilyRetention), as in PostgreSQL.

method 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 MongoWorkflowProjectionStore

public sealed class MongoWorkflowProjectionStore : IWorkflowProjectionStore

The instance and task projections, in MongoDB.

Members

MemberKindSummary
MongoWorkflowProjectionStore(MongoWorkflowDatabase, IConfiguration)constructorThe instance and task projections, in MongoDB.
ApplyRuntimeProgressAsync(string, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken)methodApplies the progress of an instance that moved without a task completion, such as after a signal.
ApplyTaskCompletionAsync(string, string, IDictionary<string, object>, WorkflowTaskCompletionPlan, WorkflowBusinessReference, CancellationToken)methodCompletes a task and applies the completion plan: new tasks, state and instance status.
AssignTaskAsync(string, string, string, CancellationToken)methodAssigns a task to a user.
AssignTaskRolesAsync(string, string, IReadOnlyCollection<string>, CancellationToken)methodAssigns a task to roles.
CreateWorkflowAsync(WorkflowDefinitionDescriptor, WorkflowBusinessReference, WorkflowStartExecutionPlan, CancellationToken)methodCreates the projection of a new instance with the tasks of its start plan.
GetExecutionSnapshotAsync(string, CancellationToken)methodReads a task with the state of its instance.
GetInstanceAsync(string, CancellationToken)methodReads an instance.
GetInstanceDetailsAsync(string, CancellationToken)methodReads an instance with its state, tasks and task events.
GetInstancesAsync(WorkflowInstancesGetRequest, CancellationToken)methodLists instances.
GetTaskAsync(string, CancellationToken)methodReads a task.
GetTasksAsync(WorkflowTasksGetRequest, CancellationToken)methodLists tasks.
ReleaseTaskAsync(string, string, CancellationToken)methodReleases an assigned task.

constructor MongoWorkflowProjectionStore(MongoWorkflowDatabase, IConfiguration) #

public MongoWorkflowProjectionStore(MongoWorkflowDatabase database, IConfiguration configuration)

The instance and task projections, in MongoDB.

method 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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 MongoWorkflowRegisteredSignalStore

public sealed class MongoWorkflowRegisteredSignalStore : IWorkflowRegisteredSignalStore

MongoDB IWorkflowRegisteredSignalStore: each MongoWorkflowRegisteredSignalStore.WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.

Members

MemberKindSummary
MongoWorkflowRegisteredSignalStore(MongoWorkflowDatabase)constructorMongoDB IWorkflowRegisteredSignalStore: each MongoWorkflowRegisteredSignalStore.WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.
FindWaitAsync(string, string, string, string, string, CancellationToken)methodFinds the wait of an execution for a signal code and audience, by registration id when one is given and by signal key otherwise.
GetInboxAsync(string, CancellationToken)methodReads a signal inbox entry.
GetOldestUncorrelatedInboxAsync(string, string, string, string, string, CancellationToken)methodThe oldest signal received for this execution, key, code and audience that no wait has taken yet.
GetTimerAsync(string, CancellationToken)methodReads a deadline timer.
GetTimerForWaitAsync(string, CancellationToken)methodReads the deadline timer of a wait.
GetWaitAsync(string, CancellationToken)methodReads a registered wait.
WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken)methodWrites the changes atomically.

constructor MongoWorkflowRegisteredSignalStore(MongoWorkflowDatabase) #

public MongoWorkflowRegisteredSignalStore(MongoWorkflowDatabase database)

MongoDB IWorkflowRegisteredSignalStore: each MongoWorkflowRegisteredSignalStore.WriteAsync(WorkflowRegisteredSignalWrite, CancellationToken)commits in one transaction, the ambient mutation session’s when there is one.

method 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) #

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) #

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) #

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) #

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) #

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) #

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 MongoWorkflowRuntimeStateStore

public sealed class MongoWorkflowRuntimeStateStore : IWorkflowRuntimeStateStore

The runtime states of instances, in MongoDB.

Members

MemberKindSummary
MongoWorkflowRuntimeStateStore(MongoWorkflowDatabase)constructorThe runtime states of instances, in MongoDB.
DeleteAsync(IReadOnlyCollection<string>, CancellationToken)methodDeletes the runtime states of instances.
GetAsync(string, CancellationToken)methodReads the runtime state of an instance.
GetManyAsync(IReadOnlyCollection<string>, CancellationToken)methodReads the runtime states of instances.
MarkStaleAsync(IReadOnlyCollection<string>, DateTime, CancellationToken)methodMarks instances stale.
UpsertAsync(WorkflowRuntimeStateRecord, CancellationToken)methodWrites a runtime state whose version is one above the stored one (or the first).

constructor MongoWorkflowRuntimeStateStore(MongoWorkflowDatabase) #

public MongoWorkflowRuntimeStateStore(MongoWorkflowDatabase database)

The runtime states of instances, in MongoDB.

method 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) #

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) #

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) #

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) #

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

class MongoWorkflowScheduleBus

public sealed class MongoWorkflowScheduleBus : IWorkflowSignalScheduler

Schedules signals in the MongoDB signal store.

Members

MemberKindSummary
MongoWorkflowScheduleBus(MongoWorkflowSignalStore)constructorSchedules signals in the MongoDB signal store.
ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken)methodStores a signal that becomes available at dueAtUtc.

constructor MongoWorkflowScheduleBus(MongoWorkflowSignalStore) #

public MongoWorkflowScheduleBus(MongoWorkflowSignalStore signalStore)

Schedules signals in the MongoDB signal store.

method 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 MongoWorkflowSignalBus

public sealed class MongoWorkflowSignalBus : IWorkflowSignalDriver

The native MongoDB signal driver: the signal store delivers the wakes.

Members

MemberKindSummary
MongoWorkflowSignalBus(MongoWorkflowSignalStore)constructorThe native MongoDB signal driver: the signal store delivers the wakes.
DispatchModepropertyWhen the engine tells the driver that a signal is available.
DriverNamepropertyThe driver name, as WorkflowSignalDriver:Provider selects it.
NotifySignalAvailableAsync(WorkflowSignalWakeNotification, CancellationToken)methodTells the consumers that a signal is available.
ReceiveAsync(string, CancellationToken)methodWaits up to the driver’s blocking wait for a signal to claim.

constructor MongoWorkflowSignalBus(MongoWorkflowSignalStore) #

public MongoWorkflowSignalBus(MongoWorkflowSignalStore signalStore)

The native MongoDB signal driver: the signal store delivers the wakes.

property DispatchMode #

public WorkflowSignalDriverDispatchMode DispatchMode { get; }

When the engine tells the driver that a signal is available.

property DriverName #

public string DriverName { get; }

The driver name, as WorkflowSignalDriver:Provider selects it.

method 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) #

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 MongoWorkflowSignalDeadLetterStore

public sealed class MongoWorkflowSignalDeadLetterStore : IWorkflowSignalDeadLetterStore

The dead-lettered signals, in MongoDB.

Members

MemberKindSummary
MongoWorkflowSignalDeadLetterStore(MongoWorkflowSignalStore)constructorThe dead-lettered signals, in MongoDB.
GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken)methodLists the dead-lettered signals.
ReplayAsync(WorkflowSignalDeadLetterReplayRequest, CancellationToken)methodPuts a dead letter back on the signal queue.

constructor MongoWorkflowSignalDeadLetterStore(MongoWorkflowSignalStore) #

public MongoWorkflowSignalDeadLetterStore(MongoWorkflowSignalStore signalStore)

The dead-lettered signals, in MongoDB.

method 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) #

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 MongoWorkflowSignalStore

public sealed class MongoWorkflowSignalStore : IWorkflowSignalStore, IWorkflowSignalClaimStore

The signal queue, in MongoDB.

Members

MemberKindSummary
MongoWorkflowSignalStore(MongoWorkflowDatabase)constructorThe signal queue, in MongoDB.
PublishAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal for delivery.
PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal that could not be processed as a dead letter.
TryClaimAsync(string, CancellationToken)methodClaims one available signal for a consumer.

constructor MongoWorkflowSignalStore(MongoWorkflowDatabase) #

public MongoWorkflowSignalStore(MongoWorkflowDatabase database)

The signal queue, in MongoDB.

method 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) #

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) #

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 MongoWorkflowWakeOutbox

public sealed class MongoWorkflowWakeOutbox : IWorkflowWakeOutbox, IWorkflowWakeOutboxReceiver

The wake outbox, in MongoDB.

Members

MemberKindSummary
MongoWorkflowWakeOutbox(MongoWorkflowDatabase)constructorThe wake outbox, in MongoDB.
EnqueueAsync(WorkflowSignalWakeNotification, CancellationToken)methodWrites a wake notification to the outbox.
ReceiveAsync(string, CancellationToken)methodClaims one wake notification of the outbox for a consumer.

constructor MongoWorkflowWakeOutbox(MongoWorkflowDatabase) #

public MongoWorkflowWakeOutbox(MongoWorkflowDatabase database)

The wake outbox, in MongoDB.

method 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) #

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 WorkflowStoreMongoOptions

public sealed class WorkflowStoreMongoOptions

Settings of the MongoDB workflow store (WorkflowBackend:Mongo): the connection string name, the database, the collection names and the signal timing.

Members

MemberKindSummary
WorkflowStoreMongoOptions()constructorCreates an instance of WorkflowStoreMongoOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowBackend:Mongo.
ActivityCancelOutboxCollectionNamepropertyThe name of the activity cancel outbox collection.
ActivityCompletionInboxCollectionNamepropertyThe name of the activity completion inbox collection.
ActivityDispatchOutboxCollectionNamepropertyThe name of the activity dispatch outbox collection.
BlockingWaitSecondspropertyHow long a receive waits for a signal before it returns empty, in seconds; a value below 1 counts as 1.
ChildExecutionLinksCollectionNamepropertyThe name of the child execution links collection.
ClaimTimeoutSecondspropertyHow long a claimed signal or wake notice stays leased to its consumer, in seconds; a value below 1 counts as 1.
ConnectionStringNamepropertyThe name of the store’s connection string (ConnectionStrings:<name>).
ContinuationLineagesCollectionNamepropertyThe name of the continuation lineages collection.
DatabaseNamepropertyPhysical MongoDB database that holds the workflow store collections.
DeadLetterCollectionNamepropertyThe name of the dead letter collection.
DefinitionAuditCollectionNamepropertyThe name of the definition audit collection.
DefinitionsCollectionNamepropertyThe name of the definitions collection.
DurableOutboxCollectionNamepropertyThe name of the durable outbox collection.
ExecutionAssociationsCollectionNamepropertyThe name of the execution associations collection.
ExecutionEventsCollectionNamepropertyThe name of the execution events collection.
FirstSeenWorkflowsCollectionNamepropertyThe name of the first seen workflows collection.
HostedJobLocksCollectionNamepropertyThe name of the hosted job locks collection.
InstancesCollectionNamepropertyThe name of the instances collection.
MapExecutionsCollectionNamepropertyThe name of the map executions collection.
MapItemsCollectionNamepropertyThe name of the map items collection.
PrestartTerminalFencesCollectionNamepropertyThe name of the prestart terminal fences collection.
RegisteredSignalInboxCollectionNamepropertyThe name of the registered signal inbox collection.
RegisteredSignalWaitsCollectionNamepropertyThe name of the registered signal waits collection.
RootScopesCollectionNamepropertyThe name of the root scopes collection.
RuntimeStatesCollectionNamepropertyThe name of the runtime states collection.
SchemaCollectionNamepropertyHolds the store schema version; written last by the initialization that creates collections and indexes.
ScopeExecutionsCollectionNamepropertyThe name of the scope executions collection.
ScopeReprocessesCollectionNamepropertyThe name of the scope reprocesses collection.
SignalDeadlineTimersCollectionNamepropertyThe name of the signal deadline timers collection.
SignalQueueCollectionNamepropertyThe name of the signal queue collection.
StartReceiptsCollectionNamepropertyThe name of the start receipts collection.
StepAttemptsCollectionNamepropertyThe name of the step attempts collection.
StepExecutionsCollectionNamepropertyThe name of the step executions collection.
TaskEventsCollectionNamepropertyThe name of the task events collection.
TasksCollectionNamepropertyThe name of the tasks collection.
TerminalInboxCollectionNamepropertyThe name of the terminal inbox collection.
WakeOutboxCollectionNamepropertyThe name of the wake outbox collection.

constructor WorkflowStoreMongoOptions() #

public WorkflowStoreMongoOptions()

Creates an instance of WorkflowStoreMongoOptions.

constant SectionName #

public const string SectionName = "WorkflowBackend:Mongo"

The configuration section the options bind from: WorkflowBackend:Mongo.

property ActivityCancelOutboxCollectionName #

public string ActivityCancelOutboxCollectionName { get; set; }

The name of the activity cancel outbox collection. The default is workflow_activity_cancel_outbox.

property ActivityCompletionInboxCollectionName #

public string ActivityCompletionInboxCollectionName { get; set; }

The name of the activity completion inbox collection. The default is workflow_activity_completion_inbox.

property ActivityDispatchOutboxCollectionName #

public string ActivityDispatchOutboxCollectionName { get; set; }

The name of the activity dispatch outbox collection. The default is workflow_activity_dispatch_outbox.

property 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 ChildExecutionLinksCollectionName #

public string ChildExecutionLinksCollectionName { get; set; }

The name of the child execution links collection. The default is workflow_child_execution_links.

property ClaimTimeoutSeconds #

public int ClaimTimeoutSeconds { get; set; }

How long a claimed signal or wake notice stays leased to its consumer, in seconds; a value below 1 counts as 1. The default is 60.

property ConnectionStringName #

public string ConnectionStringName { get; set; }

The name of the store’s connection string (ConnectionStrings:<name>). The default is WorkflowMongo.

property ContinuationLineagesCollectionName #

public string ContinuationLineagesCollectionName { get; set; }

The name of the continuation lineages collection. The default is workflow_continuation_lineages.

property DatabaseName #

public string DatabaseName { get; set; }

Physical MongoDB database that holds the workflow store collections. The default is stellaops_workflow_store.

Remarks

The store does not check that the database already holds workflow data: a name that differs from the database in use points the store at an empty database without an error. Set WorkflowBackend:Mongo:DatabaseName explicitly to keep a deployment on its database.

property DeadLetterCollectionName #

public string DeadLetterCollectionName { get; set; }

The name of the dead letter collection. The default is workflow_signal_dead_letters.

property DefinitionAuditCollectionName #

public string DefinitionAuditCollectionName { get; set; }

The name of the definition audit collection. The default is workflow_definition_audit.

property DefinitionsCollectionName #

public string DefinitionsCollectionName { get; set; }

The name of the definitions collection. The default is workflow_definitions.

property DurableOutboxCollectionName #

public string DurableOutboxCollectionName { get; set; }

The name of the durable outbox collection. The default is workflow_durable_outbox.

property ExecutionAssociationsCollectionName #

public string ExecutionAssociationsCollectionName { get; set; }

The name of the execution associations collection. The default is workflow_execution_associations.

property ExecutionEventsCollectionName #

public string ExecutionEventsCollectionName { get; set; }

The name of the execution events collection. The default is workflow_execution_events.

property FirstSeenWorkflowsCollectionName #

public string FirstSeenWorkflowsCollectionName { get; set; }

The name of the first seen workflows collection. The default is workflow_first_seen_workflows.

property HostedJobLocksCollectionName #

public string HostedJobLocksCollectionName { get; set; }

The name of the hosted job locks collection. The default is workflow_host_locks.

property InstancesCollectionName #

public string InstancesCollectionName { get; set; }

The name of the instances collection. The default is workflow_instances.

property MapExecutionsCollectionName #

public string MapExecutionsCollectionName { get; set; }

The name of the map executions collection. The default is workflow_map_executions.

property MapItemsCollectionName #

public string MapItemsCollectionName { get; set; }

The name of the map items collection. The default is workflow_map_items.

property PrestartTerminalFencesCollectionName #

public string PrestartTerminalFencesCollectionName { get; set; }

The name of the prestart terminal fences collection. The default is workflow_prestart_terminal_fences.

property RegisteredSignalInboxCollectionName #

public string RegisteredSignalInboxCollectionName { get; set; }

The name of the registered signal inbox collection. The default is workflow_registered_signal_inbox.

property RegisteredSignalWaitsCollectionName #

public string RegisteredSignalWaitsCollectionName { get; set; }

The name of the registered signal waits collection. The default is workflow_registered_signal_waits.

property RootScopesCollectionName #

public string RootScopesCollectionName { get; set; }

The name of the root scopes collection. The default is workflow_root_scopes.

property RuntimeStatesCollectionName #

public string RuntimeStatesCollectionName { get; set; }

The name of the runtime states collection. The default is workflow_runtime_states.

property SchemaCollectionName #

public string SchemaCollectionName { get; set; }

Holds the store schema version; written last by the initialization that creates collections and indexes.

property ScopeExecutionsCollectionName #

public string ScopeExecutionsCollectionName { get; set; }

The name of the scope executions collection. The default is workflow_scope_executions.

property ScopeReprocessesCollectionName #

public string ScopeReprocessesCollectionName { get; set; }

The name of the scope reprocesses collection. The default is workflow_scope_reprocesses.

property SignalDeadlineTimersCollectionName #

public string SignalDeadlineTimersCollectionName { get; set; }

The name of the signal deadline timers collection. The default is workflow_signal_deadline_timers.

property SignalQueueCollectionName #

public string SignalQueueCollectionName { get; set; }

The name of the signal queue collection. The default is workflow_signals.

property StartReceiptsCollectionName #

public string StartReceiptsCollectionName { get; set; }

The name of the start receipts collection. The default is workflow_start_receipts.

property StepAttemptsCollectionName #

public string StepAttemptsCollectionName { get; set; }

The name of the step attempts collection. The default is workflow_step_attempts.

property StepExecutionsCollectionName #

public string StepExecutionsCollectionName { get; set; }

The name of the step executions collection. The default is workflow_step_executions.

property TaskEventsCollectionName #

public string TaskEventsCollectionName { get; set; }

The name of the task events collection. The default is workflow_task_events.

property TasksCollectionName #

public string TasksCollectionName { get; set; }

The name of the tasks collection. The default is workflow_tasks.

property TerminalInboxCollectionName #

public string TerminalInboxCollectionName { get; set; }

The name of the terminal inbox collection. The default is workflow_terminal_inbox.

property WakeOutboxCollectionName #

public string WakeOutboxCollectionName { get; set; }

The name of the wake outbox collection. The default is workflow_signal_wake_outbox.