StellaOps.Workflow.Engine

Workflow engine: definition deployment, instance lifecycle, signal-driven task transitions, dead-letter handling and retention.

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.Engine --version 1.0.1-20261118T121708Z

Namespaces

NamespaceTypes
StellaOps.Workflow.Engine.Authorization1
StellaOps.Workflow.Engine.Children4
StellaOps.Workflow.Engine.Constants7
StellaOps.Workflow.Engine.Definitions2
StellaOps.Workflow.Engine.Durability36
StellaOps.Workflow.Engine.Exceptions3
StellaOps.Workflow.Engine.Execution3
StellaOps.Workflow.Engine.ExternalActivities29
StellaOps.Workflow.Engine.History2
StellaOps.Workflow.Engine.HostedServices4
StellaOps.Workflow.Engine.Hosting3
StellaOps.Workflow.Engine.Licensing14
StellaOps.Workflow.Engine.Maps16
StellaOps.Workflow.Engine.Observability3
StellaOps.Workflow.Engine.Rendering2
StellaOps.Workflow.Engine.Scheduling3
StellaOps.Workflow.Engine.Services42
StellaOps.Workflow.Engine.Services.Converters4
StellaOps.Workflow.Engine.Signaling12

namespace StellaOps.Workflow.Engine.Authorization

TypeKindDescription
WorkflowTaskAuthorizationServiceclassDecides whether an actor may act on a task, through the registered assignment permission evaluator.

class WorkflowTaskAuthorizationService

public sealed class WorkflowTaskAuthorizationService

Decides whether an actor may act on a task, through the registered assignment permission evaluator.

Parameters

  • permissionEvaluator: The evaluator.

Members

MemberKindSummary
WorkflowTaskAuthorizationService(IWorkflowAssignmentPermissionEvaluator)constructorDecides whether an actor may act on a task, through the registered assignment permission evaluator.
Evaluate(WorkflowAssignmentPermissionContext)methodEvaluates an assignment permission.

constructor WorkflowTaskAuthorizationService(IWorkflowAssignmentPermissionEvaluator) #

public WorkflowTaskAuthorizationService(IWorkflowAssignmentPermissionEvaluator permissionEvaluator)

Decides whether an actor may act on a task, through the registered assignment permission evaluator.

Parameters

  • permissionEvaluator: The evaluator.

method Evaluate(WorkflowAssignmentPermissionContext) #

public WorkflowAssignmentPermissionDecision Evaluate(WorkflowAssignmentPermissionContext context)

Evaluates an assignment permission.

Parameters

  • context: The actor, the task and the action.

Returns

The decision.

namespace StellaOps.Workflow.Engine.Children

TypeKindDescription
WorkflowChildExecutionServiceclassRecords child workflow links: their start and completion, each with an outbox message for the parent, and their cancellation.
WorkflowChildLinkResultrecordThe link between a parent step and its child.
WorkflowCompleteChildRequestrecordA finished child workflow and its result.
WorkflowStartChildRequestrecordA child workflow to start and link to its parent step.

class WorkflowChildExecutionService

public sealed class WorkflowChildExecutionService

Records child workflow links: their start and completion, each with an outbox message for the parent, and their cancellation.

Parameters

  • store: The child link store.
  • timeProvider: The clock.

Members

MemberKindSummary
WorkflowChildExecutionService(IWorkflowChildLinkStore, TimeProvider)constructorRecords child workflow links: their start and completion, each with an outbox message for the parent, and their cancellation.
CancelAsync(string, long, CancellationToken)methodCancels a link.
CompleteAsync(WorkflowCompleteChildRequest, CancellationToken)methodRecords a child result, canonicalized, with a WORKFLOW_CHILD_COMPLETED outbox message.
StartAsync(WorkflowStartChildRequest, CancellationToken)methodRecords a child start with a WORKFLOW_CHILD_START outbox message.

constructor WorkflowChildExecutionService(IWorkflowChildLinkStore, TimeProvider) #

public WorkflowChildExecutionService(IWorkflowChildLinkStore store, TimeProvider timeProvider)

Records child workflow links: their start and completion, each with an outbox message for the parent, and their cancellation.

Parameters

  • store: The child link store.
  • timeProvider: The clock.

method CancelAsync(string, long, CancellationToken) #

public Task<WorkflowChildLinkResult> CancelAsync(string linkId, long expectedVersion, CancellationToken cancellationToken = default)

Cancels a link. A completed or canceled link is returned as replayed.

Parameters

  • linkId: The link.
  • expectedVersion: The link version the caller read.
  • cancellationToken: Cancels the operation.

Returns

The link.

Exceptions

method CompleteAsync(WorkflowCompleteChildRequest, CancellationToken) #

public Task<WorkflowChildLinkResult> CompleteAsync(WorkflowCompleteChildRequest request, CancellationToken cancellationToken = default)

Records a child result, canonicalized, with a WORKFLOW_CHILD_COMPLETED outbox message. A repeated completion with the same result hash is returned as replayed.

Parameters

  • request: The child result.
  • cancellationToken: Cancels the operation.

Returns

The link.

Exceptions

  • InvalidOperationException: The hash does not match the result, the link does not exist or names another child, a completed link has another result, or the link was canceled.

method StartAsync(WorkflowStartChildRequest, CancellationToken) #

public Task<WorkflowChildLinkResult> StartAsync(WorkflowStartChildRequest request, CancellationToken cancellationToken = default)

Records a child start with a WORKFLOW_CHILD_START outbox message. A start already recorded under the link is returned as replayed when it names the same child and request hash.

Parameters

  • request: The child start.
  • cancellationToken: Cancels the operation.

Returns

The link.

Exceptions

  • ArgumentException: An identifier is missing, or the request hash is not 64 hexadecimal characters.
  • InvalidOperationException: A start recorded under the link names another child or request hash.

record WorkflowChildLinkResult

public sealed record WorkflowChildLinkResult

The link between a parent step and its child.

Members

MemberKindSummary
WorkflowChildLinkResult()constructorCreates an instance of WorkflowChildLinkResult.
ChildWorkflowExecutionIdpropertyThe child execution.
LinkIdpropertyThe link.
ReplayedpropertyWhether the operation had already been applied and was returned as recorded.
StatuspropertyThe link status.

constructor WorkflowChildLinkResult() #

public WorkflowChildLinkResult()

Creates an instance of WorkflowChildLinkResult.

property ChildWorkflowExecutionId #

public required string ChildWorkflowExecutionId { get; init; }

The child execution.

property LinkId #

public required string LinkId { get; init; }

The link.

property Replayed #

public required bool Replayed { get; init; }

Whether the operation had already been applied and was returned as recorded.

property Status #

public required string Status { get; init; }

The link status.

record WorkflowCompleteChildRequest

public sealed record WorkflowCompleteChildRequest

A finished child workflow and its result.

Members

MemberKindSummary
WorkflowCompleteChildRequest()constructorCreates an instance of WorkflowCompleteChildRequest.
ChildWorkflowExecutionIdpropertyThe child execution.
LinkIdpropertyThe link.
ResultDescriptorJsonpropertyThe child result descriptor, as JSON.
ResultSha256propertyThe SHA-256 of the result.

constructor WorkflowCompleteChildRequest() #

public WorkflowCompleteChildRequest()

Creates an instance of WorkflowCompleteChildRequest.

property ChildWorkflowExecutionId #

public required string ChildWorkflowExecutionId { get; init; }

The child execution.

property LinkId #

public required string LinkId { get; init; }

The link.

property ResultDescriptorJson #

public required string ResultDescriptorJson { get; init; }

The child result descriptor, as JSON.

property ResultSha256 #

public required string ResultSha256 { get; init; }

The SHA-256 of the result.

record WorkflowStartChildRequest

public sealed record WorkflowStartChildRequest

A child workflow to start and link to its parent step.

Members

MemberKindSummary
WorkflowStartChildRequest()constructorCreates an instance of WorkflowStartChildRequest.
ChildDefinitionCodepropertyThe child workflow.
ChildDefinitionVersionpropertyThe child workflow version.
ChildWorkflowExecutionIdpropertyThe child execution.
LinkIdpropertyThe link.
ParentScopeExecutionIdpropertyThe parent scope.
ParentStepExecutionIdpropertyThe parent step.
ParentWorkflowExecutionIdpropertyThe parent execution.
StartRequestSha256propertyThe SHA-256 of the child start request.

constructor WorkflowStartChildRequest() #

public WorkflowStartChildRequest()

Creates an instance of WorkflowStartChildRequest.

property ChildDefinitionCode #

public required string ChildDefinitionCode { get; init; }

The child workflow.

property ChildDefinitionVersion #

public required string ChildDefinitionVersion { get; init; }

The child workflow version.

property ChildWorkflowExecutionId #

public required string ChildWorkflowExecutionId { get; init; }

The child execution.

property LinkId #

public required string LinkId { get; init; }

The link.

property ParentScopeExecutionId #

public required string ParentScopeExecutionId { get; init; }

The parent scope.

property ParentStepExecutionId #

public required string ParentStepExecutionId { get; init; }

The parent step.

property ParentWorkflowExecutionId #

public required string ParentWorkflowExecutionId { get; init; }

The parent execution.

property StartRequestSha256 #

public required string StartRequestSha256 { get; init; }

The SHA-256 of the child start request.

namespace StellaOps.Workflow.Engine.Constants

TypeKindDescription
ConstantsClassclassString values the engine stores and compares.
ConstantsClass.MapPoliciesclassThe fan-in and failure policies of a map step.
ConstantsClass.RetryBackoffKindsclassHow the delay between retries grows.
MessageKeysclassThe message ids of the engine’s business errors.
WorkflowInstanceStatusesclassThe statuses of a workflow instance.
WorkflowTaskEventTypesclassThe event types of a human task’s history.
WorkflowTaskStatusesclassThe statuses of a human task.

class ConstantsClass

public static class ConstantsClass

String values the engine stores and compares.

Members

MemberKindSummary
ChildCanceledconstantChild link: the child was canceled.
ChildCompletedconstantChild link: the child completed and its result reached the parent.
ChildStartPendingconstantChild link: the child start is queued.
ChildWaitingconstantA child link state that the engine sets on no link.
CursorCompactedconstantThe timeline disposition when the requested events were compacted away.
DefinitionNotReadyCodeconstantThe refusal code of a start whose managed definition is not ready: not managed, another code, or no build and compatibility hashes.
DefinitionOriginManagedconstantThe origin of a managed definition.
DefinitionOriginOperatorconstantThe origin of a definition an operator imported.
DurableOutboxPublishedconstantSent.
DurableOutboxReadyconstantAppended, not yet sent.
ExecutionIntegrityReconciliationScheduleconstantThe name of the execution integrity reconciliation schedule.
OutboxInboxCompactionScheduleconstantThe name of the outbox and inbox compaction schedule.
SafeProfileconstantThe execution console profile that shows only allowed state keys.
ServiceNameconstantThe service name of the engine.
TechnicalProfileconstantThe execution console profile that shows more detail.

constant ChildCanceled #

public const string ChildCanceled = "CANCELED"

Child link: the child was canceled.

constant ChildCompleted #

public const string ChildCompleted = "COMPLETED"

Child link: the child completed and its result reached the parent.

constant ChildStartPending #

public const string ChildStartPending = "START_PENDING"

Child link: the child start is queued.

constant ChildWaiting #

public const string ChildWaiting = "WAITING"

A child link state that the engine sets on no link.

constant CursorCompacted #

public const string CursorCompacted = "CURSOR_COMPACTED"

The timeline disposition when the requested events were compacted away.

constant DefinitionNotReadyCode #

public const string DefinitionNotReadyCode = "DEFINITION_NOT_READY"

The refusal code of a start whose managed definition is not ready: not managed, another code, or no build and compatibility hashes.

constant DefinitionOriginManaged #

public const string DefinitionOriginManaged = "MANAGED_EMBEDDED"

The origin of a managed definition.

constant DefinitionOriginOperator #

public const string DefinitionOriginOperator = "OPERATOR_IMPORTED"

The origin of a definition an operator imported.

constant DurableOutboxPublished #

public const string DurableOutboxPublished = "PUBLISHED"

Sent.

constant DurableOutboxReady #

public const string DurableOutboxReady = "READY"

Appended, not yet sent.

constant ExecutionIntegrityReconciliationSchedule #

public const string ExecutionIntegrityReconciliationSchedule = "STELLAOPS_EXECUTION_INTEGRITY_RECONCILIATION"

The name of the execution integrity reconciliation schedule.

constant OutboxInboxCompactionSchedule #

public const string OutboxInboxCompactionSchedule = "STELLAOPS_OUTBOX_INBOX_COMPACTION"

The name of the outbox and inbox compaction schedule.

constant SafeProfile #

public const string SafeProfile = "SAFE"

The execution console profile that shows only allowed state keys.

constant ServiceName #

public const string ServiceName = "StellaOps.Workflow.Engine"

The service name of the engine.

constant TechnicalProfile #

public const string TechnicalProfile = "TECHNICAL"

The execution console profile that shows more detail.

class ConstantsClass.MapPolicies

public static class MapPolicies

The fan-in and failure policies of a map step.

Members

MemberKindSummary
AllSucceededconstantFan-in: the map completes when every item succeeded.
CollectAllconstantFan-in: the map completes when every item finished, whatever the outcome.
CollectPartialconstantFailure: the map waits for every item, then applies its fan-in policy.
FailFastconstantFailure: the first failed item fails the map.
MinimumSucceededconstantFan-in: the map completes when at least the minimum number of items succeeded.
RouteManualconstantFailure: when every item finished and one failed, the map waits for manual handling (ConstantsClass.MapStates.Manual).

constant AllSucceeded #

public const string AllSucceeded = "ALL_SUCCEEDED"

Fan-in: the map completes when every item succeeded.

constant CollectAll #

public const string CollectAll = "COLLECT_ALL"

Fan-in: the map completes when every item finished, whatever the outcome.

constant CollectPartial #

public const string CollectPartial = "COLLECT_PARTIAL"

Failure: the map waits for every item, then applies its fan-in policy.

constant FailFast #

public const string FailFast = "FAIL_FAST"

Failure: the first failed item fails the map.

constant MinimumSucceeded #

public const string MinimumSucceeded = "MIN_SUCCEEDED"

Fan-in: the map completes when at least the minimum number of items succeeded.

constant RouteManual #

public const string RouteManual = "ROUTE_MANUAL"

Failure: when every item finished and one failed, the map waits for manual handling (ConstantsClass.MapStates.Manual).

class ConstantsClass.RetryBackoffKinds

public static class RetryBackoffKinds

How the delay between retries grows. Every kind is capped by the maximum delay, when one is set, and varied by the jitter.

Members

MemberKindSummary
ExponentialconstantThe delay starts at the initial delay and doubles with each retry.
FixedconstantEvery retry waits the initial delay.
ProviderHintconstantThe delay the provider asks for, such as a retry-after value, capped by the provider-hint bound; the initial delay when the provider gives none.

constant Exponential #

public const string Exponential = "EXPONENTIAL"

The delay starts at the initial delay and doubles with each retry.

constant Fixed #

public const string Fixed = "FIXED"

Every retry waits the initial delay.

constant ProviderHint #

public const string ProviderHint = "PROVIDER_HINT"

The delay the provider asks for, such as a retry-after value, capped by the provider-hint bound; the initial delay when the provider gives none.

class MessageKeys

public static class MessageKeys

The message ids of the engine’s business errors. The HTTP endpoints map each to a status.

Members

MemberKindSummary
WorkflowArbitrarySignalNotAllowedpropertyAn arbitrary signal is not allowed.
WorkflowBusinessIdMissingpropertyA business id is missing.
WorkflowDefinitionNotFoundpropertyThe workflow definition does not exist (404).
WorkflowInstanceNotFoundpropertyThe workflow instance does not exist (404).
WorkflowPayloadFieldMissingpropertyA payload or state field a step reads is missing (400).
WorkflowRuntimeFailedpropertyThe runtime failed.
WorkflowServiceAudienceDeniedpropertyThe calling service is not an allowed audience of the start (403).
WorkflowSortColumnNotAllowedpropertyThe sort column is not one the list allows (400).
WorkflowStartExactReplayConflictpropertyA start replay conflicts with an earlier start.
WorkflowStartNotReadypropertyThe start is not ready.
WorkflowTaskActionDeniedpropertyThe caller may not act on the task (403).
WorkflowTaskAlreadyCompletedpropertyThe task is already completed (409).
WorkflowTaskCancelledpropertyThe task was cancelled (409).
WorkflowTaskExpiredpropertyThe task has expired (409).
WorkflowTaskNotFoundpropertyThe task does not exist (404).
WorkflowTransportFailedpropertyA transport call failed and no failure branch handled it (502).

property WorkflowArbitrarySignalNotAllowed #

public static string WorkflowArbitrarySignalNotAllowed { get; }

An arbitrary signal is not allowed. The endpoints answer it with 400; the engine does not raise it.

property WorkflowBusinessIdMissing #

public static string WorkflowBusinessIdMissing { get; }

A business id is missing. The endpoints answer it with 400; the engine does not raise it.

property WorkflowDefinitionNotFound #

public static string WorkflowDefinitionNotFound { get; }

The workflow definition does not exist (404).

property WorkflowInstanceNotFound #

public static string WorkflowInstanceNotFound { get; }

The workflow instance does not exist (404).

property WorkflowPayloadFieldMissing #

public static string WorkflowPayloadFieldMissing { get; }

A payload or state field a step reads is missing (400).

property WorkflowRuntimeFailed #

public static string WorkflowRuntimeFailed { get; }

The runtime failed. The endpoints answer it with 500; the engine does not raise it.

property WorkflowServiceAudienceDenied #

public static string WorkflowServiceAudienceDenied { get; }

The calling service is not an allowed audience of the start (403).

property WorkflowSortColumnNotAllowed #

public static string WorkflowSortColumnNotAllowed { get; }

The sort column is not one the list allows (400).

property WorkflowStartExactReplayConflict #

public static string WorkflowStartExactReplayConflict { get; }

A start replay conflicts with an earlier start. The endpoints answer it with 409; the engine does not raise it.

property WorkflowStartNotReady #

public static string WorkflowStartNotReady { get; }

The start is not ready. The endpoints answer it with 409; the engine does not raise it.

property WorkflowTaskActionDenied #

public static string WorkflowTaskActionDenied { get; }

The caller may not act on the task (403).

property WorkflowTaskAlreadyCompleted #

public static string WorkflowTaskAlreadyCompleted { get; }

The task is already completed (409).

property WorkflowTaskCancelled #

public static string WorkflowTaskCancelled { get; }

The task was cancelled (409).

property WorkflowTaskExpired #

public static string WorkflowTaskExpired { get; }

The task has expired (409).

property WorkflowTaskNotFound #

public static string WorkflowTaskNotFound { get; }

The task does not exist (404).

property WorkflowTransportFailed #

public static string WorkflowTransportFailed { get; }

A transport call failed and no failure branch handled it (502).

class WorkflowInstanceStatuses

public static class WorkflowInstanceStatuses

The statuses of a workflow instance.

Members

MemberKindSummary
CompletedconstantCompleted.
OpenconstantRunning.
StaleconstantPast its stale date without completing.

constant Completed #

public const string Completed = "Completed"

Completed.

constant Open #

public const string Open = "Open"

Running.

constant Stale #

public const string Stale = "Stale"

Past its stale date without completing.

class WorkflowTaskEventTypes

public static class WorkflowTaskEventTypes

The event types of a human task’s history.

Members

MemberKindSummary
AssignedconstantThe task was assigned.
CancelledconstantThe task was cancelled.
CompletedconstantThe task was completed.
CreatedconstantThe task was opened.
ExpiredconstantThe task expired.
ReassignedconstantThe task was assigned again.
ReleasedconstantThe task was released.

constant Assigned #

public const string Assigned = "Assigned"

The task was assigned.

constant Cancelled #

public const string Cancelled = "Cancelled"

The task was cancelled.

constant Completed #

public const string Completed = "Completed"

The task was completed.

constant Created #

public const string Created = "Created"

The task was opened.

constant Expired #

public const string Expired = "Expired"

The task expired.

constant Reassigned #

public const string Reassigned = "Reassigned"

The task was assigned again.

constant Released #

public const string Released = "Released"

The task was released.

class WorkflowTaskStatuses

public static class WorkflowTaskStatuses

The statuses of a human task.

Members

MemberKindSummary
AssignedconstantAssigned to a user or to roles.
CancelledconstantCancelled, for example when its fork ended or its instance was cancelled.
CompletedconstantCompleted.
ExpiredconstantClosed by its timeout.
OpenconstantOpen for any user with a matching role.
StaleconstantPast its stale date while open.

constant Assigned #

public const string Assigned = "Assigned"

Assigned to a user or to roles.

constant Cancelled #

public const string Cancelled = "Cancelled"

Cancelled, for example when its fork ended or its instance was cancelled.

constant Completed #

public const string Completed = "Completed"

Completed.

constant Expired #

public const string Expired = "Expired"

Closed by its timeout.

constant Open #

public const string Open = "Open"

Open for any user with a matching role.

constant Stale #

public const string Stale = "Stale"

Past its stale date while open.

namespace StellaOps.Workflow.Engine.Definitions

TypeKindDescription
WorkflowRuntimeDefinitionStoreclassBuilds the runtime definitions of the registered workflows; a declarative workflow is compiled and validated, and one that fails raises an error naming its issues.
WorkflowRuntimeExecutionHandlerFactoryclassCreates the execution handlers of runtime definitions.

class WorkflowRuntimeDefinitionStore

public sealed class WorkflowRuntimeDefinitionStore : IWorkflowRuntimeDefinitionStore

Builds the runtime definitions of the registered workflows; a declarative workflow is compiled and validated, and one that fails raises an error naming its issues.

Members

MemberKindSummary
WorkflowRuntimeDefinitionStore(IWorkflowRegistrationCatalog, IWorkflowModuleCatalog, IWorkflowFunctionCatalog, IWorkflowExternalActivityRegistry)constructorCreates the store.
GetDefinition(string, string)methodFinds a runtime definition.
GetDefinitions()methodReturns every runtime definition.
GetRequiredDefinition(string, string)methodFinds a runtime definition.

constructor WorkflowRuntimeDefinitionStore(IWorkflowRegistrationCatalog, IWorkflowModuleCatalog, IWorkflowFunctionCatalog, IWorkflowExternalActivityRegistry) #

public WorkflowRuntimeDefinitionStore(IWorkflowRegistrationCatalog workflowRegistrationCatalog, IWorkflowModuleCatalog workflowModuleCatalog, IWorkflowFunctionCatalog workflowFunctionCatalog, IWorkflowExternalActivityRegistry? externalActivityRegistry = null)

Creates the store.

Parameters

  • workflowRegistrationCatalog: The registered workflows.
  • workflowModuleCatalog: The installed function modules, for the module check.
  • workflowFunctionCatalog: The function catalog, for compilation and validation.
  • externalActivityRegistry: The external activity registry, for validation; none when not set.

method GetDefinition(string, string) #

public WorkflowRuntimeDefinition? GetDefinition(string workflowName, string? workflowVersion = null)

Finds a runtime definition.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version; the latest when not set.

Returns

The definition, or null.

method GetDefinitions() #

public IReadOnlyCollection<WorkflowRuntimeDefinition> GetDefinitions()

Returns every runtime definition.

Returns

The definitions.

method GetRequiredDefinition(string, string) #

public WorkflowRuntimeDefinition GetRequiredDefinition(string workflowName, string? workflowVersion = null)

Finds a runtime definition.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version; the latest when not set.

Returns

The definition.

Exceptions

  • InvalidOperationException: No such definition is registered.

class WorkflowRuntimeExecutionHandlerFactory

public sealed class WorkflowRuntimeExecutionHandlerFactory : IWorkflowRuntimeExecutionHandlerFactory

Creates the execution handlers of runtime definitions.

Parameters

  • serviceProvider: Resolves custom handlers.

Members

MemberKindSummary
WorkflowRuntimeExecutionHandlerFactory(IServiceProvider)constructorCreates the execution handlers of runtime definitions.
TryCreateHandler(WorkflowRuntimeDefinition)methodCreates the handler: the custom handler of the registration, or the declarative handler; none for a definition-only workflow.

constructor WorkflowRuntimeExecutionHandlerFactory(IServiceProvider) #

public WorkflowRuntimeExecutionHandlerFactory(IServiceProvider serviceProvider)

Creates the execution handlers of runtime definitions.

Parameters

  • serviceProvider: Resolves custom handlers.

method TryCreateHandler(WorkflowRuntimeDefinition) #

public IWorkflowExecutionHandler? TryCreateHandler(WorkflowRuntimeDefinition definition)

Creates the handler: the custom handler of the registration, or the declarative handler; none for a definition-only workflow.

Parameters

  • definition: The runtime definition.

Returns

The handler, or null.

namespace StellaOps.Workflow.Engine.Durability

TypeKindDescription
IWorkflowDurableStartAdmissionPolicyinterfaceDecides whether a durable start may run now.
IWorkflowOutboxMessagePublisherinterfaceSends outbox messages over a transport.
IWorkflowServiceAudienceResolverinterfaceMaps an authenticated service subject to its service audience.
WorkflowActivityCompletionMessageHandlerclassHandles WorkflowExternalActivityLanes.Completed: records the completion and resumes the waiting step (or map item) when it can resume.
WorkflowDefinitionStartAdmissionPolicyclassAdmits a durable start only for a permitted, managed and active definition whose content hash matches the request.
WorkflowDeliveryDispositionenumWhat the engine decided about one delivered durable message.
WorkflowDurableMaintenanceOptionsclassOptions of the durable maintenance tasks, bound from WorkflowMaintenance.
WorkflowDurableMaintenanceServiceclassThe engine’s periodic durable maintenance: the execution integrity check and the outbox/inbox compaction.
WorkflowDurableMessageTypesclassMessage types of the durable start protocol; an integration transport publishes and consumes them by these names.
WorkflowDurableMessagingServiceCollectionExtensionsclassRegisters the durable messaging of the engine.
WorkflowDurableOutboxMessagerecordA durable start message waiting in the outbox.
WorkflowDurableRootContinuationServiceclassContinues a durable start after its start decision committed: checks the stored receipt and the digest of the stored request, then runs the start.
WorkflowDurableStartAudienceclassWho may call the durable start lane.
WorkflowDurableStartOptionsclassThe workflow definitions a service may start durably (WorkflowDurableStart).
WorkflowDurableStartServiceclassDecides durable starts and prestart terminal commands once, each in one change scope with its outbox messages.
WorkflowExactReplayConflictExceptionclassRaised when a replay carries different content under an identity already recorded.
WorkflowOutboxBatchResultrecordThe counts of one outbox drain.
WorkflowOutboxDeliveryrecordOne outbox row as a message: the lane (channel), its id, the canonical body and the contract headers.
WorkflowOutboxDispatcherclassDrains the ready outbox rows (activity dispatches, activity cancellations and the durable start messages) through IWorkflowOutboxMessagePublisherand records every delivery attempt; an unconfirmed message stays ready for an exact replay.
WorkflowOutboxDispatcherHostedServiceclassRuns WorkflowOutboxDispatchercontinuously: quickly while rows are ready, slowly when idle.
WorkflowRegisteredSignalDispositionenumHow a raised signal was handled.
WorkflowRegisteredSignalOptionsclassThe registered signals and the service audiences that may use them (WorkflowRegisteredSignals).
WorkflowRegisteredSignalRaiseRequestrecordA signal raised for a registered wait.
WorkflowRegisteredSignalRaiseResponserecordHow a raised signal was handled.
WorkflowRegisteredSignalServiceclassRegistered signal waits: a step waits for a signal from a registered service audience until a deadline, and the signal or the deadline wins, whichever is recorded first.
WorkflowRegisteredSignalWaitRequestrecordA wait to register, with its deadline timer.
WorkflowRegisteredSignalWaitResultrecordThe state of a registered wait.
WorkflowRegisteredWaitOutcomeenumThe state of a registered wait.
WorkflowRootAlreadyStartedExceptionclassRaised when an execution already has a durable root.
WorkflowRootContinuationMessageHandlerclassHandles WorkflowDurableMessageTypes.RootContinuation.
WorkflowRootContinuationV1recordContinues a durable root after its start committed.
WorkflowServiceAudienceResolverclassMaps subjects to audiences with ServiceSubjects of the registered signal options.
WorkflowStartAdmissionDecisionrecordThe admission decision on a durable start.
WorkflowStartAdmissionDispositionenumWhether a durable start may run now.
WorkflowStartExecutionMessageHandlerclassHandles WorkflowDurableMessageTypes.StartExecution.
WorkflowStartNotReadyExceptionclassRaised when a durable start cannot run yet; the start is retried.

interface IWorkflowDurableStartAdmissionPolicy

public interface IWorkflowDurableStartAdmissionPolicy

Decides whether a durable start may run now.

Members

MemberKindSummary
EvaluateAsync(StartWorkflowExecutionV1, CancellationToken)methodDecides on a start request.

method EvaluateAsync(StartWorkflowExecutionV1, CancellationToken) #

Task<WorkflowStartAdmissionDecision> EvaluateAsync(StartWorkflowExecutionV1 request, CancellationToken cancellationToken = default)

Decides on a start request.

Parameters

  • request: The start request.
  • cancellationToken: Cancels the operation.

Returns

The decision.

interface IWorkflowOutboxMessagePublisher

public interface IWorkflowOutboxMessagePublisher

Sends outbox messages over a transport. Returns true only when the transport confirmed the message.

Members

MemberKindSummary
PublishAsync(WorkflowOutboxDelivery, CancellationToken)methodSends a message.

method PublishAsync(WorkflowOutboxDelivery, CancellationToken) #

Task<bool> PublishAsync(WorkflowOutboxDelivery message, CancellationToken cancellationToken)

Sends a message.

Parameters

  • message: The message.
  • cancellationToken: Cancels the operation.

Returns

Whether the transport confirmed it.

interface IWorkflowServiceAudienceResolver

public interface IWorkflowServiceAudienceResolver

Maps an authenticated service subject to its service audience.

Members

MemberKindSummary
ResolveAudience(string)methodReturns the audience of a subject.

method ResolveAudience(string) #

string? ResolveAudience(string? authenticatedSubject)

Returns the audience of a subject.

Parameters

  • authenticatedSubject: The authenticated subject.

Returns

The audience, or null when the subject has none.

class WorkflowActivityCompletionMessageHandler

public sealed class WorkflowActivityCompletionMessageHandler

Handles WorkflowExternalActivityLanes.Completed: records the completion and resumes the waiting step (or map item) when it can resume.

Members

MemberKindSummary
WorkflowActivityCompletionMessageHandler(IServiceScopeFactory)constructorHandles WorkflowExternalActivityLanes.Completed: records the completion and resumes the waiting step (or map item) when it can resume.
HandleAsync(ReadOnlyMemory<byte>, CancellationToken)methodDecodes an activity completion, records it and resumes the waiting step or map item.

constructor WorkflowActivityCompletionMessageHandler(IServiceScopeFactory) #

public WorkflowActivityCompletionMessageHandler(IServiceScopeFactory scopeFactory)

Handles WorkflowExternalActivityLanes.Completed: records the completion and resumes the waiting step (or map item) when it can resume.

method HandleAsync(ReadOnlyMemory<byte>, CancellationToken) #

public Task<WorkflowDeliveryDisposition> HandleAsync(ReadOnlyMemory<byte> body, CancellationToken cancellationToken)

Decodes an activity completion, records it and resumes the waiting step or map item.

Parameters

  • body: The message body.
  • cancellationToken: Cancels the operation.

Returns

The disposition of the completion; RetryableFailure on a version conflict or when the resume did not apply; Poison when the body does not decode or validate; Rejected when the completion conflicts with its binding.

class WorkflowDefinitionStartAdmissionPolicy

public sealed class WorkflowDefinitionStartAdmissionPolicy : IWorkflowDurableStartAdmissionPolicy

Admits a durable start only for a permitted, managed and active definition whose content hash matches the request.

Parameters

  • definitionStore: The definition store.
  • options: The durable start options; their Definitions name the permitted definitions.

Members

MemberKindSummary
WorkflowDefinitionStartAdmissionPolicy(IWorkflowDefinitionStore, IOptions<WorkflowDurableStartOptions>)constructorAdmits a durable start only for a permitted, managed and active definition whose content hash matches the request.
EvaluateAsync(StartWorkflowExecutionV1, CancellationToken)methodDecides on a start request.

constructor WorkflowDefinitionStartAdmissionPolicy(IWorkflowDefinitionStore, IOptions<WorkflowDurableStartOptions>) #

public WorkflowDefinitionStartAdmissionPolicy(IWorkflowDefinitionStore definitionStore, IOptions<WorkflowDurableStartOptions> options)

Admits a durable start only for a permitted, managed and active definition whose content hash matches the request.

Parameters

  • definitionStore: The definition store.
  • options: The durable start options; their Definitions name the permitted definitions.

method EvaluateAsync(StartWorkflowExecutionV1, CancellationToken) #

public Task<WorkflowStartAdmissionDecision> EvaluateAsync(StartWorkflowExecutionV1 request, CancellationToken cancellationToken = default)

Decides on a start request. A definition the options do not name, or whose hash differs, is rejected permanently (DEFINITION_NOT_PERMITTED, DEFINITION_HASH_NOT_PERMITTED); a definition that is missing, not managed, without build digests or inactive is not ready yet.

Parameters

  • request: The start request.
  • cancellationToken: Cancels the operation.

Returns

The decision.

enum WorkflowDeliveryDisposition

public enum WorkflowDeliveryDisposition

What the engine decided about one delivered durable message. A transport adapter maps it onto its own acknowledgement (ack, retry, park, reject).

ValueDescription
Applied = 0The message changed state.
TerminalHandoffCommitted = 1The message was handed over to its terminal step and committed.
AlreadyApplied = 2An exact replay of a message already applied.
AlreadyTerminal = 3The target is already terminal.
Late = 4The message arrived after its target moved on.
Ignored = 5Nothing to do for this message.
RetryableFailure = 6A transient conflict; deliver again.
WaitNotReady = 7The target is not ready yet; deliver again later.
Rejected = 8The message conflicts with recorded state and must not be retried.
Poison = 9The message cannot be decoded or validated.

class WorkflowDurableMaintenanceOptions

public sealed class WorkflowDurableMaintenanceOptions

Options of the durable maintenance tasks, bound from WorkflowMaintenance.

Members

MemberKindSummary
WorkflowDurableMaintenanceOptions()constructorCreates an instance of WorkflowDurableMaintenanceOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowMaintenance.
CompactionRetentionDayspropertyDays a delivered outbox or inbox row is kept before compaction; clamped to 7–3650.

constructor WorkflowDurableMaintenanceOptions() #

public WorkflowDurableMaintenanceOptions()

Creates an instance of WorkflowDurableMaintenanceOptions.

constant SectionName #

public const string SectionName = "WorkflowMaintenance"

The configuration section the options bind from: WorkflowMaintenance.

property CompactionRetentionDays #

public int CompactionRetentionDays { get; set; }

Days a delivered outbox or inbox row is kept before compaction; clamped to 7–3650.

class WorkflowDurableMaintenanceService

public sealed class WorkflowDurableMaintenanceService

The engine’s periodic durable maintenance: the execution integrity check and the outbox/inbox compaction. A host runs them from its own scheduler.

Members

MemberKindSummary
WorkflowDurableMaintenanceService(IWorkflowDurableMaintenanceStore, IWorkflowOutboxStore, IOptions<WorkflowDurableMaintenanceOptions>, TimeProvider)constructorThe engine’s periodic durable maintenance: the execution integrity check and the outbox/inbox compaction.
CompactOutboxAsync(CancellationToken)methodDeletes delivered outbox and inbox rows older than the retention.
VerifyIntegrityAsync(CancellationToken)methodFails with WORKFLOW_STEP_ATTEMPT_ORPHANED when a step attempt lost its execution.

constructor WorkflowDurableMaintenanceService(IWorkflowDurableMaintenanceStore, IWorkflowOutboxStore, IOptions<WorkflowDurableMaintenanceOptions>, TimeProvider) #

public WorkflowDurableMaintenanceService(IWorkflowDurableMaintenanceStore maintenanceStore, IWorkflowOutboxStore outboxStore, IOptions<WorkflowDurableMaintenanceOptions> options, TimeProvider timeProvider)

The engine’s periodic durable maintenance: the execution integrity check and the outbox/inbox compaction. A host runs them from its own scheduler.

method CompactOutboxAsync(CancellationToken) #

public Task CompactOutboxAsync(CancellationToken cancellationToken)

Deletes delivered outbox and inbox rows older than the retention.

method VerifyIntegrityAsync(CancellationToken) #

public Task VerifyIntegrityAsync(CancellationToken cancellationToken)

Fails with WORKFLOW_STEP_ATTEMPT_ORPHANED when a step attempt lost its execution.

class WorkflowDurableMessageTypes

public static class WorkflowDurableMessageTypes

Message types of the durable start protocol; an integration transport publishes and consumes them by these names.

Members

MemberKindSummary
PrestartTerminalAckconstantThe lane of prestart terminal acknowledgements.
RootContinuationconstantThe lane of root continuations.
StartExecutionconstantThe lane of durable start requests.
StartExecutionResultconstantThe lane of durable start results.
RequiredLanespropertyEvery lane the engine publishes to or consumes from; a transport must provide each one.

constant PrestartTerminalAck #

public const string PrestartTerminalAck = "workflow.prestart-terminal-ack.v1"

The lane of prestart terminal acknowledgements.

constant RootContinuation #

public const string RootContinuation = "workflow.root-continuation.v1"

The lane of root continuations.

constant StartExecution #

public const string StartExecution = "workflow.start-execution.v1"

The lane of durable start requests.

constant StartExecutionResult #

public const string StartExecutionResult = "workflow.start-execution-result.v1"

The lane of durable start results.

property RequiredLanes #

public static IReadOnlyList<string> RequiredLanes { get; }

Every lane the engine publishes to or consumes from; a transport must provide each one.

class WorkflowDurableMessagingServiceCollectionExtensions

public static class WorkflowDurableMessagingServiceCollectionExtensions

Registers the durable messaging of the engine.

Members

MemberKindSummary
AddWorkflowDurableMessaging(IServiceCollection)extension methodRegisters the durable lane handlers and the outbox dispatcher with its hosted service.

extension method AddWorkflowDurableMessaging(IServiceCollection) #

public static IServiceCollection AddWorkflowDurableMessaging(this IServiceCollection services)

Registers the durable lane handlers and the outbox dispatcher with its hosted service. The host registers an IWorkflowOutboxMessagePublisherfor its transport and feeds the handlers from its consumers.

record WorkflowDurableOutboxMessage

public sealed record WorkflowDurableOutboxMessage

A durable start message waiting in the outbox.

Parameters

  • EventId: The message.
  • MessageType: The message type.
  • AggregateId: The aggregate the message belongs to.
  • PayloadSha256: The SHA-256 of the payload.
  • PayloadJson: The payload, as JSON.
  • DeliveryAttempts: The delivery attempts so far.

Members

MemberKindSummary
WorkflowDurableOutboxMessage(string, string, string, string, string, int)constructorA durable start message waiting in the outbox.
AggregateIdpropertyThe aggregate the message belongs to.
DeliveryAttemptspropertyThe delivery attempts so far.
EventIdpropertyThe message.
MessageTypepropertyThe message type.
PayloadJsonpropertyThe payload, as JSON.
PayloadSha256propertyThe SHA-256 of the payload.

constructor WorkflowDurableOutboxMessage(string, string, string, string, string, int) #

public WorkflowDurableOutboxMessage(string EventId, string MessageType, string AggregateId, string PayloadSha256, string PayloadJson, int DeliveryAttempts)

A durable start message waiting in the outbox.

Parameters

  • EventId: The message.
  • MessageType: The message type.
  • AggregateId: The aggregate the message belongs to.
  • PayloadSha256: The SHA-256 of the payload.
  • PayloadJson: The payload, as JSON.
  • DeliveryAttempts: The delivery attempts so far.

property AggregateId #

public string AggregateId { get; init; }

The aggregate the message belongs to.

property DeliveryAttempts #

public int DeliveryAttempts { get; init; }

The delivery attempts so far.

property EventId #

public string EventId { get; init; }

The message.

property MessageType #

public string MessageType { get; init; }

The message type.

property PayloadJson #

public string PayloadJson { get; init; }

The payload, as JSON.

property PayloadSha256 #

public string PayloadSha256 { get; init; }

The SHA-256 of the payload.

class WorkflowDurableRootContinuationService

public sealed class WorkflowDurableRootContinuationService

Continues a durable start after its start decision committed: checks the stored receipt and the digest of the stored request, then runs the start.

Parameters

  • store: The durable start store.
  • runtimeService: Runs the start.

Members

MemberKindSummary
WorkflowDurableRootContinuationService(IWorkflowDurableStartStore, WorkflowRuntimeService)constructorContinues a durable start after its start decision committed: checks the stored receipt and the digest of the stored request, then runs the start.
ContinueAsync(WorkflowRootContinuationV1, CancellationToken)methodRuns the start of the durable root a continuation names.

constructor WorkflowDurableRootContinuationService(IWorkflowDurableStartStore, WorkflowRuntimeService) #

public WorkflowDurableRootContinuationService(IWorkflowDurableStartStore store, WorkflowRuntimeService runtimeService)

Continues a durable start after its start decision committed: checks the stored receipt and the digest of the stored request, then runs the start.

Parameters

  • store: The durable start store.
  • runtimeService: Runs the start.

method ContinueAsync(WorkflowRootContinuationV1, CancellationToken) #

public Task<bool> ContinueAsync(WorkflowRootContinuationV1 continuation, CancellationToken cancellationToken = default)

Runs the start of the durable root a continuation names.

Parameters

  • continuation: The continuation.
  • cancellationToken: Cancels the operation.

Returns

true when the start ran; false when the execution already moved past the expected version.

Exceptions

class WorkflowDurableStartAudience

public static class WorkflowDurableStartAudience

Who may call the durable start lane.

Members

MemberKindSummary
EnsureAllowed(IWorkflowServiceAudienceResolver, WorkflowDurableStartOptions, string, string)methodOnly a configured start audience may call the lane: a definition configured for another audience is denied, an unconfigured definition (or none, for a pre-start terminal) is allowed to any configured audience and then meets admission.

method EnsureAllowed(IWorkflowServiceAudienceResolver, WorkflowDurableStartOptions, string, string) #

public static void EnsureAllowed(IWorkflowServiceAudienceResolver audienceResolver, WorkflowDurableStartOptions options, string? callerSubject, string? definitionCode)

Only a configured start audience may call the lane: a definition configured for another audience is denied, an unconfigured definition (or none, for a pre-start terminal) is allowed to any configured audience and then meets admission. Throws MessageKeys.WorkflowServiceAudienceDeniedotherwise.

class WorkflowDurableStartOptions

public sealed class WorkflowDurableStartOptions

The workflow definitions a service may start durably (WorkflowDurableStart).

Members

MemberKindSummary
WorkflowDurableStartOptions()constructorCreates an instance of WorkflowDurableStartOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowDurableStart.
DefinitionspropertyMaps a definition code to the service audience allowed to start it durably and to fence its start.

constructor WorkflowDurableStartOptions() #

public WorkflowDurableStartOptions()

Creates an instance of WorkflowDurableStartOptions.

constant SectionName #

public const string SectionName = "WorkflowDurableStart"

The configuration section the options bind from: WorkflowDurableStart.

property Definitions #

public Dictionary<string, string> Definitions { get; set; }

Maps a definition code to the service audience allowed to start it durably and to fence its start. A durable start of a definition missing here is refused with DEFINITION_NOT_PERMITTED.

class WorkflowDurableStartService

public sealed class WorkflowDurableStartService

Decides durable starts and prestart terminal commands once, each in one change scope with its outbox messages.

Parameters

  • store: The durable start store.
  • outboxStore: The outbox store.
  • mutationCoordinator: Begins the change scopes.
  • admissionPolicy: Admits the starts.

Members

MemberKindSummary
WorkflowDurableStartService(IWorkflowDurableStartStore, IWorkflowOutboxStore, IWorkflowMutationCoordinator, IWorkflowDurableStartAdmissionPolicy)constructorDecides durable starts and prestart terminal commands once, each in one change scope with its outbox messages.
GetPendingOutboxAsync(int, CancellationToken)methodReturns the durable outbox messages ready to publish.
MarkOutboxPublishedAsync(string, CancellationToken)methodMarks a ready durable outbox message published.
ProcessPrestartTerminalAsync(WorkflowPrestartTerminalCommandV1, CancellationToken)methodRecords a terminal command that arrives before its start: fences the start request, so the start is not created, and acknowledges the command.
ProcessStartAsync(StartWorkflowExecutionV1, CancellationToken)methodDecides a start request once.

constructor WorkflowDurableStartService(IWorkflowDurableStartStore, IWorkflowOutboxStore, IWorkflowMutationCoordinator, IWorkflowDurableStartAdmissionPolicy) #

public WorkflowDurableStartService(IWorkflowDurableStartStore store, IWorkflowOutboxStore outboxStore, IWorkflowMutationCoordinator mutationCoordinator, IWorkflowDurableStartAdmissionPolicy admissionPolicy)

Decides durable starts and prestart terminal commands once, each in one change scope with its outbox messages.

Parameters

  • store: The durable start store.
  • outboxStore: The outbox store.
  • mutationCoordinator: Begins the change scopes.
  • admissionPolicy: Admits the starts.

method GetPendingOutboxAsync(int, CancellationToken) #

public Task<IReadOnlyCollection<WorkflowDurableOutboxMessage>> GetPendingOutboxAsync(int limit, CancellationToken cancellationToken = default)

Returns the durable outbox messages ready to publish.

Parameters

  • limit: The most messages to return, from 1 to 500.
  • cancellationToken: Cancels the operation.

Returns

The messages.

Exceptions

  • ArgumentOutOfRangeException: The limit is outside 1 to 500.

method MarkOutboxPublishedAsync(string, CancellationToken) #

public Task<bool> MarkOutboxPublishedAsync(string eventId, CancellationToken cancellationToken = default)

Marks a ready durable outbox message published.

Parameters

  • eventId: The message.
  • cancellationToken: Cancels the operation.

Returns

false when the message is not ready: already published or missing.

method ProcessPrestartTerminalAsync(WorkflowPrestartTerminalCommandV1, CancellationToken) #

public Task<WorkflowPrestartTerminalAckV1> ProcessPrestartTerminalAsync(WorkflowPrestartTerminalCommandV1 command, CancellationToken cancellationToken = default)

Records a terminal command that arrives before its start: fences the start request, so the start is not created, and acknowledges the command. A command already recorded under its event id returns the recorded acknowledgement.

Parameters

  • command: The terminal command.
  • cancellationToken: Cancels the operation.

Returns

The acknowledgement.

Exceptions

method ProcessStartAsync(StartWorkflowExecutionV1, CancellationToken) #

public Task<StartWorkflowExecutionResultV1> ProcessStartAsync(StartWorkflowExecutionV1 request, CancellationToken cancellationToken = default)

Decides a start request once. A request already decided returns its recorded result; a fenced request is FENCED_NOT_CREATED; a rejected definition, or an open execution of the definition with the same business reference, is REJECTED_NOT_CREATED; otherwise the root is created, STARTED, with a root continuation message.

Parameters

  • request: The start request.
  • cancellationToken: Cancels the operation.

Returns

The start result.

Exceptions

class WorkflowExactReplayConflictException

public sealed class WorkflowExactReplayConflictException : InvalidOperationException

Raised when a replay carries different content under an identity already recorded.

Parameters

  • identity: The identity.

Members

MemberKindSummary
WorkflowExactReplayConflictException(string)constructorRaised when a replay carries different content under an identity already recorded.
IdentitypropertyThe identity.

constructor WorkflowExactReplayConflictException(string) #

public WorkflowExactReplayConflictException(string identity)

Raised when a replay carries different content under an identity already recorded.

Parameters

  • identity: The identity.

property Identity #

public string Identity { get; }

The identity.

record WorkflowOutboxBatchResult

public sealed record WorkflowOutboxBatchResult

The counts of one outbox drain.

Parameters

  • Attempted: The messages tried.
  • Published: The messages the transport confirmed.
  • Deferred: The messages left ready for a later drain.

Members

MemberKindSummary
WorkflowOutboxBatchResult(int, int, int)constructorThe counts of one outbox drain.
AttemptedpropertyThe messages tried.
DeferredpropertyThe messages left ready for a later drain.
PublishedpropertyThe messages the transport confirmed.

constructor WorkflowOutboxBatchResult(int, int, int) #

public WorkflowOutboxBatchResult(int Attempted, int Published, int Deferred)

The counts of one outbox drain.

Parameters

  • Attempted: The messages tried.
  • Published: The messages the transport confirmed.
  • Deferred: The messages left ready for a later drain.

property Attempted #

public int Attempted { get; init; }

The messages tried.

property Deferred #

public int Deferred { get; init; }

The messages left ready for a later drain.

property Published #

public int Published { get; init; }

The messages the transport confirmed.

record WorkflowOutboxDelivery

public sealed record WorkflowOutboxDelivery

One outbox row as a message: the lane (channel), its id, the canonical body and the contract headers.

Parameters

  • Channel: The lane.
  • MessageId: The message id.
  • Body: The canonical body.
  • ContentType: The media type of the body.
  • Headers: The contract headers.

Members

MemberKindSummary
WorkflowOutboxDelivery(string, string, ReadOnlyMemory<byte>, string, IReadOnlyDictionary<string, object>)constructorOne outbox row as a message: the lane (channel), its id, the canonical body and the contract headers.
BodypropertyThe canonical body.
ChannelpropertyThe lane.
ContentTypepropertyThe media type of the body.
HeaderspropertyThe contract headers.
MessageIdpropertyThe message id.

constructor WorkflowOutboxDelivery(string, string, ReadOnlyMemory<byte>, string, IReadOnlyDictionary<string, object>) #

public WorkflowOutboxDelivery(string Channel, string MessageId, ReadOnlyMemory<byte> Body, string ContentType, IReadOnlyDictionary<string, object> Headers)

One outbox row as a message: the lane (channel), its id, the canonical body and the contract headers.

Parameters

  • Channel: The lane.
  • MessageId: The message id.
  • Body: The canonical body.
  • ContentType: The media type of the body.
  • Headers: The contract headers.

property Body #

public ReadOnlyMemory<byte> Body { get; init; }

The canonical body.

property Channel #

public string Channel { get; init; }

The lane.

property ContentType #

public string ContentType { get; init; }

The media type of the body.

property Headers #

public IReadOnlyDictionary<string, object> Headers { get; init; }

The contract headers.

property MessageId #

public string MessageId { get; init; }

The message id.

class WorkflowOutboxDispatcher

public sealed class WorkflowOutboxDispatcher

Drains the ready outbox rows (activity dispatches, activity cancellations and the durable start messages) through IWorkflowOutboxMessagePublisherand records every delivery attempt; an unconfirmed message stays ready for an exact replay.

Members

MemberKindSummary
WorkflowOutboxDispatcher(IServiceScopeFactory, IWorkflowOutboxMessagePublisher, TimeProvider)constructorDrains the ready outbox rows (activity dispatches, activity cancellations and the durable start messages) through IWorkflowOutboxMessagePublisherand records every delivery attempt; an unconfirmed message stays ready for an exact replay.
PublishBatchAsync(CancellationToken)methodDrains one batch of ready outbox messages.

constructor WorkflowOutboxDispatcher(IServiceScopeFactory, IWorkflowOutboxMessagePublisher, TimeProvider) #

public WorkflowOutboxDispatcher(IServiceScopeFactory scopeFactory, IWorkflowOutboxMessagePublisher publisher, TimeProvider timeProvider)

Drains the ready outbox rows (activity dispatches, activity cancellations and the durable start messages) through IWorkflowOutboxMessagePublisherand records every delivery attempt; an unconfirmed message stays ready for an exact replay.

method PublishBatchAsync(CancellationToken) #

public Task<WorkflowOutboxBatchResult> PublishBatchAsync(CancellationToken cancellationToken = default)

Drains one batch of ready outbox messages.

Parameters

  • cancellationToken: Cancels the operation.

Returns

The counts.

class WorkflowOutboxDispatcherHostedService

public sealed class WorkflowOutboxDispatcherHostedService : BackgroundService

Runs WorkflowOutboxDispatchercontinuously: quickly while rows are ready, slowly when idle.

Members

MemberKindSummary
WorkflowOutboxDispatcherHostedService(WorkflowOutboxDispatcher, ILogger<WorkflowOutboxDispatcherHostedService>)constructorRuns WorkflowOutboxDispatchercontinuously: quickly while rows are ready, slowly when idle.

constructor WorkflowOutboxDispatcherHostedService(WorkflowOutboxDispatcher, ILogger<WorkflowOutboxDispatcherHostedService>) #

public WorkflowOutboxDispatcherHostedService(WorkflowOutboxDispatcher dispatcher, ILogger<WorkflowOutboxDispatcherHostedService> logger)

Runs WorkflowOutboxDispatchercontinuously: quickly while rows are ready, slowly when idle.

enum WorkflowRegisteredSignalDisposition

public enum WorkflowRegisteredSignalDisposition

How a raised signal was handled.

ValueDescription
CORRELATED = 0The signal resolved its wait.
ALREADY_RESOLVED = 1The wait was already resolved.
WAIT_NOT_READY = 2No wait is registered yet; the signal is kept for it.
RETRYABLE_FAILURE = 3The signal lost a race; it can be raised again.
REJECTED = 4The signal was refused.

class WorkflowRegisteredSignalOptions

public sealed class WorkflowRegisteredSignalOptions

The registered signals and the service audiences that may use them (WorkflowRegisteredSignals).

Members

MemberKindSummary
WorkflowRegisteredSignalOptions()constructorCreates an instance of WorkflowRegisteredSignalOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowRegisteredSignals.
ServiceSubjectspropertyMaps an authenticated service subject to the service audience it acts as.
SignalspropertyMaps a registered signal code to the only service audience that may wait for it and raise it.

constructor WorkflowRegisteredSignalOptions() #

public WorkflowRegisteredSignalOptions()

Creates an instance of WorkflowRegisteredSignalOptions.

constant SectionName #

public const string SectionName = "WorkflowRegisteredSignals"

The configuration section the options bind from: WorkflowRegisteredSignals.

property ServiceSubjects #

public Dictionary<string, string> ServiceSubjects { get; set; }

Maps an authenticated service subject to the service audience it acts as. Subjects compare ignoring case.

property Signals #

public Dictionary<string, string> Signals { get; set; }

Maps a registered signal code to the only service audience that may wait for it and raise it.

record WorkflowRegisteredSignalRaiseRequest

public sealed record WorkflowRegisteredSignalRaiseRequest

A signal raised for a registered wait.

Members

MemberKindSummary
WorkflowRegisteredSignalRaiseRequest()constructorCreates an instance of WorkflowRegisteredSignalRaiseRequest.
OccurredAtpropertyWhen the signal was raised.
PayloadJsonpropertyThe payload, as JSON.
PayloadSha256propertyThe SHA-256 of the payload.
SignalCodepropertyThe signal code.
SignalEventIdpropertyThe signal event.
SignalKeypropertyThe signal key.
SignalRegistrationIdpropertyThe wait, when the caller names one.
WorkflowExecutionIdpropertyThe execution.

constructor WorkflowRegisteredSignalRaiseRequest() #

public WorkflowRegisteredSignalRaiseRequest()

Creates an instance of WorkflowRegisteredSignalRaiseRequest.

property OccurredAt #

public required DateTimeOffset OccurredAt { get; init; }

When the signal was raised.

property PayloadJson #

public required string PayloadJson { get; init; }

The payload, as JSON.

property PayloadSha256 #

public required string PayloadSha256 { get; init; }

The SHA-256 of the payload.

property SignalCode #

public required string SignalCode { get; init; }

The signal code.

property SignalEventId #

public required string SignalEventId { get; init; }

The signal event.

property SignalKey #

public required string SignalKey { get; init; }

The signal key.

property SignalRegistrationId #

public string? SignalRegistrationId { get; init; }

The wait, when the caller names one.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution.

record WorkflowRegisteredSignalRaiseResponse

public sealed record WorkflowRegisteredSignalRaiseResponse

How a raised signal was handled.

Members

MemberKindSummary
WorkflowRegisteredSignalRaiseResponse()constructorCreates an instance of WorkflowRegisteredSignalRaiseResponse.
DispositionpropertyHow it was handled.
SafeCodepropertyThe safe code of a refusal or a lost race.
SignalEventIdpropertyThe signal event.
SignalRegistrationIdpropertyThe wait the signal reached.
WorkflowExecutionIdpropertyThe execution.

constructor WorkflowRegisteredSignalRaiseResponse() #

public WorkflowRegisteredSignalRaiseResponse()

Creates an instance of WorkflowRegisteredSignalRaiseResponse.

property Disposition #

public required WorkflowRegisteredSignalDisposition Disposition { get; init; }

How it was handled.

property SafeCode #

public string? SafeCode { get; init; }

The safe code of a refusal or a lost race.

property SignalEventId #

public required string SignalEventId { get; init; }

The signal event.

property SignalRegistrationId #

public string? SignalRegistrationId { get; init; }

The wait the signal reached.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution.

class WorkflowRegisteredSignalService

public sealed class WorkflowRegisteredSignalService

Registered signal waits: a step waits for a signal from a registered service audience until a deadline, and the signal or the deadline wins, whichever is recorded first.

Parameters

  • store: The registered signal store.
  • mutationCoordinator: Begins the change scopes.
  • options: The registered signals: each signal code with the service audience allowed to raise it.

Members

MemberKindSummary
WorkflowRegisteredSignalService(IWorkflowRegisteredSignalStore, IWorkflowMutationCoordinator, IOptions<WorkflowRegisteredSignalOptions>)constructorRegistered signal waits: a step waits for a signal from a registered service audience until a deadline, and the signal or the deadline wins, whichever is recorded first.
FireDeadlineAsync(string, DateTimeOffset, CancellationToken)methodFires a deadline timer: the deadline wins a wait that is still open, at the version the timer armed, once the time is due.
RaiseByIdAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken)methodRaises a signal for the wait the request’s registration id names; see WorkflowRegisteredSignalService.RaiseByKeyAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken).
RaiseByKeyAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken)methodRaises a signal for the wait of the execution, signal code and signal key.
RegisterWaitAsync(WorkflowRegisteredSignalWaitRequest, CancellationToken)methodRegisters a wait and arms its deadline timer.

constructor WorkflowRegisteredSignalService(IWorkflowRegisteredSignalStore, IWorkflowMutationCoordinator, IOptions<WorkflowRegisteredSignalOptions>) #

public WorkflowRegisteredSignalService(IWorkflowRegisteredSignalStore store, IWorkflowMutationCoordinator mutationCoordinator, IOptions<WorkflowRegisteredSignalOptions> options)

Registered signal waits: a step waits for a signal from a registered service audience until a deadline, and the signal or the deadline wins, whichever is recorded first.

Parameters

  • store: The registered signal store.
  • mutationCoordinator: Begins the change scopes.
  • options: The registered signals: each signal code with the service audience allowed to raise it.

method FireDeadlineAsync(string, DateTimeOffset, CancellationToken) #

public Task<WorkflowRegisteredSignalWaitResult> FireDeadlineAsync(string timerId, DateTimeOffset now, CancellationToken cancellationToken = default)

Fires a deadline timer: the deadline wins a wait that is still open, at the version the timer armed, once the time is due. A timer that lost is marked lost.

Parameters

  • timerId: The timer.
  • now: The current time.
  • cancellationToken: Cancels the operation.

Returns

The wait and its outcome.

Exceptions

  • KeyNotFoundException: The timer does not exist.

method RaiseByIdAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken) #

public Task<WorkflowRegisteredSignalRaiseResponse> RaiseByIdAsync(WorkflowRegisteredSignalRaiseRequest request, string? authenticatedServiceAudience, CancellationToken cancellationToken = default)

Raises a signal for the wait the request’s registration id names; see WorkflowRegisteredSignalService.RaiseByKeyAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken). A request without a registration id is rejected.

Parameters

  • request: The signal.
  • authenticatedServiceAudience: The service audience of the authenticated caller.
  • cancellationToken: Cancels the operation.

Returns

The disposition.

method RaiseByKeyAsync(WorkflowRegisteredSignalRaiseRequest, string, CancellationToken) #

public Task<WorkflowRegisteredSignalRaiseResponse> RaiseByKeyAsync(WorkflowRegisteredSignalRaiseRequest request, string? authenticatedServiceAudience, CancellationToken cancellationToken = default)

Raises a signal for the wait of the execution, signal code and signal key. The signal is rejected when it lacks an identity, its code is not registered, the caller’s audience is not the registered one, its payload is empty or over 65,536 characters, its time is not UTC or its payload hash does not match. With no wait yet, the signal is kept (WAIT_NOT_READY); a resolved wait gives ALREADY_RESOLVED; otherwise the signal wins the wait (CORRELATED). A signal event already received returns its recorded disposition.

Parameters

  • request: The signal.
  • authenticatedServiceAudience: The service audience of the authenticated caller.
  • cancellationToken: Cancels the operation.

Returns

The disposition.

method RegisterWaitAsync(WorkflowRegisteredSignalWaitRequest, CancellationToken) #

public Task<WorkflowRegisteredSignalWaitResult> RegisterWaitAsync(WorkflowRegisteredSignalWaitRequest request, CancellationToken cancellationToken = default)

Registers a wait and arms its deadline timer. A signal already received for the wait wins at once. A wait already registered under its id is returned as recorded.

Parameters

  • request: The wait.
  • cancellationToken: Cancels the operation.

Returns

The wait and its outcome.

Exceptions

  • ArgumentException: The expected version is below 1, the deadline is not a UTC time after the epoch, or the signal code and audience are not registered.
  • WorkflowExactReplayConflictException: A wait registered under the id differs.

record WorkflowRegisteredSignalWaitRequest

public sealed record WorkflowRegisteredSignalWaitRequest

A wait to register, with its deadline timer.

Members

MemberKindSummary
WorkflowRegisteredSignalWaitRequest()constructorCreates an instance of WorkflowRegisteredSignalWaitRequest.
DeadlineAtpropertyThe deadline.
ExpectedExecutionVersionpropertyThe execution version the wait is registered at.
ServiceAudiencepropertyThe service audience allowed to raise it.
SignalCodepropertyThe signal code.
SignalKeypropertyThe signal key.
SignalRegistrationIdpropertyThe wait.
TimerIdpropertyThe deadline timer.
WorkflowExecutionIdpropertyThe execution.

constructor WorkflowRegisteredSignalWaitRequest() #

public WorkflowRegisteredSignalWaitRequest()

Creates an instance of WorkflowRegisteredSignalWaitRequest.

property DeadlineAt #

public required DateTimeOffset DeadlineAt { get; init; }

The deadline.

property ExpectedExecutionVersion #

public required long ExpectedExecutionVersion { get; init; }

The execution version the wait is registered at.

property ServiceAudience #

public required string ServiceAudience { get; init; }

The service audience allowed to raise it.

property SignalCode #

public required string SignalCode { get; init; }

The signal code.

property SignalKey #

public required string SignalKey { get; init; }

The signal key.

property SignalRegistrationId #

public required string SignalRegistrationId { get; init; }

The wait.

property TimerId #

public required string TimerId { get; init; }

The deadline timer.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution.

record WorkflowRegisteredSignalWaitResult

public sealed record WorkflowRegisteredSignalWaitResult

The state of a registered wait.

Members

MemberKindSummary
WorkflowRegisteredSignalWaitResult()constructorCreates an instance of WorkflowRegisteredSignalWaitResult.
OutcomepropertyThe state of the wait.
PayloadJsonpropertyThe signal payload, as JSON.
PayloadSha256propertyThe SHA-256 of the signal payload.
SignalRegistrationIdpropertyThe wait.
WaitVersionpropertyThe wait version.
WinnerIdpropertyThe signal event or timer that resolved it.

constructor WorkflowRegisteredSignalWaitResult() #

public WorkflowRegisteredSignalWaitResult()

Creates an instance of WorkflowRegisteredSignalWaitResult.

property Outcome #

public required WorkflowRegisteredWaitOutcome Outcome { get; init; }

The state of the wait.

property PayloadJson #

public string? PayloadJson { get; init; }

The signal payload, as JSON.

property PayloadSha256 #

public string? PayloadSha256 { get; init; }

The SHA-256 of the signal payload.

property SignalRegistrationId #

public required string SignalRegistrationId { get; init; }

The wait.

property WaitVersion #

public required long WaitVersion { get; init; }

The wait version.

property WinnerId #

public string? WinnerId { get; init; }

The signal event or timer that resolved it.

enum WorkflowRegisteredWaitOutcome

public enum WorkflowRegisteredWaitOutcome

The state of a registered wait.

ValueDescription
WAITING = 0The wait is open.
SIGNAL_WON = 1A signal resolved the wait.
DEADLINE_WON = 2The deadline timer resolved the wait.

class WorkflowRootAlreadyStartedException

public sealed class WorkflowRootAlreadyStartedException : InvalidOperationException

Raised when an execution already has a durable root.

Parameters

  • workflowExecutionId: The execution.

Members

MemberKindSummary
WorkflowRootAlreadyStartedException(string)constructorRaised when an execution already has a durable root.
WorkflowExecutionIdpropertyThe execution.

constructor WorkflowRootAlreadyStartedException(string) #

public WorkflowRootAlreadyStartedException(string workflowExecutionId)

Raised when an execution already has a durable root.

Parameters

  • workflowExecutionId: The execution.

property WorkflowExecutionId #

public string WorkflowExecutionId { get; }

The execution.

class WorkflowRootContinuationMessageHandler

public sealed class WorkflowRootContinuationMessageHandler

Handles WorkflowDurableMessageTypes.RootContinuation.

Members

MemberKindSummary
WorkflowRootContinuationMessageHandler(IServiceScopeFactory, ILogger<WorkflowRootContinuationMessageHandler>)constructorHandles WorkflowDurableMessageTypes.RootContinuation.
HandleAsync(ReadOnlyMemory<byte>, string, CancellationToken)methodDecodes a root continuation and runs it.

constructor WorkflowRootContinuationMessageHandler(IServiceScopeFactory, ILogger<WorkflowRootContinuationMessageHandler>) #

public WorkflowRootContinuationMessageHandler(IServiceScopeFactory scopeFactory, ILogger<WorkflowRootContinuationMessageHandler> logger)

Handles WorkflowDurableMessageTypes.RootContinuation.

method HandleAsync(ReadOnlyMemory<byte>, string, CancellationToken) #

public Task<WorkflowDeliveryDisposition> HandleAsync(ReadOnlyMemory<byte> body, string? messageId, CancellationToken cancellationToken)

Decodes a root continuation and runs it.

Parameters

  • body: The message body.
  • messageId: The transport message id, for the log.
  • cancellationToken: Cancels the operation.

Returns

Applied or AlreadyApplied; WaitNotReady when the start is not ready yet; Rejected on a replay conflict; RetryableFailure on a version conflict; Poison when the body does not decode or validate.

record WorkflowRootContinuationV1

public sealed record WorkflowRootContinuationV1 : IContractValidatable

Continues a durable root after its start committed.

Parameters

  • StartRequestId: The start request.
  • WorkflowExecutionId: The execution.
  • RootScopeExecutionId: The root scope.
  • ExpectedExecutionVersion: The execution version the continuation expects.

Members

MemberKindSummary
WorkflowRootContinuationV1(string, string, string, long)constructorContinues a durable root after its start committed.
ExpectedExecutionVersionpropertyThe execution version the continuation expects.
RootScopeExecutionIdpropertyThe root scope.
StartRequestIdpropertyThe start request.
WorkflowExecutionIdpropertyThe execution.
Validate()methodChecks the fields.

constructor WorkflowRootContinuationV1(string, string, string, long) #

public WorkflowRootContinuationV1(string StartRequestId, string WorkflowExecutionId, string RootScopeExecutionId, long ExpectedExecutionVersion)

Continues a durable root after its start committed.

Parameters

  • StartRequestId: The start request.
  • WorkflowExecutionId: The execution.
  • RootScopeExecutionId: The root scope.
  • ExpectedExecutionVersion: The execution version the continuation expects.

property ExpectedExecutionVersion #

public long ExpectedExecutionVersion { get; init; }

The execution version the continuation expects.

property RootScopeExecutionId #

public string RootScopeExecutionId { get; init; }

The root scope.

property StartRequestId #

public string StartRequestId { get; init; }

The start request.

property WorkflowExecutionId #

public string WorkflowExecutionId { get; init; }

The execution.

method Validate() #

public void Validate()

Checks the fields.

Exceptions

class WorkflowServiceAudienceResolver

public sealed class WorkflowServiceAudienceResolver : IWorkflowServiceAudienceResolver

Maps subjects to audiences with ServiceSubjects of the registered signal options.

Parameters

  • options: The registered signal options.

Members

MemberKindSummary
WorkflowServiceAudienceResolver(IOptions<WorkflowRegisteredSignalOptions>)constructorMaps subjects to audiences with ServiceSubjects of the registered signal options.
ResolveAudience(string)methodReturns the audience of a subject.

constructor WorkflowServiceAudienceResolver(IOptions<WorkflowRegisteredSignalOptions>) #

public WorkflowServiceAudienceResolver(IOptions<WorkflowRegisteredSignalOptions> options)

Maps subjects to audiences with ServiceSubjects of the registered signal options.

Parameters

  • options: The registered signal options.

method ResolveAudience(string) #

public string? ResolveAudience(string? authenticatedSubject)

Returns the audience of a subject.

Parameters

  • authenticatedSubject: The authenticated subject.

Returns

The audience, or null when the subject has none.

record WorkflowStartAdmissionDecision

public sealed record WorkflowStartAdmissionDecision

The admission decision on a durable start.

Parameters

  • Disposition: The decision.
  • SafeCode: The safe code of a refusal or a delay.

Members

MemberKindSummary
WorkflowStartAdmissionDecision(WorkflowStartAdmissionDisposition, string)constructorThe admission decision on a durable start.
DispositionpropertyThe decision.
ReadypropertyThe decision that the start may run.
SafeCodepropertyThe safe code of a refusal or a delay.

constructor WorkflowStartAdmissionDecision(WorkflowStartAdmissionDisposition, string) #

public WorkflowStartAdmissionDecision(WorkflowStartAdmissionDisposition Disposition, string? SafeCode = null)

The admission decision on a durable start.

Parameters

  • Disposition: The decision.
  • SafeCode: The safe code of a refusal or a delay.

property Disposition #

public WorkflowStartAdmissionDisposition Disposition { get; init; }

The decision.

property Ready #

public static WorkflowStartAdmissionDecision Ready { get; }

The decision that the start may run.

property SafeCode #

public string? SafeCode { get; init; }

The safe code of a refusal or a delay.

enum WorkflowStartAdmissionDisposition

public enum WorkflowStartAdmissionDisposition

Whether a durable start may run now.

ValueDescription
Ready = 0The start may run.
TransientNotReady = 1The start cannot run yet; retry later.
PermanentReject = 2The start is refused.

class WorkflowStartExecutionMessageHandler

public sealed class WorkflowStartExecutionMessageHandler

Handles WorkflowDurableMessageTypes.StartExecution.

Members

MemberKindSummary
WorkflowStartExecutionMessageHandler(IServiceScopeFactory)constructorHandles WorkflowDurableMessageTypes.StartExecution.
HandleAsync(ReadOnlyMemory<byte>, CancellationToken)methodDecodes a start message and runs the start.

constructor WorkflowStartExecutionMessageHandler(IServiceScopeFactory) #

public WorkflowStartExecutionMessageHandler(IServiceScopeFactory scopeFactory)

Handles WorkflowDurableMessageTypes.StartExecution.

method HandleAsync(ReadOnlyMemory<byte>, CancellationToken) #

public Task<WorkflowDeliveryDisposition> HandleAsync(ReadOnlyMemory<byte> body, CancellationToken cancellationToken)

Decodes a start message and runs the start.

Parameters

  • body: The message body.
  • cancellationToken: Cancels the operation.

Returns

TerminalHandoffCommitted when the start ran; WaitNotReady when it is not ready yet; Rejected on a replay conflict; Poison when the body does not decode or validate.

class WorkflowStartNotReadyException

public sealed class WorkflowStartNotReadyException : InvalidOperationException

Raised when a durable start cannot run yet; the start is retried.

Parameters

  • safeCode: The safe code.

Members

MemberKindSummary
WorkflowStartNotReadyException(string)constructorRaised when a durable start cannot run yet; the start is retried.
SafeCodepropertyThe safe code.

constructor WorkflowStartNotReadyException(string) #

public WorkflowStartNotReadyException(string safeCode)

Raised when a durable start cannot run yet; the start is retried.

Parameters

  • safeCode: The safe code.

property SafeCode #

public string SafeCode { get; }

The safe code.

namespace StellaOps.Workflow.Engine.Exceptions

TypeKindDescription
WorkflowEngineErrorrecordA business error of the engine.
WorkflowEngineErrorsclassCreates the engine’s business errors.
WorkflowEngineExceptionclassThe engine’s business-result exception: a message key, optional interpolation arguments and a status code.

record WorkflowEngineError

public sealed record WorkflowEngineError

A business error of the engine.

Parameters

  • Code: The HTTP status.
  • MessageId: The message id; see MessageKeys.
  • Arguments: The interpolation arguments.
  • InnerException: The cause, when there is one.

Members

MemberKindSummary
WorkflowEngineError(int, string, object[], Exception)constructorA business error of the engine.
ArgumentspropertyThe interpolation arguments.
CodepropertyThe HTTP status.
InnerExceptionpropertyThe cause, when there is one.
MessageIdpropertyThe message id; see MessageKeys.

constructor WorkflowEngineError(int, string, object[], Exception) #

public WorkflowEngineError(int Code, string MessageId, object[] Arguments, Exception? InnerException)

A business error of the engine.

Parameters

  • Code: The HTTP status.
  • MessageId: The message id; see MessageKeys.
  • Arguments: The interpolation arguments.
  • InnerException: The cause, when there is one.

property Arguments #

public object[] Arguments { get; init; }

The interpolation arguments.

property Code #

public int Code { get; init; }

The HTTP status.

property InnerException #

public Exception? InnerException { get; init; }

The cause, when there is one.

property MessageId #

public string MessageId { get; init; }

The message id; see MessageKeys.

class WorkflowEngineErrors

public static class WorkflowEngineErrors

Creates the engine’s business errors. A host whose error pipeline expects its own exception type installs WorkflowEngineErrors.Factoryonce at startup; the default creates WorkflowEngineException.

Members

MemberKindSummary
DefaultCodeconstantThe default HTTP status: 400.
FactorypropertyCreates the exception of an error; WorkflowEngineErrors.DefaultFactory(WorkflowEngineError)by default.
Create(Exception, string, params object[])methodCreates the exception of an error with status 400.
Create(int, string, params object[])methodCreates the exception of an error.
Create(string, params object[])methodCreates the exception of an error with status 400.
DefaultFactory(WorkflowEngineError)methodCreates a WorkflowEngineException.

constant DefaultCode #

public const int DefaultCode = 400

The default HTTP status: 400.

property Factory #

public static Func<WorkflowEngineError, Exception> Factory { get; set; }

Creates the exception of an error; WorkflowEngineErrors.DefaultFactory(WorkflowEngineError)by default.

method Create(Exception, string, params object[]) #

public static Exception Create(Exception innerException, string messageId, params object[] args)

Creates the exception of an error with status 400.

Parameters

  • innerException: The cause.
  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

Returns

The exception to throw.

method Create(int, string, params object[]) #

public static Exception Create(int code, string messageId, params object[] args)

Creates the exception of an error.

Parameters

  • code: The HTTP status.
  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

Returns

The exception to throw.

method Create(string, params object[]) #

public static Exception Create(string messageId, params object[] args)

Creates the exception of an error with status 400.

Parameters

  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

Returns

The exception to throw.

method DefaultFactory(WorkflowEngineError) #

public static Exception DefaultFactory(WorkflowEngineError error)

Creates a WorkflowEngineException.

Parameters

  • error: The error.

Returns

The exception.

class WorkflowEngineException

public class WorkflowEngineException : Exception

The engine’s business-result exception: a message key, optional interpolation arguments and a status code. The engine raises it through WorkflowEngineErrors, so a host can substitute its own type.

Members

MemberKindSummary
WorkflowEngineException(Exception, string)constructorCreates the exception with status 400.
WorkflowEngineException(Exception, string, params object[])constructorCreates the exception with status 400.
WorkflowEngineException(int, string)constructorCreates the exception.
WorkflowEngineException(int, string, params object[])constructorCreates the exception.
WorkflowEngineException(string)constructorCreates the exception with status 400.
WorkflowEngineException(string, params object[])constructorCreates the exception with status 400.
CodepropertyThe HTTP status the endpoints answer with; 400 by default.
MessageIdpropertyThe message id.
MessageInterpolationArgumentspropertyThe interpolation arguments of the message.

constructor WorkflowEngineException(Exception, string) #

public WorkflowEngineException(Exception innerException, string messageId)

Creates the exception with status 400.

Parameters

  • innerException: The cause.
  • messageId: The message id; see MessageKeys.

constructor WorkflowEngineException(Exception, string, params object[]) #

public WorkflowEngineException(Exception innerException, string messageId, params object[] args)

Creates the exception with status 400.

Parameters

  • innerException: The cause.
  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

constructor WorkflowEngineException(int, string) #

public WorkflowEngineException(int code, string messageId)

Creates the exception.

Parameters

  • code: The HTTP status.
  • messageId: The message id; see MessageKeys.

constructor WorkflowEngineException(int, string, params object[]) #

public WorkflowEngineException(int code, string messageId, params object[] args)

Creates the exception.

Parameters

  • code: The HTTP status.
  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

constructor WorkflowEngineException(string) #

public WorkflowEngineException(string messageId)

Creates the exception with status 400.

Parameters

constructor WorkflowEngineException(string, params object[]) #

public WorkflowEngineException(string messageId, params object[] args)

Creates the exception with status 400.

Parameters

  • messageId: The message id; see MessageKeys.
  • args: The interpolation arguments.

property Code #

public int Code { get; set; }

The HTTP status the endpoints answer with; 400 by default.

property MessageId #

public string MessageId { get; set; }

The message id.

property MessageInterpolationArguments #

public IReadOnlyList<object?> MessageInterpolationArguments { get; set; }

The interpolation arguments of the message.

namespace StellaOps.Workflow.Engine.Execution

TypeKindDescription
CanonicalWorkflowExecutionHandlerclassRuns a workflow from its canonical runtime definition: starts, task completions, signal resumes and map items.
ConfiguredWorkflowRuntimeOrchestratorclassSends starts and task completions to the configured default runtime provider (Stella.Engine when not set), and resumes to the provider that holds the instance.
WorkflowEngineRuntimeProviderclassThe Stella.Engine runtime: runs a definition through its execution handler and records the runtime state as an engine snapshot.

class CanonicalWorkflowExecutionHandler

public sealed class CanonicalWorkflowExecutionHandler : IWorkflowExecutionHandler, IWorkflowSignalResumableExecutionHandler, IWorkflowMapItemExecutionHandler

Runs a workflow from its canonical runtime definition: starts, task completions, signal resumes and map items.

Parameters

  • runtimeDefinition: The runtime definition.
  • endpointTransport: The endpoint transport.
  • rabbitTransport: The RabbitMQ transport.
  • graphqlTransport: The GraphQL transport.
  • httpTransport: The HTTP transport.
  • workflowFunctionRuntime: Evaluates the expression functions.
  • workflowRegistrationCatalog: The registered workflows, for child workflows.
  • workflowRuntimeDefinitionStore: The runtime definitions, for child and parent workflows.
  • workflowRuntimeExecutionHandlerFactory: Creates the handlers of child and parent workflows.

Members

MemberKindSummary
CanonicalWorkflowExecutionHandler(WorkflowRuntimeDefinition, IWorkflowEndpointTransport, IWorkflowRabbitTransport, IWorkflowGraphqlTransport, IWorkflowHttpTransport, IWorkflowFunctionRuntime, IWorkflowRegistrationCatalog, IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory)constructorRuns a workflow from its canonical runtime definition: starts, task completions, signal resumes and map items.
CompleteTaskAsync(WorkflowTaskExecutionContext, CancellationToken)methodPlans the completion of a task.
ExecuteMapItemAsync(WorkflowMapItemExecutionRequest, CancellationToken)methodRuns the item until it waits or ends.
StartAsync(WorkflowStartExecutionContext, CancellationToken)methodPlans the start of an instance.

constructor CanonicalWorkflowExecutionHandler(WorkflowRuntimeDefinition, IWorkflowEndpointTransport, IWorkflowRabbitTransport, IWorkflowGraphqlTransport, IWorkflowHttpTransport, IWorkflowFunctionRuntime, IWorkflowRegistrationCatalog, IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory) #

public CanonicalWorkflowExecutionHandler(WorkflowRuntimeDefinition runtimeDefinition, IWorkflowEndpointTransport endpointTransport, IWorkflowRabbitTransport rabbitTransport, IWorkflowGraphqlTransport graphqlTransport, IWorkflowHttpTransport httpTransport, IWorkflowFunctionRuntime workflowFunctionRuntime, IWorkflowRegistrationCatalog workflowRegistrationCatalog, IWorkflowRuntimeDefinitionStore workflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory workflowRuntimeExecutionHandlerFactory)

Runs a workflow from its canonical runtime definition: starts, task completions, signal resumes and map items.

Parameters

  • runtimeDefinition: The runtime definition.
  • endpointTransport: The endpoint transport.
  • rabbitTransport: The RabbitMQ transport.
  • graphqlTransport: The GraphQL transport.
  • httpTransport: The HTTP transport.
  • workflowFunctionRuntime: Evaluates the expression functions.
  • workflowRegistrationCatalog: The registered workflows, for child workflows.
  • workflowRuntimeDefinitionStore: The runtime definitions, for child and parent workflows.
  • workflowRuntimeExecutionHandlerFactory: Creates the handlers of child and parent workflows.

method CompleteTaskAsync(WorkflowTaskExecutionContext, CancellationToken) #

public Task<WorkflowTaskCompletionPlan> CompleteTaskAsync(WorkflowTaskExecutionContext context, CancellationToken cancellationToken = default)

Plans the completion of a task.

Parameters

  • context: The task context.
  • cancellationToken: Cancels the operation.

Returns

The plan.

method ExecuteMapItemAsync(WorkflowMapItemExecutionRequest, CancellationToken) #

public Task<WorkflowMapItemExecutionDecision> ExecuteMapItemAsync(WorkflowMapItemExecutionRequest request, CancellationToken cancellationToken = default)

Runs the item until it waits or ends.

Parameters

  • request: The item.
  • cancellationToken: Cancels the operation.

Returns

What happens next.

method StartAsync(WorkflowStartExecutionContext, CancellationToken) #

public Task<WorkflowStartExecutionPlan> StartAsync(WorkflowStartExecutionContext context, CancellationToken cancellationToken = default)

Plans the start of an instance.

Parameters

  • context: The start context.
  • cancellationToken: Cancels the operation.

Returns

The plan.

class ConfiguredWorkflowRuntimeOrchestrator

public sealed class ConfiguredWorkflowRuntimeOrchestrator : IWorkflowRuntimeOrchestrator

Sends starts and task completions to the configured default runtime provider (Stella.Engine when not set), and resumes to the provider that holds the instance. A provider must be registered and, when the enabled list is not empty, enabled.

Parameters

  • runtimeProviders: The registered providers; names compare ignoring case, and for a repeated name the last one wins.
  • runtimeOptions: The runtime options: the default provider and the enabled providers.

Members

MemberKindSummary
ConfiguredWorkflowRuntimeOrchestrator(IEnumerable<IWorkflowRuntimeProvider>, IOptions<WorkflowRuntimeOptions>)constructorSends starts and task completions to the configured default runtime provider (Stella.Engine when not set), and resumes to the provider that holds the instance.
CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken)methodCompletes a task.
ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken)methodResumes an instance with a signal.
StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken)methodStarts an instance.

constructor ConfiguredWorkflowRuntimeOrchestrator(IEnumerable<IWorkflowRuntimeProvider>, IOptions<WorkflowRuntimeOptions>) #

public ConfiguredWorkflowRuntimeOrchestrator(IEnumerable<IWorkflowRuntimeProvider> runtimeProviders, IOptions<WorkflowRuntimeOptions> runtimeOptions)

Sends starts and task completions to the configured default runtime provider (Stella.Engine when not set), and resumes to the provider that holds the instance. A provider must be registered and, when the enabled list is not empty, enabled.

Parameters

  • runtimeProviders: The registered providers; names compare ignoring case, and for a repeated name the last one wins.
  • runtimeOptions: The runtime options: the default provider and the enabled providers.

method CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> CompleteAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowTaskExecutionContext context, CancellationToken cancellationToken = default)

Completes a task.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The task context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> ResumeAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowSignalExecutionContext context, CancellationToken cancellationToken = default)

Resumes an instance with a signal.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The signal context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> StartAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowBusinessReference? businessReference, StartWorkflowRequest request, object startRequest, CancellationToken cancellationToken = default)

Starts an instance.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • businessReference: The business reference.
  • request: The start request.
  • startRequest: The typed start request.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

class WorkflowEngineRuntimeProvider

public sealed class WorkflowEngineRuntimeProvider : IWorkflowRuntimeProvider

The Stella.Engine runtime: runs a definition through its execution handler and records the runtime state as an engine snapshot.

Parameters

  • workflowRuntimeDefinitionStore: The runtime definitions.
  • workflowRuntimeExecutionHandlerFactory: Creates the execution handlers.

Members

MemberKindSummary
WorkflowEngineRuntimeProvider(IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory)constructorThe Stella.Engine runtime: runs a definition through its execution handler and records the runtime state as an engine snapshot.
ProviderNamepropertyThe provider name.
CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken)methodCompletes a task.
ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken)methodResumes an instance with a signal.
StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken)methodStarts an instance.

constructor WorkflowEngineRuntimeProvider(IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory) #

public WorkflowEngineRuntimeProvider(IWorkflowRuntimeDefinitionStore workflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory workflowRuntimeExecutionHandlerFactory)

The Stella.Engine runtime: runs a definition through its execution handler and records the runtime state as an engine snapshot.

Parameters

  • workflowRuntimeDefinitionStore: The runtime definitions.
  • workflowRuntimeExecutionHandlerFactory: Creates the execution handlers.

property ProviderName #

public string ProviderName { get; }

The provider name.

method CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> CompleteAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowTaskExecutionContext context, CancellationToken cancellationToken = default)

Completes a task.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The task context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> ResumeAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowSignalExecutionContext context, CancellationToken cancellationToken = default)

Resumes an instance with a signal.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The signal context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> StartAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowBusinessReference? businessReference, StartWorkflowRequest request, object startRequest, CancellationToken cancellationToken = default)

Starts an instance.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • businessReference: The business reference.
  • request: The start request.
  • startRequest: The typed start request.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

namespace StellaOps.Workflow.Engine.ExternalActivities

TypeKindDescription
ConstantsClassclassThe states, dispositions, event types and stop values of external activities.
WorkflowActivityCancelOutboxMessagerecordA cancel request to publish on a cancel lane.
WorkflowActivityControlServiceclassControls external activity steps: classifies failures for retry, retries steps, records continuations, reprocesses scopes, stops activities and publishes their cancel messages.
WorkflowActivityFailureRequestrecordA failed attempt to decide a retry for.
WorkflowActivityReprocessScopeRequestrecordAn operator request to run a scope again.
WorkflowActivityReprocessScopeResultrecordThe new occurrence of a reprocessed scope.
WorkflowActivityRetryDecisionrecordWhether and when a failed step is retried.
WorkflowActivityRetryStepRequestrecordAn operator request to retry a step now.
WorkflowActivityStopRequestrecordA request to stop the activities of a target: a cancel or a deadline.
WorkflowActivityStopResultrecordThe outcome of a stop.
WorkflowContinuationRegistrationRequestrecordA continuation an attempt reported, to register for the next attempt.
WorkflowExternalActivityCompletionDecisionrecordThe outcome of a completion: the delivery disposition, and the signal that resumes the waiting step when there is one.
WorkflowExternalActivityCompletionRequestrecordA completion received on the completed lane.
WorkflowExternalActivityCompletionResultrecordHow a completion was handled.
WorkflowExternalActivityCompletionServiceclassRecords a completion from the completed lane and, when the step can resume, builds the signal that resumes it, with the result (or the outcome and the failure) as payload.
WorkflowExternalActivityContractKindsclassThe contract kinds of external activities.
WorkflowExternalActivityDispatchRequestrecordAn attempt to dispatch.
WorkflowExternalActivityDispatchResultrecordA recorded dispatch.
WorkflowExternalActivityDispatchServiceclassTurns an external activity wait into a durable dispatch; the step’s evaluated request travels inline.
WorkflowExternalActivityLanesclassThe default lanes of external activities.
WorkflowExternalActivityOutboxMessagerecordA request to publish on an execute lane.
WorkflowExternalActivityRegistryclassThe external activity registry of the host’s signed manifest.
WorkflowExternalActivityRegistryEntryrecordAn external activity of the manifest.
WorkflowExternalActivityRegistryExceptionclassRaised when the registry manifest cannot be loaded.
WorkflowExternalActivityRegistryHealthCheckclassHealthy once the signed external activity registry is verified; unhealthy, with the readiness failure code, until then.
WorkflowExternalActivityRegistryManifestrecordThe signed registry manifest of a host.
WorkflowExternalActivityRegistryOptionsclassThe signed manifest of the external activities the host may run (WorkflowExternalActivityRegistry).
WorkflowExternalActivityServiceclassRecords external activity dispatches and completions once, with their outbox entries.
WorkflowExternalActivitySignalDispatcherclassDispatches an external activity step durably (DurableDispatch pending signal).

class ConstantsClass

public static class ConstantsClass

The states, dispositions, event types and stop values of external activities.

Members

MemberKindSummary
AttemptAppliedconstantAttempt: its completion was applied.
AttemptCanceledconstantAttempt: canceled.
AttemptDeadlineLostconstantAttempt: its deadline passed first.
AttemptDispatchedconstantAttempt: dispatched, waiting for its completion.
AttemptFailedconstantAttempt: failed.
CancelPublishedconstantCancel: sent.
CancelReadyconstantCancel: waiting in the outbox.
CompletionAppliedconstantCompletion: applied.
CompletionCanceledconstantCompletion: arrived after a cancel.
CompletionDeadlineLostconstantCompletion: arrived after the deadline.
CompletionDuplicateconstantCompletion: a duplicate of one already applied.
CompletionLateconstantCompletion: arrived after the attempt ended.
CompletionReconciliationconstantCompletion: kept for reconciliation.
CompletionRejectedconstantCompletion: refused.
ContinuationConsumedconstantContinuation: resumed by an attempt.
ContinuationReadyconstantContinuation: waiting for the next attempt.
ContinuationRevokedconstantContinuation: revoked by a cancel.
DispatchPublishedconstantDispatch: sent.
DispatchReadyconstantDispatch: waiting in the outbox.
DispatchRevokedconstantDispatch: revoked before it was sent.
EventActivityCanceledconstantHistory event: an activity was canceled.
EventActivityCompletedconstantHistory event: an activity completed.
EventActivityDeadlineWonconstantHistory event: the deadline ended an activity first.
EventActivityDispatchedconstantHistory event: an activity was dispatched.
EventActivityFailedconstantHistory event: an activity failed.
FailureActivityDeadlineconstantFailure category of an activity that reached its deadline.
ReprocessRequestedconstantScope reprocess: requested.
StepCanceledconstantStep: canceled.
StepCompletedconstantStep: completed.
StepDeadlineFailureconstantStep: failed at its deadline; cleanup is pending.
StepDeadlinePendingReconciliationconstantStep: its deadline passed; reconciliation is pending.
StepRetryExhaustedconstantStep: no retry is left.
StepRetryPendingconstantStep: a retry is pending.
StepWaitingconstantStep: waiting for its attempt.
StopModeCancelconstantStop mode: a cancel.
StopModeDeadlineconstantStop mode: a deadline.
StopTargetExecutionconstantStop target: a whole execution.
StopTargetMapconstantStop target: a map.
StopTargetScopeconstantStop target: a scope.
StopTargetStepconstantStop target: one step.

constant AttemptApplied #

public const string AttemptApplied = "APPLIED"

Attempt: its completion was applied.

constant AttemptCanceled #

public const string AttemptCanceled = "CANCELED"

Attempt: canceled.

constant AttemptDeadlineLost #

public const string AttemptDeadlineLost = "DEADLINE_LOST"

Attempt: its deadline passed first.

constant AttemptDispatched #

public const string AttemptDispatched = "DISPATCHED"

Attempt: dispatched, waiting for its completion.

constant AttemptFailed #

public const string AttemptFailed = "FAILED"

Attempt: failed.

constant CancelPublished #

public const string CancelPublished = "PUBLISHED"

Cancel: sent.

constant CancelReady #

public const string CancelReady = "READY"

Cancel: waiting in the outbox.

constant CompletionApplied #

public const string CompletionApplied = "APPLIED"

Completion: applied.

constant CompletionCanceled #

public const string CompletionCanceled = "CANCELED"

Completion: arrived after a cancel.

constant CompletionDeadlineLost #

public const string CompletionDeadlineLost = "DEADLINE_LOST"

Completion: arrived after the deadline.

constant CompletionDuplicate #

public const string CompletionDuplicate = "DUPLICATE"

Completion: a duplicate of one already applied.

constant CompletionLate #

public const string CompletionLate = "LATE"

Completion: arrived after the attempt ended.

constant CompletionReconciliation #

public const string CompletionReconciliation = "RECONCILING"

Completion: kept for reconciliation.

constant CompletionRejected #

public const string CompletionRejected = "REJECTED"

Completion: refused.

constant ContinuationConsumed #

public const string ContinuationConsumed = "CONSUMED"

Continuation: resumed by an attempt.

constant ContinuationReady #

public const string ContinuationReady = "READY"

Continuation: waiting for the next attempt.

constant ContinuationRevoked #

public const string ContinuationRevoked = "REVOKED"

Continuation: revoked by a cancel.

constant DispatchPublished #

public const string DispatchPublished = "PUBLISHED"

Dispatch: sent.

constant DispatchReady #

public const string DispatchReady = "READY"

Dispatch: waiting in the outbox.

constant DispatchRevoked #

public const string DispatchRevoked = "REVOKED"

Dispatch: revoked before it was sent.

constant EventActivityCanceled #

public const string EventActivityCanceled = "EXTERNAL_ACTIVITY_CANCELED"

History event: an activity was canceled.

constant EventActivityCompleted #

public const string EventActivityCompleted = "EXTERNAL_ACTIVITY_COMPLETED"

History event: an activity completed.

constant EventActivityDeadlineWon #

public const string EventActivityDeadlineWon = "EXTERNAL_ACTIVITY_DEADLINE_WON"

History event: the deadline ended an activity first.

constant EventActivityDispatched #

public const string EventActivityDispatched = "EXTERNAL_ACTIVITY_DISPATCHED"

History event: an activity was dispatched.

constant EventActivityFailed #

public const string EventActivityFailed = "EXTERNAL_ACTIVITY_FAILED"

History event: an activity failed.

constant FailureActivityDeadline #

public const string FailureActivityDeadline = "ACTIVITY_DEADLINE"

Failure category of an activity that reached its deadline.

constant ReprocessRequested #

public const string ReprocessRequested = "REQUESTED"

Scope reprocess: requested.

constant StepCanceled #

public const string StepCanceled = "CANCELED"

Step: canceled.

constant StepCompleted #

public const string StepCompleted = "COMPLETED"

Step: completed.

constant StepDeadlineFailure #

public const string StepDeadlineFailure = "TECHNICAL_FAILURE_CLEANUP_PENDING"

Step: failed at its deadline; cleanup is pending.

constant StepDeadlinePendingReconciliation #

public const string StepDeadlinePendingReconciliation = "DEADLINE_PENDING_RECONCILIATION"

Step: its deadline passed; reconciliation is pending.

constant StepRetryExhausted #

public const string StepRetryExhausted = "RETRY_EXHAUSTED"

Step: no retry is left.

constant StepRetryPending #

public const string StepRetryPending = "RETRY_PENDING"

Step: a retry is pending.

constant StepWaiting #

public const string StepWaiting = "WAITING"

Step: waiting for its attempt.

constant StopModeCancel #

public const string StopModeCancel = "CANCEL"

Stop mode: a cancel.

constant StopModeDeadline #

public const string StopModeDeadline = "DEADLINE"

Stop mode: a deadline.

constant StopTargetExecution #

public const string StopTargetExecution = "EXECUTION"

Stop target: a whole execution.

constant StopTargetMap #

public const string StopTargetMap = "MAP"

Stop target: a map.

constant StopTargetScope #

public const string StopTargetScope = "SCOPE"

Stop target: a scope.

constant StopTargetStep #

public const string StopTargetStep = "STEP"

Stop target: one step.

record WorkflowActivityCancelOutboxMessage

public sealed record WorkflowActivityCancelOutboxMessage

A cancel request to publish on a cancel lane.

Members

MemberKindSummary
WorkflowActivityCancelOutboxMessage()constructorCreates an instance of WorkflowActivityCancelOutboxMessage.
AttemptIdpropertyThe attempt.
CancelFenceVersionpropertyThe cancel fence of the request.
CancelIdpropertyThe cancel request.
CancelLanepropertyThe lane the cancel goes to.
CanonicalPayloadJsonpropertyThe canonical payload, as JSON.
EventIdpropertyThe cancel event.
PayloadSha256propertyThe SHA-256 of the payload.

constructor WorkflowActivityCancelOutboxMessage() #

public WorkflowActivityCancelOutboxMessage()

Creates an instance of WorkflowActivityCancelOutboxMessage.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property CancelFenceVersion #

public required long CancelFenceVersion { get; init; }

The cancel fence of the request.

property CancelId #

public required string CancelId { get; init; }

The cancel request.

property CancelLane #

public required string CancelLane { get; init; }

The lane the cancel goes to.

property CanonicalPayloadJson #

public required string CanonicalPayloadJson { get; init; }

The canonical payload, as JSON.

property EventId #

public required string EventId { get; init; }

The cancel event.

property PayloadSha256 #

public required string PayloadSha256 { get; init; }

The SHA-256 of the payload.

class WorkflowActivityControlService

public sealed class WorkflowActivityControlService

Controls external activity steps: classifies failures for retry, retries steps, records continuations, reprocesses scopes, stops activities and publishes their cancel messages.

Parameters

  • store: The external activity store.
  • mutationCoordinator: Begins the change scopes.
  • registry: The external activity registry; it names the cancel lanes.
  • timeProvider: The clock.

Members

MemberKindSummary
WorkflowActivityControlService(IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, IWorkflowExternalActivityRegistry, TimeProvider)constructorControls external activity steps: classifies failures for retry, retries steps, records continuations, reprocesses scopes, stops activities and publishes their cancel messages.
ClassifyFailureAsync(WorkflowActivityFailureRequest, CancellationToken)methodRecords a step failure and decides on a retry: the step waits for a retry after the policy’s delay, or its retries are exhausted when no attempt is left, the category is not retryable or the absolute deadline has passed.
GetReadyCancelsAsync(int, CancellationToken)methodReturns the cancel messages ready to publish.
MarkCancelPublishedAsync(string, DateTimeOffset, CancellationToken)methodMarks a cancel message published.
RegisterContinuationAsync(WorkflowContinuationRegistrationRequest, CancellationToken)methodRecords the continuation of an attempt, for the next attempt.
ReprocessScopeAsync(WorkflowActivityReprocessScopeRequest, CancellationToken)methodRecords a request to reprocess a scope.
RetryStepAsync(WorkflowActivityRetryStepRequest, CancellationToken)methodDispatches the next attempt of a step that waits for a retry, once its delay has passed; marks the retries exhausted when no attempt is left.
StopAsync(WorkflowActivityStopRequest, CancellationToken)methodStops the activities of a target in one change scope: open steps are canceled, or fail with a deadline in deadline mode; their ready dispatches are revoked and cancel messages are queued.

constructor WorkflowActivityControlService(IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, IWorkflowExternalActivityRegistry, TimeProvider) #

public WorkflowActivityControlService(IWorkflowExternalActivityStore store, IWorkflowMutationCoordinator mutationCoordinator, IWorkflowExternalActivityRegistry registry, TimeProvider timeProvider)

Controls external activity steps: classifies failures for retry, retries steps, records continuations, reprocesses scopes, stops activities and publishes their cancel messages.

Parameters

  • store: The external activity store.
  • mutationCoordinator: Begins the change scopes.
  • registry: The external activity registry; it names the cancel lanes.
  • timeProvider: The clock.

method ClassifyFailureAsync(WorkflowActivityFailureRequest, CancellationToken) #

public Task<WorkflowActivityRetryDecision> ClassifyFailureAsync(WorkflowActivityFailureRequest request, CancellationToken cancellationToken = default)

Records a step failure and decides on a retry: the step waits for a retry after the policy’s delay, or its retries are exhausted when no attempt is left, the category is not retryable or the absolute deadline has passed.

Parameters

  • request: The failure.
  • cancellationToken: Cancels the operation.

Returns

The retry decision.

method GetReadyCancelsAsync(int, CancellationToken) #

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

Returns the cancel messages ready to publish.

Parameters

  • maxCount: The most messages to return, from 1 to 1,000.
  • cancellationToken: Cancels the operation.

Returns

The messages.

Exceptions

  • ArgumentOutOfRangeException: The count is outside 1 to 1,000.

method MarkCancelPublishedAsync(string, DateTimeOffset, CancellationToken) #

public Task MarkCancelPublishedAsync(string cancelId, DateTimeOffset publishedAt, CancellationToken cancellationToken = default)

Marks a cancel message published.

Parameters

  • cancelId: The cancel message.
  • publishedAt: When it was published.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the message is marked.

method RegisterContinuationAsync(WorkflowContinuationRegistrationRequest, CancellationToken) #

public Task<WorkflowContinuationLineage> RegisterContinuationAsync(WorkflowContinuationRegistrationRequest request, CancellationToken cancellationToken = default)

Records the continuation of an attempt, for the next attempt. A continuation already recorded under its lineage id is returned when its hash matches.

Parameters

  • request: The continuation.
  • cancellationToken: Cancels the operation.

Returns

The continuation lineage.

Exceptions

  • ArgumentOutOfRangeException: The generation is not positive.
  • InvalidOperationException: The attempt does not exist or names another execution, scope, step or completion, or a recorded continuation has another hash.

method ReprocessScopeAsync(WorkflowActivityReprocessScopeRequest, CancellationToken) #

public Task<WorkflowActivityReprocessScopeResult> ReprocessScopeAsync(WorkflowActivityReprocessScopeRequest request, CancellationToken cancellationToken = default)

Records a request to reprocess a scope. The successor scope id is the source scope id followed by :r and the occurrence number.

Parameters

  • request: The reprocess request.
  • cancellationToken: Cancels the operation.

Returns

The reprocess and its successor scope.

method RetryStepAsync(WorkflowActivityRetryStepRequest, CancellationToken) #

public Task<WorkflowActivityRetryDecision> RetryStepAsync(WorkflowActivityRetryStepRequest request, CancellationToken cancellationToken = default)

Dispatches the next attempt of a step that waits for a retry, once its delay has passed; marks the retries exhausted when no attempt is left.

Parameters

  • request: The retry.
  • cancellationToken: Cancels the operation.

Returns

The retry decision, with the dispatch.

Exceptions

  • WorkflowStoreConcurrencyException: The cancel fence version differs.
  • InvalidOperationException: The step does not wait for a retry, its delay has not passed, or its prior attempt cannot be retried by an operator.

method StopAsync(WorkflowActivityStopRequest, CancellationToken) #

public Task<WorkflowActivityStopResult> StopAsync(WorkflowActivityStopRequest request, CancellationToken cancellationToken = default)

Stops the activities of a target in one change scope: open steps are canceled, or fail with a deadline in deadline mode; their ready dispatches are revoked and cancel messages are queued.

Parameters

  • request: The stop request.
  • cancellationToken: Cancels the operation.

Returns

The counts of the stop.

Exceptions

  • InvalidOperationException: The cancel lane of a workflow activity is not registered.

record WorkflowActivityFailureRequest

public sealed record WorkflowActivityFailureRequest

A failed attempt to decide a retry for.

Members

MemberKindSummary
WorkflowActivityFailureRequest()constructorCreates an instance of WorkflowActivityFailureRequest.
DeterministicJitterSeedpropertyThe seed of the deterministic jitter.
FailureCategorypropertyThe failure category.
ProviderRetryAfterSecondspropertyThe delay the provider asked for, in seconds.
RetryPolicypropertyThe retry policy.
StepExecutionIdpropertyThe step execution.

constructor WorkflowActivityFailureRequest() #

public WorkflowActivityFailureRequest()

Creates an instance of WorkflowActivityFailureRequest.

property DeterministicJitterSeed #

public int DeterministicJitterSeed { get; init; }

The seed of the deterministic jitter.

property FailureCategory #

public required string FailureCategory { get; init; }

The failure category.

property ProviderRetryAfterSeconds #

public int? ProviderRetryAfterSeconds { get; init; }

The delay the provider asked for, in seconds.

property RetryPolicy #

public required WorkflowRetryPolicyDeclaration RetryPolicy { get; init; }

The retry policy.

property StepExecutionId #

public required string StepExecutionId { get; init; }

The step execution.

record WorkflowActivityReprocessScopeRequest

public sealed record WorkflowActivityReprocessScopeRequest

An operator request to run a scope again.

Members

MemberKindSummary
WorkflowActivityReprocessScopeRequest()constructorCreates an instance of WorkflowActivityReprocessScopeRequest.
ReasonCodepropertyWhy.
RequestedBypropertyWho requested it.
SourceScopeExecutionIdpropertyThe scope to run again.
WorkflowExecutionIdpropertyThe execution (workflow instance).

constructor WorkflowActivityReprocessScopeRequest() #

public WorkflowActivityReprocessScopeRequest()

Creates an instance of WorkflowActivityReprocessScopeRequest.

property ReasonCode #

public required string ReasonCode { get; init; }

Why.

property RequestedBy #

public required string RequestedBy { get; init; }

Who requested it.

property SourceScopeExecutionId #

public required string SourceScopeExecutionId { get; init; }

The scope to run again.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution (workflow instance).

record WorkflowActivityReprocessScopeResult

public sealed record WorkflowActivityReprocessScopeResult

The new occurrence of a reprocessed scope.

Members

MemberKindSummary
WorkflowActivityReprocessScopeResult()constructorCreates an instance of WorkflowActivityReprocessScopeResult.
OccurrenceNumberpropertyThe occurrence number.
ReprocessIdpropertyThe reprocess request.
StatuspropertyThe status.
SuccessorScopeExecutionIdpropertyThe new scope occurrence.

constructor WorkflowActivityReprocessScopeResult() #

public WorkflowActivityReprocessScopeResult()

Creates an instance of WorkflowActivityReprocessScopeResult.

property OccurrenceNumber #

public required int OccurrenceNumber { get; init; }

The occurrence number.

property ReprocessId #

public required string ReprocessId { get; init; }

The reprocess request.

property Status #

public required string Status { get; init; }

The status.

property SuccessorScopeExecutionId #

public required string SuccessorScopeExecutionId { get; init; }

The new scope occurrence.

record WorkflowActivityRetryDecision

public sealed record WorkflowActivityRetryDecision

Whether and when a failed step is retried.

Members

MemberKindSummary
WorkflowActivityRetryDecision()constructorCreates an instance of WorkflowActivityRetryDecision.
CompletedSemanticAttemptspropertyThe attempts made.
DispatchpropertyThe dispatch of the retry, when it was sent at once.
DispositionpropertyHow it was handled.
NextSemanticAttemptpropertyThe number of the next attempt.
NotBeforeUtcpropertyThe earliest time of the retry, in UTC.
RetryAllowedpropertyWhether a retry is allowed.
ReuseBindingpropertyWhether the retry keeps the binding of the previous attempt.
StepExecutionIdpropertyThe step execution.

constructor WorkflowActivityRetryDecision() #

public WorkflowActivityRetryDecision()

Creates an instance of WorkflowActivityRetryDecision.

property CompletedSemanticAttempts #

public required int CompletedSemanticAttempts { get; init; }

The attempts made.

property Dispatch #

public WorkflowExternalActivityDispatchResult? Dispatch { get; init; }

The dispatch of the retry, when it was sent at once.

property Disposition #

public required string Disposition { get; init; }

How it was handled.

property NextSemanticAttempt #

public int? NextSemanticAttempt { get; init; }

The number of the next attempt.

property NotBeforeUtc #

public DateTime? NotBeforeUtc { get; init; }

The earliest time of the retry, in UTC.

property RetryAllowed #

public required bool RetryAllowed { get; init; }

Whether a retry is allowed.

property ReuseBinding #

public required bool ReuseBinding { get; init; }

Whether the retry keeps the binding of the previous attempt.

property StepExecutionId #

public required string StepExecutionId { get; init; }

The step execution.

record WorkflowActivityRetryStepRequest

public sealed record WorkflowActivityRetryStepRequest

An operator request to retry a step now.

Members

MemberKindSummary
WorkflowActivityRetryStepRequest()constructorCreates an instance of WorkflowActivityRetryStepRequest.
AttemptIdpropertyThe attempt.
DispatchIdpropertyThe dispatch.
ExpectedCancelFenceVersionpropertyThe cancel fence the step must still have.
RequestedBypropertyWho requested it.
StepExecutionIdpropertyThe step execution.

constructor WorkflowActivityRetryStepRequest() #

public WorkflowActivityRetryStepRequest()

Creates an instance of WorkflowActivityRetryStepRequest.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property DispatchId #

public required string DispatchId { get; init; }

The dispatch.

property ExpectedCancelFenceVersion #

public long ExpectedCancelFenceVersion { get; init; }

The cancel fence the step must still have.

property RequestedBy #

public required string RequestedBy { get; init; }

Who requested it.

property StepExecutionId #

public required string StepExecutionId { get; init; }

The step execution.

record WorkflowActivityStopRequest

public sealed record WorkflowActivityStopRequest

A request to stop the activities of a target: a cancel or a deadline.

Members

MemberKindSummary
WorkflowActivityStopRequest()constructorCreates an instance of WorkflowActivityStopRequest.
DeadlineAtpropertyThe deadline, for a deadline stop.
ModepropertyCANCEL or DEADLINE.
ReasonCodepropertyWhy.
TargetIdpropertyThe target.
TargetKindpropertyThe kind of the target.

constructor WorkflowActivityStopRequest() #

public WorkflowActivityStopRequest()

Creates an instance of WorkflowActivityStopRequest.

property DeadlineAt #

public DateTimeOffset? DeadlineAt { get; init; }

The deadline, for a deadline stop.

property Mode #

public required string Mode { get; init; }

CANCEL or DEADLINE.

property ReasonCode #

public required string ReasonCode { get; init; }

Why.

property TargetId #

public required string TargetId { get; init; }

The target.

property TargetKind #

public required string TargetKind { get; init; }

The kind of the target.

record WorkflowActivityStopResult

public sealed record WorkflowActivityStopResult

The outcome of a stop.

Members

MemberKindSummary
WorkflowActivityStopResult()constructorCreates an instance of WorkflowActivityStopResult.
AlreadyTerminalCountpropertyThe steps that had already ended.
CancelMessagesQueuedpropertyThe cancel requests queued.
ReconciliationCountpropertyThe steps left for reconciliation.
TargetIdpropertyThe target.
TargetKindpropertyThe kind of the target.
WonCountpropertyThe steps the stop ended.

constructor WorkflowActivityStopResult() #

public WorkflowActivityStopResult()

Creates an instance of WorkflowActivityStopResult.

property AlreadyTerminalCount #

public required int AlreadyTerminalCount { get; init; }

The steps that had already ended.

property CancelMessagesQueued #

public required int CancelMessagesQueued { get; init; }

The cancel requests queued.

property ReconciliationCount #

public required int ReconciliationCount { get; init; }

The steps left for reconciliation.

property TargetId #

public required string TargetId { get; init; }

The target.

property TargetKind #

public required string TargetKind { get; init; }

The kind of the target.

property WonCount #

public required int WonCount { get; init; }

The steps the stop ended.

record WorkflowContinuationRegistrationRequest

public sealed record WorkflowContinuationRegistrationRequest

A continuation an attempt reported, to register for the next attempt.

Members

MemberKindSummary
WorkflowContinuationRegistrationRequest()constructorCreates an instance of WorkflowContinuationRegistrationRequest.
ContinuationRefpropertyThe provider’s continuation reference.
ContinuationSha256propertyThe SHA-256 of the continuation.
GenerationpropertyThe continuation generation.
LineageIdpropertyThe lineage.
ScopeExecutionIdpropertyThe scope of the step.
SourceAttemptIdpropertyThe attempt that left the continuation.
SourceCompletionEventIdpropertyThe completion that carried it.
StepExecutionIdpropertyThe step execution.
WorkflowExecutionIdpropertyThe execution (workflow instance).

constructor WorkflowContinuationRegistrationRequest() #

public WorkflowContinuationRegistrationRequest()

Creates an instance of WorkflowContinuationRegistrationRequest.

property ContinuationRef #

public required string ContinuationRef { get; init; }

The provider’s continuation reference.

property ContinuationSha256 #

public required string ContinuationSha256 { get; init; }

The SHA-256 of the continuation.

property Generation #

public long Generation { get; init; }

The continuation generation.

property LineageId #

public required string LineageId { get; init; }

The lineage.

property ScopeExecutionId #

public required string ScopeExecutionId { get; init; }

The scope of the step.

property SourceAttemptId #

public required string SourceAttemptId { get; init; }

The attempt that left the continuation.

property SourceCompletionEventId #

public required string SourceCompletionEventId { get; init; }

The completion that carried it.

property StepExecutionId #

public required string StepExecutionId { get; init; }

The step execution.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution (workflow instance).

record WorkflowExternalActivityCompletionDecision

public sealed record WorkflowExternalActivityCompletionDecision

The outcome of a completion: the delivery disposition, and the signal that resumes the waiting step when there is one.

Parameters

  • Disposition: The delivery disposition.
  • ResumeSignal: The signal that resumes the waiting step or map item; null when nothing resumes.

Members

MemberKindSummary
WorkflowExternalActivityCompletionDecision(WorkflowDeliveryDisposition, WorkflowSignalEnvelope)constructorThe outcome of a completion: the delivery disposition, and the signal that resumes the waiting step when there is one.
DispositionpropertyThe delivery disposition.
ResumeSignalpropertyThe signal that resumes the waiting step or map item; null when nothing resumes.

constructor WorkflowExternalActivityCompletionDecision(WorkflowDeliveryDisposition, WorkflowSignalEnvelope) #

public WorkflowExternalActivityCompletionDecision(WorkflowDeliveryDisposition Disposition, WorkflowSignalEnvelope? ResumeSignal)

The outcome of a completion: the delivery disposition, and the signal that resumes the waiting step when there is one.

Parameters

  • Disposition: The delivery disposition.
  • ResumeSignal: The signal that resumes the waiting step or map item; null when nothing resumes.

property Disposition #

public WorkflowDeliveryDisposition Disposition { get; init; }

The delivery disposition.

property ResumeSignal #

public WorkflowSignalEnvelope? ResumeSignal { get; init; }

The signal that resumes the waiting step or map item; null when nothing resumes.

record WorkflowExternalActivityCompletionRequest

public sealed record WorkflowExternalActivityCompletionRequest

A completion received on the completed lane.

Members

MemberKindSummary
WorkflowExternalActivityCompletionRequest()constructorCreates an instance of WorkflowExternalActivityCompletionRequest.
AttemptIdpropertyThe attempt.
CanonicalCompletionJsonpropertyThe canonical completion, as JSON.
EventIdpropertyThe completion event.
ReceivedAtpropertyWhen the completion was received; now when not set.

constructor WorkflowExternalActivityCompletionRequest() #

public WorkflowExternalActivityCompletionRequest()

Creates an instance of WorkflowExternalActivityCompletionRequest.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property CanonicalCompletionJson #

public required string CanonicalCompletionJson { get; init; }

The canonical completion, as JSON.

property EventId #

public required string EventId { get; init; }

The completion event.

property ReceivedAt #

public DateTimeOffset? ReceivedAt { get; init; }

When the completion was received; now when not set.

record WorkflowExternalActivityCompletionResult

public sealed record WorkflowExternalActivityCompletionResult

How a completion was handled.

Members

MemberKindSummary
WorkflowExternalActivityCompletionResult()constructorCreates an instance of WorkflowExternalActivityCompletionResult.
AcknowledgedAfterCommitpropertyWhether the completion may be acknowledged: its handling committed.
AttemptIdpropertyThe attempt.
DispositionpropertyHow it was handled.
EventIdpropertyThe completion event.
ExecutionVersionpropertyThe execution version after the operation.
SafeCodepropertyThe safe code of a refusal.

constructor WorkflowExternalActivityCompletionResult() #

public WorkflowExternalActivityCompletionResult()

Creates an instance of WorkflowExternalActivityCompletionResult.

property AcknowledgedAfterCommit #

public required bool AcknowledgedAfterCommit { get; init; }

Whether the completion may be acknowledged: its handling committed.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property Disposition #

public required string Disposition { get; init; }

How it was handled.

property EventId #

public required string EventId { get; init; }

The completion event.

property ExecutionVersion #

public long? ExecutionVersion { get; init; }

The execution version after the operation.

property SafeCode #

public string? SafeCode { get; init; }

The safe code of a refusal.

class WorkflowExternalActivityCompletionService

public sealed class WorkflowExternalActivityCompletionService

Records a completion from the completed lane and, when the step can resume, builds the signal that resumes it, with the result (or the outcome and the failure) as payload.

Parameters

  • store: The external activity store.
  • activityService: Records the completion.
  • mutationCoordinator: Begins the change scope; none when not set.
  • mapCoordinator: Advances map items; needed for the completions of map items.

Members

MemberKindSummary
WorkflowExternalActivityCompletionService(IWorkflowExternalActivityStore, WorkflowExternalActivityService, IWorkflowMutationCoordinator, WorkflowMapCoordinator)constructorRecords a completion from the completed lane and, when the step can resume, builds the signal that resumes it, with the result (or the outcome and the failure) as payload.
CompleteAsync(WorkflowActivityCompletionV1, string, CancellationToken)methodRecords a completion and decides how to acknowledge it.

constructor WorkflowExternalActivityCompletionService(IWorkflowExternalActivityStore, WorkflowExternalActivityService, IWorkflowMutationCoordinator, WorkflowMapCoordinator) #

public WorkflowExternalActivityCompletionService(IWorkflowExternalActivityStore store, WorkflowExternalActivityService activityService, IWorkflowMutationCoordinator? mutationCoordinator = null, WorkflowMapCoordinator? mapCoordinator = null)

Records a completion from the completed lane and, when the step can resume, builds the signal that resumes it, with the result (or the outcome and the failure) as payload.

Parameters

  • store: The external activity store.
  • activityService: Records the completion.
  • mutationCoordinator: Begins the change scope; none when not set.
  • mapCoordinator: Advances map items; needed for the completions of map items.

method CompleteAsync(WorkflowActivityCompletionV1, string, CancellationToken) #

public Task<WorkflowExternalActivityCompletionDecision> CompleteAsync(WorkflowActivityCompletionV1 completion, string canonicalCompletionJson, CancellationToken cancellationToken)

Records a completion and decides how to acknowledge it.

Parameters

  • completion: The completion.
  • canonicalCompletionJson: The completion, as canonical JSON.
  • cancellationToken: Cancels the operation.

Returns

The disposition and the resume signal.

Exceptions

  • InvalidOperationException: A step, an execution or a map binding the completion needs does not exist, or the step cannot resume.

class WorkflowExternalActivityContractKinds

public static class WorkflowExternalActivityContractKinds

The contract kinds of external activities.

Members

MemberKindSummary
WorkflowActivityconstantThe workflow activity contract, version 1.

constant WorkflowActivity #

public const string WorkflowActivity = "WORKFLOW_ACTIVITY_V1"

The workflow activity contract, version 1.

record WorkflowExternalActivityDispatchRequest

public sealed record WorkflowExternalActivityDispatchRequest

An attempt to dispatch.

Members

MemberKindSummary
WorkflowExternalActivityDispatchRequest()constructorCreates an instance of WorkflowExternalActivityDispatchRequest.
AbsoluteDeadlineAtpropertyThe deadline over all attempts.
AttemptIdpropertyThe attempt.
AttemptNumberpropertyThe attempt number, from 1.
CanonicalRequestJsonpropertyThe canonical request, as JSON.
ContractVersionpropertyThe contract version of the activity.
CreatedAtpropertyWhen the dispatch was created; now when not set.
DeadlineAtpropertyThe deadline of the attempt.
DestinationCodepropertyThe destination of the activity.
DispatchIdpropertyThe dispatch.
ExpectedExecutionVersionpropertyThe execution version the dispatch expects.
LogicalStepKeypropertyThe step in the definition.
MapItemIdpropertyThe map item the step runs for, when it runs in a map.
OperationCodepropertyThe operation of the activity.
RetryPolicypropertyThe retry policy of the step.
ScopeExecutionIdpropertyThe scope of the step.
StepExecutionIdpropertyThe step execution.
WorkflowExecutionIdpropertyThe execution (workflow instance).

constructor WorkflowExternalActivityDispatchRequest() #

public WorkflowExternalActivityDispatchRequest()

Creates an instance of WorkflowExternalActivityDispatchRequest.

property AbsoluteDeadlineAt #

public DateTimeOffset? AbsoluteDeadlineAt { get; init; }

The deadline over all attempts.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property AttemptNumber #

public required int AttemptNumber { get; init; }

The attempt number, from 1.

property CanonicalRequestJson #

public required string CanonicalRequestJson { get; init; }

The canonical request, as JSON.

property ContractVersion #

public required string ContractVersion { get; init; }

The contract version of the activity.

property CreatedAt #

public DateTimeOffset? CreatedAt { get; init; }

When the dispatch was created; now when not set.

property DeadlineAt #

public required DateTimeOffset DeadlineAt { get; init; }

The deadline of the attempt.

property DestinationCode #

public required string DestinationCode { get; init; }

The destination of the activity.

property DispatchId #

public required string DispatchId { get; init; }

The dispatch.

property ExpectedExecutionVersion #

public required long ExpectedExecutionVersion { get; init; }

The execution version the dispatch expects.

property LogicalStepKey #

public required string LogicalStepKey { get; init; }

The step in the definition.

property MapItemId #

public string? MapItemId { get; init; }

The map item the step runs for, when it runs in a map.

property OperationCode #

public required string OperationCode { get; init; }

The operation of the activity.

property RetryPolicy #

public WorkflowRetryPolicyDeclaration? RetryPolicy { get; init; }

The retry policy of the step.

property ScopeExecutionId #

public required string ScopeExecutionId { get; init; }

The scope of the step.

property StepExecutionId #

public required string StepExecutionId { get; init; }

The step execution.

property WorkflowExecutionId #

public required string WorkflowExecutionId { get; init; }

The execution (workflow instance).

record WorkflowExternalActivityDispatchResult

public sealed record WorkflowExternalActivityDispatchResult

A recorded dispatch.

Members

MemberKindSummary
WorkflowExternalActivityDispatchResult()constructorCreates an instance of WorkflowExternalActivityDispatchResult.
AttemptIdpropertyThe attempt.
DispatchIdpropertyThe dispatch.
ExecuteLanepropertyThe lane the request goes to.
ExecutionVersionpropertyThe execution version after the operation.
ReplayedpropertyWhether the dispatch already existed and was returned as recorded.
RequestSha256propertyThe SHA-256 of the request.

constructor WorkflowExternalActivityDispatchResult() #

public WorkflowExternalActivityDispatchResult()

Creates an instance of WorkflowExternalActivityDispatchResult.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property DispatchId #

public required string DispatchId { get; init; }

The dispatch.

property ExecuteLane #

public required string ExecuteLane { get; init; }

The lane the request goes to.

property ExecutionVersion #

public required long ExecutionVersion { get; init; }

The execution version after the operation.

property Replayed #

public required bool Replayed { get; init; }

Whether the dispatch already existed and was returned as recorded.

property RequestSha256 #

public required string RequestSha256 { get; init; }

The SHA-256 of the request.

class WorkflowExternalActivityDispatchService

public sealed class WorkflowExternalActivityDispatchService

Turns an external activity wait into a durable dispatch; the step’s evaluated request travels inline.

Parameters

  • store: The external activity store.
  • registry: The external activity registry; its request schema describes the request.
  • activityService: Records the dispatch.

Members

MemberKindSummary
WorkflowExternalActivityDispatchService(IWorkflowExternalActivityStore, IWorkflowExternalActivityRegistry, WorkflowExternalActivityService)constructorTurns an external activity wait into a durable dispatch; the step’s evaluated request travels inline.
DispatchAsync(string, WorkflowPendingSignalPlan, CancellationToken)methodDispatches the activity a pending signal plan waits for.
DispatchMapItemAsync(string, WorkflowPendingSignalPlan, string, WorkflowRetryPolicyDeclaration, DateTime?, CancellationToken)methodDispatches the activity of a map item.

constructor WorkflowExternalActivityDispatchService(IWorkflowExternalActivityStore, IWorkflowExternalActivityRegistry, WorkflowExternalActivityService) #

public WorkflowExternalActivityDispatchService(IWorkflowExternalActivityStore store, IWorkflowExternalActivityRegistry registry, WorkflowExternalActivityService activityService)

Turns an external activity wait into a durable dispatch; the step’s evaluated request travels inline.

Parameters

  • store: The external activity store.
  • registry: The external activity registry; its request schema describes the request.
  • activityService: Records the dispatch.

method DispatchAsync(string, WorkflowPendingSignalPlan, CancellationToken) #

public Task<WorkflowExternalActivityDispatchResult> DispatchAsync(string workflowExecutionId, WorkflowPendingSignalPlan pendingSignal, CancellationToken cancellationToken)

Dispatches the activity a pending signal plan waits for.

Parameters

  • workflowExecutionId: The execution.
  • pendingSignal: The durable external activity plan.
  • cancellationToken: Cancels the operation.

Returns

The dispatch.

Exceptions

  • InvalidOperationException: The plan is not a durable external activity dispatch, or lacks the destination, the operation or the contract version.

method DispatchMapItemAsync(string, WorkflowPendingSignalPlan, string, WorkflowRetryPolicyDeclaration, DateTime?, CancellationToken) #

public Task<WorkflowExternalActivityDispatchResult> DispatchMapItemAsync(string workflowExecutionId, WorkflowPendingSignalPlan pendingSignal, string mapItemId, WorkflowRetryPolicyDeclaration retryPolicy, DateTime? absoluteDeadlineAtUtc, CancellationToken cancellationToken)

Dispatches the activity of a map item.

Parameters

  • workflowExecutionId: The execution.
  • pendingSignal: The durable external activity plan.
  • mapItemId: The map item.
  • retryPolicy: The retry policy of the item.
  • absoluteDeadlineAtUtc: The deadline after which no retry runs, in UTC; none when not set.
  • cancellationToken: Cancels the operation.

Returns

The dispatch.

class WorkflowExternalActivityLanes

public static class WorkflowExternalActivityLanes

The default lanes of external activities.

Members

MemberKindSummary
CancelconstantThe cancel lane.
CompletedconstantThe completed lane.
ExecuteconstantThe execute lane.

constant Cancel #

public const string Cancel = "workflow.activity.cancel.v1"

The cancel lane.

constant Completed #

public const string Completed = "workflow.activity.completed.v1"

The completed lane.

constant Execute #

public const string Execute = "workflow.activity.execute.v1"

The execute lane.

record WorkflowExternalActivityOutboxMessage

public sealed record WorkflowExternalActivityOutboxMessage

A request to publish on an execute lane.

Members

MemberKindSummary
WorkflowExternalActivityOutboxMessage()constructorCreates an instance of WorkflowExternalActivityOutboxMessage.
AttemptIdpropertyThe attempt.
CanonicalRequestJsonpropertyThe canonical request, as JSON.
DispatchIdpropertyThe dispatch.
ExecuteLanepropertyThe lane the request goes to.
RequestSha256propertyThe SHA-256 of the request.

constructor WorkflowExternalActivityOutboxMessage() #

public WorkflowExternalActivityOutboxMessage()

Creates an instance of WorkflowExternalActivityOutboxMessage.

property AttemptId #

public required string AttemptId { get; init; }

The attempt.

property CanonicalRequestJson #

public required string CanonicalRequestJson { get; init; }

The canonical request, as JSON.

property DispatchId #

public required string DispatchId { get; init; }

The dispatch.

property ExecuteLane #

public required string ExecuteLane { get; init; }

The lane the request goes to.

property RequestSha256 #

public required string RequestSha256 { get; init; }

The SHA-256 of the request.

class WorkflowExternalActivityRegistry

public sealed class WorkflowExternalActivityRegistry : IWorkflowExternalActivityRegistry

The external activity registry of the host’s signed manifest.

Members

MemberKindSummary
WorkflowExternalActivityRegistry(IOptions<WorkflowExternalActivityRegistryOptions>)constructorLoads the manifest; a manifest that fails to load leaves the registry not ready, with the failure code.
IsReadypropertyWhether the manifest loaded; a registry that is not ready resolves nothing.
ReadinessFailureCodepropertyWhy the manifest did not load.
IsExternalTransportAddress(WorkflowTransportAddressDeclaration)methodWhether a transport address targets a lane of the registry: a RabbitMQ routing key or an endpoint path that an activity uses.
TryResolve(string, string, string, out WorkflowExternalActivityRegistration)methodFinds an activity by destination, operation and contract version.

constructor WorkflowExternalActivityRegistry(IOptions<WorkflowExternalActivityRegistryOptions>) #

public WorkflowExternalActivityRegistry(IOptions<WorkflowExternalActivityRegistryOptions> options)

Loads the manifest; a manifest that fails to load leaves the registry not ready, with the failure code.

Parameters

  • options: The manifest location and signature settings.

property IsReady #

public bool IsReady { get; }

Whether the manifest loaded; a registry that is not ready resolves nothing.

property ReadinessFailureCode #

public string? ReadinessFailureCode { get; }

Why the manifest did not load.

method IsExternalTransportAddress(WorkflowTransportAddressDeclaration) #

public bool IsExternalTransportAddress(WorkflowTransportAddressDeclaration address)

Whether a transport address targets a lane of the registry: a RabbitMQ routing key or an endpoint path that an activity uses.

Parameters

  • address: The address.

Returns

Whether it does.

method TryResolve(string, string, string, out WorkflowExternalActivityRegistration) #

public bool TryResolve(string destinationCode, string operationCode, string contractVersion, out WorkflowExternalActivityRegistration registration)

Finds an activity by destination, operation and contract version.

Parameters

  • destinationCode: The destination.
  • operationCode: The operation.
  • contractVersion: The contract version.
  • registration: The activity, when found.

Returns

Whether the registry is ready and has the activity.

record WorkflowExternalActivityRegistryEntry

public sealed record WorkflowExternalActivityRegistryEntry

An external activity of the manifest.

Members

MemberKindSummary
WorkflowExternalActivityRegistryEntry()constructorCreates an instance of WorkflowExternalActivityRegistryEntry.
CancelLanepropertyThe lane the cancels go to, when there is one.
CompletionLanepropertyThe lane the completions come back on, when it differs.
ContractKindpropertyThe contract kind.
ContractVersionpropertyThe contract version.
DestinationCodepropertyThe destination.
ExecuteLanepropertyThe lane the requests go to.
HandlerBuildSha256propertyThe SHA-256 of the handler build.
OperationCodepropertyThe operation.
RequestSchemaIdpropertyThe schema of the request.
RequestSchemaVersionpropertyThe version of the request schema.
ResultSchemaIdpropertyThe schema of the result, when there is one.
ResultSchemaVersionpropertyThe version of the result schema.

constructor WorkflowExternalActivityRegistryEntry() #

public WorkflowExternalActivityRegistryEntry()

Creates an instance of WorkflowExternalActivityRegistryEntry.

property CancelLane #

public string? CancelLane { get; init; }

The lane the cancels go to, when there is one.

property CompletionLane #

public string? CompletionLane { get; init; }

The lane the completions come back on, when it differs.

property ContractKind #

public required string ContractKind { get; init; }

The contract kind.

property ContractVersion #

public required string ContractVersion { get; init; }

The contract version.

property DestinationCode #

public required string DestinationCode { get; init; }

The destination.

property ExecuteLane #

public required string ExecuteLane { get; init; }

The lane the requests go to.

property HandlerBuildSha256 #

public required string HandlerBuildSha256 { get; init; }

The SHA-256 of the handler build.

property OperationCode #

public required string OperationCode { get; init; }

The operation.

property RequestSchemaId #

public required string RequestSchemaId { get; init; }

The schema of the request.

property RequestSchemaVersion #

public required int RequestSchemaVersion { get; init; }

The version of the request schema.

property ResultSchemaId #

public string? ResultSchemaId { get; init; }

The schema of the result, when there is one.

property ResultSchemaVersion #

public int? ResultSchemaVersion { get; init; }

The version of the result schema.

class WorkflowExternalActivityRegistryException

public sealed class WorkflowExternalActivityRegistryException : Exception

Raised when the registry manifest cannot be loaded.

Members

MemberKindSummary
WorkflowExternalActivityRegistryException(string)constructorCreates the exception.
WorkflowExternalActivityRegistryException(string, Exception)constructorCreates the exception with its cause.
CodepropertyThe failure code.

constructor WorkflowExternalActivityRegistryException(string) #

public WorkflowExternalActivityRegistryException(string code)

Creates the exception.

Parameters

  • code: The failure code.

constructor WorkflowExternalActivityRegistryException(string, Exception) #

public WorkflowExternalActivityRegistryException(string code, Exception innerException)

Creates the exception with its cause.

Parameters

  • code: The failure code.
  • innerException: The cause.

property Code #

public string Code { get; }

The failure code.

class WorkflowExternalActivityRegistryHealthCheck

public sealed class WorkflowExternalActivityRegistryHealthCheck : IHealthCheck

Healthy once the signed external activity registry is verified; unhealthy, with the readiness failure code, until then.

Parameters

  • registry: The registry.

Members

MemberKindSummary
WorkflowExternalActivityRegistryHealthCheck(WorkflowExternalActivityRegistry)constructorHealthy once the signed external activity registry is verified; unhealthy, with the readiness failure code, until then.
CheckHealthAsync(HealthCheckContext, CancellationToken)methodSee IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken).

constructor WorkflowExternalActivityRegistryHealthCheck(WorkflowExternalActivityRegistry) #

public WorkflowExternalActivityRegistryHealthCheck(WorkflowExternalActivityRegistry registry)

Healthy once the signed external activity registry is verified; unhealthy, with the readiness failure code, until then.

Parameters

  • registry: The registry.

method CheckHealthAsync(HealthCheckContext, CancellationToken) #

public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)

See IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken).

record WorkflowExternalActivityRegistryManifest

public sealed record WorkflowExternalActivityRegistryManifest

The signed registry manifest of a host.

Members

MemberKindSummary
WorkflowExternalActivityRegistryManifest()constructorCreates an instance of WorkflowExternalActivityRegistryManifest.
ContractVersionpropertyThe manifest contract version.
EntriespropertyThe activities.

constructor WorkflowExternalActivityRegistryManifest() #

public WorkflowExternalActivityRegistryManifest()

Creates an instance of WorkflowExternalActivityRegistryManifest.

property ContractVersion #

public required int ContractVersion { get; init; }

The manifest contract version.

property Entries #

public required IReadOnlyList<WorkflowExternalActivityRegistryEntry> Entries { get; init; }

The activities.

class WorkflowExternalActivityRegistryOptions

public sealed class WorkflowExternalActivityRegistryOptions

The signed manifest of the external activities the host may run (WorkflowExternalActivityRegistry). Without a manifest the host runs no external activity, and definition validation rejects an external activity step. With one, the SHA-256 of the canonical manifest must equal WorkflowExternalActivityRegistryOptions.ManifestSha256and its RSA signature must verify with the public key, or loading the registry fails.

Members

MemberKindSummary
WorkflowExternalActivityRegistryOptions()constructorCreates an instance of WorkflowExternalActivityRegistryOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowExternalActivityRegistry.
ManifestJsonpropertyThe manifest as inline JSON; takes precedence over WorkflowExternalActivityRegistryOptions.ManifestPath.
ManifestPathpropertyThe manifest file; WorkflowExternalActivityRegistryOptions.ManifestJsontakes precedence when set.
ManifestSha256propertyThe expected SHA-256 of the canonical manifest JSON.
PublicKeyPathpropertyThe PEM file of the RSA public key that verifies the signature; WorkflowExternalActivityRegistryOptions.PublicKeyPemtakes precedence when set.
PublicKeyPempropertyThe RSA public key in PEM form; takes precedence over WorkflowExternalActivityRegistryOptions.PublicKeyPath.
SignatureBase64propertyThe base64 RSA signature (SHA-256, PKCS #1 v1.5) of the canonical manifest bytes; takes precedence over WorkflowExternalActivityRegistryOptions.SignaturePath.
SignaturePathpropertyThe file that holds the base64 signature; WorkflowExternalActivityRegistryOptions.SignatureBase64takes precedence when set.

constructor WorkflowExternalActivityRegistryOptions() #

public WorkflowExternalActivityRegistryOptions()

Creates an instance of WorkflowExternalActivityRegistryOptions.

constant SectionName #

public const string SectionName = "WorkflowExternalActivityRegistry"

The configuration section the options bind from: WorkflowExternalActivityRegistry.

property ManifestJson #

public string? ManifestJson { get; set; }

The manifest as inline JSON; takes precedence over WorkflowExternalActivityRegistryOptions.ManifestPath.

property ManifestPath #

public string? ManifestPath { get; set; }

The manifest file; WorkflowExternalActivityRegistryOptions.ManifestJsontakes precedence when set.

property ManifestSha256 #

public string? ManifestSha256 { get; set; }

The expected SHA-256 of the canonical manifest JSON. Required with a manifest.

property PublicKeyPath #

public string? PublicKeyPath { get; set; }

The PEM file of the RSA public key that verifies the signature; WorkflowExternalActivityRegistryOptions.PublicKeyPemtakes precedence when set.

property PublicKeyPem #

public string? PublicKeyPem { get; set; }

The RSA public key in PEM form; takes precedence over WorkflowExternalActivityRegistryOptions.PublicKeyPath.

property SignatureBase64 #

public string? SignatureBase64 { get; set; }

The base64 RSA signature (SHA-256, PKCS #1 v1.5) of the canonical manifest bytes; takes precedence over WorkflowExternalActivityRegistryOptions.SignaturePath.

property SignaturePath #

public string? SignaturePath { get; set; }

The file that holds the base64 signature; WorkflowExternalActivityRegistryOptions.SignatureBase64takes precedence when set.

class WorkflowExternalActivityService

public sealed class WorkflowExternalActivityService

Records external activity dispatches and completions once, with their outbox entries.

Parameters

  • store: The external activity store.
  • mutationCoordinator: Begins the change scopes.
  • registry: The external activity registry; it validates the typed requests and names the lanes.

Members

MemberKindSummary
WorkflowExternalActivityService(IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, IWorkflowExternalActivityRegistry)constructorRecords external activity dispatches and completions once, with their outbox entries.
CompleteAsync(WorkflowExternalActivityCompletionRequest, CancellationToken)methodRecords an activity completion, canonicalized, and decides whether it applies to its attempt.
DispatchAsync(WorkflowExternalActivityDispatchRequest, CancellationToken)methodRecords the dispatch of an activity attempt for its execute lane.
GetReadyDispatchesAsync(int, CancellationToken)methodReturns the dispatch messages ready to publish.
MarkPublishedAsync(string, DateTimeOffset, CancellationToken)methodMarks a dispatch message published.

constructor WorkflowExternalActivityService(IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, IWorkflowExternalActivityRegistry) #

public WorkflowExternalActivityService(IWorkflowExternalActivityStore store, IWorkflowMutationCoordinator mutationCoordinator, IWorkflowExternalActivityRegistry registry)

Records external activity dispatches and completions once, with their outbox entries.

Parameters

  • store: The external activity store.
  • mutationCoordinator: Begins the change scopes.
  • registry: The external activity registry; it validates the typed requests and names the lanes.

method CompleteAsync(WorkflowExternalActivityCompletionRequest, CancellationToken) #

public Task<WorkflowExternalActivityCompletionResult> CompleteAsync(WorkflowExternalActivityCompletionRequest request, CancellationToken cancellationToken = default)

Records an activity completion, canonicalized, and decides whether it applies to its attempt. A completion already recorded under its event id is returned as a duplicate when it names the same attempt and has the same hash.

Parameters

  • request: The completion.
  • cancellationToken: Cancels the operation.

Returns

The completion and its disposition.

Exceptions

  • InvalidOperationException: A completion recorded under the event id names another attempt or has another hash.

method DispatchAsync(WorkflowExternalActivityDispatchRequest, CancellationToken) #

public Task<WorkflowExternalActivityDispatchResult> DispatchAsync(WorkflowExternalActivityDispatchRequest request, CancellationToken cancellationToken = default)

Records the dispatch of an activity attempt for its execute lane. A dispatch already recorded under the attempt id is returned as replayed when it has the same dispatch id and request hash.

Parameters

  • request: The dispatch.
  • cancellationToken: Cancels the operation.

Returns

The dispatch.

Exceptions

  • InvalidOperationException: A dispatch recorded for the attempt has another dispatch id or request hash.

method GetReadyDispatchesAsync(int, CancellationToken) #

public Task<IReadOnlyList<WorkflowExternalActivityOutboxMessage>> GetReadyDispatchesAsync(int maxCount, CancellationToken cancellationToken = default)

Returns the dispatch messages ready to publish.

Parameters

  • maxCount: The most messages to return, from 1 to 1,000.
  • cancellationToken: Cancels the operation.

Returns

The messages.

Exceptions

  • ArgumentOutOfRangeException: The count is outside 1 to 1,000.

method MarkPublishedAsync(string, DateTimeOffset, CancellationToken) #

public Task MarkPublishedAsync(string dispatchId, DateTimeOffset publishedAt, CancellationToken cancellationToken = default)

Marks a dispatch message published.

Parameters

  • dispatchId: The dispatch.
  • publishedAt: When it was published.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the message is marked.

class WorkflowExternalActivitySignalDispatcher

public sealed class WorkflowExternalActivitySignalDispatcher : IWorkflowPendingSignalDispatcher

Dispatches an external activity step durably (DurableDispatch pending signal).

Members

MemberKindSummary
WorkflowExternalActivitySignalDispatcher(WorkflowExternalActivityDispatchService)constructorDispatches an external activity step durably (DurableDispatch pending signal).
CanDispatch(WorkflowPendingSignalPlan)methodWhether this dispatcher sends a pending signal.
DispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken)methodDispatches the signal and returns the execution version the next signal must expect.

constructor WorkflowExternalActivitySignalDispatcher(WorkflowExternalActivityDispatchService) #

public WorkflowExternalActivitySignalDispatcher(WorkflowExternalActivityDispatchService dispatchService)

Dispatches an external activity step durably (DurableDispatch pending signal).

method CanDispatch(WorkflowPendingSignalPlan) #

public bool CanDispatch(WorkflowPendingSignalPlan pendingSignal)

Whether this dispatcher sends a pending signal.

Parameters

  • pendingSignal: The signal.

Returns

Whether it does.

method DispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken) #

public Task<long> DispatchAsync(string workflowInstanceId, WorkflowPendingSignalPlan pendingSignal, WorkflowRuntimeStateRecord runtimeState, CancellationToken cancellationToken = default)

Dispatches the signal and returns the execution version the next signal must expect.

namespace StellaOps.Workflow.Engine.History

TypeKindDescription
WorkflowHistoryPagerecordA page of the history events of an execution.
WorkflowHistoryServiceclassReads and compacts the history events of executions.

record WorkflowHistoryPage

public sealed record WorkflowHistoryPage

A page of the history events of an execution.

Members

MemberKindSummary
WorkflowHistoryPage()constructorCreates an instance of WorkflowHistoryPage.
DispositionpropertyOK, or CURSOR_COMPACTED when the events after the requested sequence were compacted away; the page is then empty.
EventspropertyThe events.
HistoryFloorSequencepropertyThe first history sequence still kept.
SnapshotSequencepropertyThe last history sequence when the page was read.

constructor WorkflowHistoryPage() #

public WorkflowHistoryPage()

Creates an instance of WorkflowHistoryPage.

property Disposition #

public required string Disposition { get; init; }

OK, or CURSOR_COMPACTED when the events after the requested sequence were compacted away; the page is then empty.

property Events #

public required IReadOnlyList<WorkflowHistoryEvent> Events { get; init; }

The events.

property HistoryFloorSequence #

public required long HistoryFloorSequence { get; init; }

The first history sequence still kept.

property SnapshotSequence #

public required long SnapshotSequence { get; init; }

The last history sequence when the page was read.

class WorkflowHistoryService

public sealed class WorkflowHistoryService

Reads and compacts the history events of executions.

Parameters

  • store: The history store.

Members

MemberKindSummary
WorkflowHistoryService(IWorkflowHistoryStore)constructorReads and compacts the history events of executions.
CompactPrefixAsync(string, long, int, CancellationToken)methodDeletes the events up to a sequence, unless the execution is under a legal hold or the HOLD_ALL retention policy.
GetEventsAsync(string, long, int, CancellationToken)methodReads the events after a sequence.

constructor WorkflowHistoryService(IWorkflowHistoryStore) #

public WorkflowHistoryService(IWorkflowHistoryStore store)

Reads and compacts the history events of executions.

Parameters

  • store: The history store.

method CompactPrefixAsync(string, long, int, CancellationToken) #

public Task<WorkflowHistoryCompactionResult> CompactPrefixAsync(string workflowExecutionId, long throughSequence, int maxCount, CancellationToken cancellationToken = default)

Deletes the events up to a sequence, unless the execution is under a legal hold or the HOLD_ALL retention policy.

Parameters

  • workflowExecutionId: The execution (workflow instance).
  • throughSequence: The last sequence to delete.
  • maxCount: The most events to delete.
  • cancellationToken: Cancels the operation.

Returns

The events deleted and the new history floor.

method GetEventsAsync(string, long, int, CancellationToken) #

public Task<WorkflowHistoryPage> GetEventsAsync(string workflowExecutionId, long afterSequence, int maxCount, CancellationToken cancellationToken = default)

Reads the events after a sequence.

Parameters

  • workflowExecutionId: The execution (workflow instance).
  • afterSequence: The sequence after which events are read.
  • maxCount: The most events, from 1 to 1000.
  • cancellationToken: Cancels the operation.

Returns

The page.

Exceptions

  • ArgumentOutOfRangeException: maxCount is outside 1 to 1000.

namespace StellaOps.Workflow.Engine.HostedServices

TypeKindDescription
WorkflowRetentionHostedServiceclassRuns the instance retention at the configured interval when it is enabled, on one service instance at a time (it takes the hosted job lock).
WorkflowSignalDeliveryAttemptTrackerclassPer-process tracker that records how many times the signal pump worker has dispatched a given signal envelope to the processor in the current host lifetime.
WorkflowSignalPumpHostedServiceclassRuns WorkflowEngine:MaxConcurrentSignalHandlers signal pump workers (at least one) until the host stops.
WorkflowSignalPumpWorkerclassMoves signals from the signal bus to the signal processor, one at a time.

class WorkflowRetentionHostedService

public sealed class WorkflowRetentionHostedService : BackgroundService

Runs the instance retention at the configured interval when it is enabled, on one service instance at a time (it takes the hosted job lock).

Parameters

  • serviceScopeFactory: Creates the scope of each run.
  • options: Whether the job runs, and its interval.
  • logger: Receives the diagnostics.

Members

MemberKindSummary
WorkflowRetentionHostedService(IServiceScopeFactory, IOptions<WorkflowRetentionHostedJobOptions>, ILogger<WorkflowRetentionHostedService>)constructorRuns the instance retention at the configured interval when it is enabled, on one service instance at a time (it takes the hosted job lock).

constructor WorkflowRetentionHostedService(IServiceScopeFactory, IOptions<WorkflowRetentionHostedJobOptions>, ILogger<WorkflowRetentionHostedService>) #

public WorkflowRetentionHostedService(IServiceScopeFactory serviceScopeFactory, IOptions<WorkflowRetentionHostedJobOptions> options, ILogger<WorkflowRetentionHostedService> logger)

Runs the instance retention at the configured interval when it is enabled, on one service instance at a time (it takes the hosted job lock).

Parameters

  • serviceScopeFactory: Creates the scope of each run.
  • options: Whether the job runs, and its interval.
  • logger: Receives the diagnostics.

class WorkflowSignalDeliveryAttemptTracker

public sealed class WorkflowSignalDeliveryAttemptTracker

Per-process tracker that records how many times the signal pump worker has dispatched a given signal envelope to the processor in the current host lifetime. The worker counts a delivery as the larger of this count and the transport-reported IWorkflowSignalLease.DeliveryCount: the PostgreSQL and MongoDB stores keep that count with the signal, so it holds across nodes and restarts, and this tracker is the floor for a transport that reports fewer deliveries than it made.

Remarks

The tracker lives for the host lifetime: counts reset on host restart. A transport whose delivery count does not survive a restart needs its own queue-side retry limit to move a poison message that survives a worker restart to a dead-letter queue.

To bound memory under high cardinality the tracker is capped; the oldest entries are evicted FIFO when the cap is reached. The cap is large enough to cover real-world fan-out (~16K concurrent failing signals) but small enough to ensure a runaway tracker cannot exhaust process memory.

Members

MemberKindSummary
WorkflowSignalDeliveryAttemptTracker()constructorCreates an instance of WorkflowSignalDeliveryAttemptTracker.
Forget(string)methodForget the tracking state for signalId.
Peek(string)methodReturns the current attempt count for signalId without mutating the tracker.
RegisterAttempt(string)methodRecord that the worker is about to dispatch signalId and return the resulting attempt count (1 for the first dispatch, 2 for the next, etc.).

constructor WorkflowSignalDeliveryAttemptTracker() #

public WorkflowSignalDeliveryAttemptTracker()

Creates an instance of WorkflowSignalDeliveryAttemptTracker.

method Forget(string) #

public void Forget(string signalId)

Forget the tracking state for signalId. Called when the signal is acknowledged (processed, concurrency-skipped, or dead-lettered) so the tracker does not leak across distinct lifecycles of the same signal id.

method Peek(string) #

public int Peek(string signalId)

Returns the current attempt count for signalId without mutating the tracker. Returns 0 when the signal is not tracked.

method RegisterAttempt(string) #

public int RegisterAttempt(string signalId)

Record that the worker is about to dispatch signalId and return the resulting attempt count (1 for the first dispatch, 2 for the next, etc.).

class WorkflowSignalPumpHostedService

public sealed class WorkflowSignalPumpHostedService : BackgroundService

Runs WorkflowEngine:MaxConcurrentSignalHandlers signal pump workers (at least one) until the host stops.

Parameters

  • worker: Processes one signal per call.
  • aqOptions: The signal queue options.
  • engineOptions: The worker count and the graceful shutdown timeout.
  • logger: Receives the diagnostics.

Members

MemberKindSummary
WorkflowSignalPumpHostedService(WorkflowSignalPumpWorker, IOptions<WorkflowAqOptions>, IOptions<WorkflowEngineOptions>, ILogger<WorkflowSignalPumpHostedService>)constructorRuns WorkflowEngine:MaxConcurrentSignalHandlers signal pump workers (at least one) until the host stops.
StopAsync(CancellationToken)methodStops the workers and waits for them up to WorkflowEngine:GracefulShutdownTimeoutSeconds.

constructor WorkflowSignalPumpHostedService(WorkflowSignalPumpWorker, IOptions<WorkflowAqOptions>, IOptions<WorkflowEngineOptions>, ILogger<WorkflowSignalPumpHostedService>) #

public WorkflowSignalPumpHostedService(WorkflowSignalPumpWorker worker, IOptions<WorkflowAqOptions> aqOptions, IOptions<WorkflowEngineOptions> engineOptions, ILogger<WorkflowSignalPumpHostedService> logger)

Runs WorkflowEngine:MaxConcurrentSignalHandlers signal pump workers (at least one) until the host stops.

Parameters

  • worker: Processes one signal per call.
  • aqOptions: The signal queue options.
  • engineOptions: The worker count and the graceful shutdown timeout.
  • logger: Receives the diagnostics.

method StopAsync(CancellationToken) #

public override Task StopAsync(CancellationToken cancellationToken)

Stops the workers and waits for them up to WorkflowEngine:GracefulShutdownTimeoutSeconds.

Parameters

  • cancellationToken: Cancels the operation.

Returns

A task that completes when the workers stopped or the timeout passed.

class WorkflowSignalPumpWorker

public sealed class WorkflowSignalPumpWorker

Moves signals from the signal bus to the signal processor, one at a time.

Parameters

  • serviceScopeFactory: Creates a scope for each signal.
  • aqOptions: The signal options; MaxDeliveryAttempts sets the delivery budget.
  • telemetryService: Counts the pump’s work.
  • deliveryAttemptTracker: Counts this process’s deliveries of each signal.
  • logger: The logger.

Members

MemberKindSummary
WorkflowSignalPumpWorker(IServiceScopeFactory, IOptions<WorkflowAqOptions>, WorkflowSignalPumpTelemetryService, WorkflowSignalDeliveryAttemptTracker, ILogger<WorkflowSignalPumpWorker>)constructorMoves signals from the signal bus to the signal processor, one at a time.
RunOnceAsync(string, CancellationToken)methodReceives one signal and processes it: completed when processed, put back after a failure, and dead-lettered at the last delivery attempt.

constructor WorkflowSignalPumpWorker(IServiceScopeFactory, IOptions<WorkflowAqOptions>, WorkflowSignalPumpTelemetryService, WorkflowSignalDeliveryAttemptTracker, ILogger<WorkflowSignalPumpWorker>) #

public WorkflowSignalPumpWorker(IServiceScopeFactory serviceScopeFactory, IOptions<WorkflowAqOptions> aqOptions, WorkflowSignalPumpTelemetryService telemetryService, WorkflowSignalDeliveryAttemptTracker deliveryAttemptTracker, ILogger<WorkflowSignalPumpWorker> logger)

Moves signals from the signal bus to the signal processor, one at a time.

Parameters

  • serviceScopeFactory: Creates a scope for each signal.
  • aqOptions: The signal options; MaxDeliveryAttempts sets the delivery budget.
  • telemetryService: Counts the pump’s work.
  • deliveryAttemptTracker: Counts this process’s deliveries of each signal.
  • logger: The logger.

method RunOnceAsync(string, CancellationToken) #

public Task<bool> RunOnceAsync(string consumerName, CancellationToken cancellationToken)

Receives one signal and processes it: completed when processed, put back after a failure, and dead-lettered at the last delivery attempt.

Parameters

  • consumerName: The consumer.
  • cancellationToken: Cancels the operation.

Returns

true when a signal was received; false after an empty poll.

namespace StellaOps.Workflow.Engine.Hosting

TypeKindDescription
WorkflowAqOptionsclassSignal pump and queue settings (WorkflowAq).
WorkflowEngineOptionsclassEngine-wide execution settings (WorkflowEngine).
WorkflowRuntimeOptionsclassThe runtime provider of new instances and the limits of map steps (WorkflowRuntime).

class WorkflowAqOptions

public sealed class WorkflowAqOptions

Signal pump and queue settings (WorkflowAq). The signal pump reads WorkflowAqOptions.ConsumerNameand WorkflowAqOptions.MaxDeliveryAttemptswhatever the signalling transport. The queue owner, the queue names and the blocking dequeue time are read only by a database queue transport that is not available in this release; the released signalling transports ignore them.

Members

MemberKindSummary
WorkflowAqOptions()constructorCreates an instance of WorkflowAqOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowAq.
BlockingDequeueSecondspropertyHow long one blocking dequeue waits for a message, in seconds.
ConsumerNamepropertyThe consumer name of the signal pump.
DeadLetterQueueNamepropertyThe queue of undeliverable signals.
MaxDeliveryAttemptspropertyHow many times the signal pump delivers a signal before it moves the signal to the dead-letter queue; a value below 1 counts as 1.
QueueOwnerpropertyThe database schema that owns the queues.
ScheduleQueueNamepropertyThe queue of scheduled signals.
SignalQueueNamepropertyThe queue of workflow signals.

constructor WorkflowAqOptions() #

public WorkflowAqOptions()

Creates an instance of WorkflowAqOptions.

constant SectionName #

public const string SectionName = "WorkflowAq"

The configuration section the options bind from: WorkflowAq.

property BlockingDequeueSeconds #

public int BlockingDequeueSeconds { get; set; }

How long one blocking dequeue waits for a message, in seconds. The default is 30. Not read by the released signalling transports.

property ConsumerName #

public string ConsumerName { get; set; }

The consumer name of the signal pump. With several signal handlers, each worker adds its number, for example WORKFLOW_SERVICE-2. The default is WORKFLOW_SERVICE.

property DeadLetterQueueName #

public string DeadLetterQueueName { get; set; }

The queue of undeliverable signals. The default is WF_DLQ_Q. Not read by the released signalling transports.

property MaxDeliveryAttempts #

public int MaxDeliveryAttempts { get; set; }

How many times the signal pump delivers a signal before it moves the signal to the dead-letter queue; a value below 1 counts as 1. The default is 10.

property QueueOwner #

public string QueueOwner { get; set; }

The database schema that owns the queues. Not read by the released signalling transports.

property ScheduleQueueName #

public string ScheduleQueueName { get; set; }

The queue of scheduled signals. The default is WF_SCHEDULE_Q. Not read by the released signalling transports.

property SignalQueueName #

public string SignalQueueName { get; set; }

The queue of workflow signals. The default is WF_SIGNAL_Q. Not read by the released signalling transports.

class WorkflowEngineOptions

public sealed class WorkflowEngineOptions

Engine-wide execution settings (WorkflowEngine).

Members

MemberKindSummary
WorkflowEngineOptions()constructorCreates an instance of WorkflowEngineOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowEngine.
ExecutionTimeoutSecondspropertyMaximum time in seconds for a single workflow execution operation (start, complete, resume).
GracefulShutdownTimeoutSecondspropertyHow long the signal pump waits at shutdown for its workers to finish, in seconds; a value below 1 counts as 1.
MaxConcurrentSignalHandlerspropertyThe number of signal pump workers that handle signals in parallel; a value below 1 counts as 1.
MaxInlineWaitSecondspropertyMaximum seconds to block a task-complete/start-workflow response waiting for the signal pump to create the next user task.

constructor WorkflowEngineOptions() #

public WorkflowEngineOptions()

Creates an instance of WorkflowEngineOptions.

constant SectionName #

public const string SectionName = "WorkflowEngine"

The configuration section the options bind from: WorkflowEngine.

property ExecutionTimeoutSeconds #

public int? ExecutionTimeoutSeconds { get; set; }

Maximum time in seconds for a single workflow execution operation (start, complete, resume). Null means no engine-wide timeout (recommended for long-running business processes). Default: null (disabled).

property GracefulShutdownTimeoutSeconds #

public int GracefulShutdownTimeoutSeconds { get; set; }

How long the signal pump waits at shutdown for its workers to finish, in seconds; a value below 1 counts as 1. The default is 30.

property MaxConcurrentSignalHandlers #

public int MaxConcurrentSignalHandlers { get; set; }

The number of signal pump workers that handle signals in parallel; a value below 1 counts as 1. The default is the processor count.

property MaxInlineWaitSeconds #

public int MaxInlineWaitSeconds { get; set; }

Maximum seconds to block a task-complete/start-workflow response waiting for the signal pump to create the next user task. 0 (or less) = no wait (return immediately). Default: 10 seconds.

class WorkflowRuntimeOptions

public sealed class WorkflowRuntimeOptions

The runtime provider of new instances and the limits of map steps (WorkflowRuntime). The limits are checked when the host starts.

Members

MemberKindSummary
WorkflowRuntimeOptions()constructorCreates an instance of WorkflowRuntimeOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowRuntime.
DefaultProviderpropertyThe runtime provider of new instances.
EnabledProviderspropertyThe runtime providers the host may use.
MaxMapConcurrencypropertyThe largest number of map items that run at the same time, from 1 to 64.
MaxMapItemspropertyThe largest number of items one map step may declare, from 1 to 10000.

constructor WorkflowRuntimeOptions() #

public WorkflowRuntimeOptions()

Creates an instance of WorkflowRuntimeOptions.

constant SectionName #

public const string SectionName = "WorkflowRuntime"

The configuration section the options bind from: WorkflowRuntime.

property DefaultProvider #

public string DefaultProvider { get; set; }

The runtime provider of new instances. Stella.Engine (the default) runs every step kind; Stella.InProcess runs no fork, map, external activity, timer, external signal or task deadline, and a host that selects it with such a workflow registered fails at start-up.

property EnabledProviders #

public List<string> EnabledProviders { get; set; }

The runtime providers the host may use. When the list is not empty, the start-up check fails if it does not name WorkflowRuntimeOptions.DefaultProvider, and an instance of a provider it does not name is refused. Empty by default: every registered provider may run.

property MaxMapConcurrency #

public int MaxMapConcurrency { get; set; }

The largest number of map items that run at the same time, from 1 to 64. The default is 8; the WORKFLOW_MAX_MAP_CONCURRENCY setting overrides it.

property MaxMapItems #

public int MaxMapItems { get; set; }

The largest number of items one map step may declare, from 1 to 10000. The default is 512; the WORKFLOW_MAX_MAP_ITEMS setting overrides it.

namespace StellaOps.Workflow.Engine.Licensing

TypeKindDescription
IWorkflowLicenceReleaseContextinterfaceThe inputs of a licence evaluation that come from the release and the operator, not from the installation’s use: the running version’s first-publication date and the vendor trust roots.
InMemoryWorkflowFirstSeenLedgerclassThe first-seen ledger of a host without a workflow store.
WorkflowComponentLicenceOptionsclassConfiguration of the component licence reader, section StellaOps:ComponentLicence.
WorkflowDesignatedWorkflowQueryServiceclassReads the Designated Workflows from the first-seen ledger for the self-attestation count, with the licence status and the licence notice of the latest licence evaluation.
WorkflowLicenceAssessorclassEvaluates the engine’s licence status: records the code catalogue and the definition store in the first-seen ledger, counts the ledger (the technical count of recorded workflow names), reads the licence records offline and runs the shared component licence evaluator against the running version’s first-publication date.
WorkflowLicenceFileReaderclassReads the configured licence records offline, from the path (StellaOps:ComponentLicence:Path) or the licence key (StellaOps:ComponentLicence:Key), and verifies them against the release context’s trust roots.
WorkflowLicenceFilesrecordThe licence records one read loaded, with the reason when they could not be read.
WorkflowLicenceHealthCheckclassThe licence entry of the health output.
WorkflowLicenceMetricsclassThe licence gauge: the count of recorded workflow names of the latest evaluation, tagged with its status name; no measurement while the count is unavailable.
WorkflowLicenceMonitorclassEvaluates the licence status once the host has started (after its startup migrations) and then once per hour, so the warning log appears at startup and hourly while the status warrants it.
WorkflowLicenceNoticeViewclassThe licence notice in the engine’s health and API output: the fields and case names the Router reports in its licence health output, so both components show it alike.
WorkflowLicenceReleaseContextclassThe release context of the running engine: the stamp of the engine assembly and the roots of ComponentLicenceTrustRoots.FromEnvironment(IEs256Verifier) (the embedded published root, or the set STELLAOPS_VENDOR_TRUST_ROOTS names).
WorkflowLicenceSnapshotrecordOne licence evaluation of the running engine, as the health detail, the gauge and the notice report it.
WorkflowLicenceStateclassThe latest licence evaluation of this process; read by the health detail and the gauge.

interface IWorkflowLicenceReleaseContext

public interface IWorkflowLicenceReleaseContext

The inputs of a licence evaluation that come from the release and the operator, not from the installation’s use: the running version’s first-publication date and the vendor trust roots.

Members

MemberKindSummary
PublishedAtpropertyThe StellaOps.Component.PublishedAt stamp of the engine’s source release; a build or adaptation of a released version keeps it, and its own build date is never used.
ResolveTrustRoots()methodThe vendor-entitlement roots that licence file signatures are checked against, resolved per evaluation.

property PublishedAt #

DateOnly? PublishedAt { get; }

The StellaOps.Component.PublishedAt stamp of the engine’s source release; a build or adaptation of a released version keeps it, and its own build date is never used. null in a development build.

method ResolveTrustRoots() #

ComponentLicenceTrustRoots ResolveTrustRoots()

The vendor-entitlement roots that licence file signatures are checked against, resolved per evaluation.

class InMemoryWorkflowFirstSeenLedger

public sealed class InMemoryWorkflowFirstSeenLedger : IWorkflowFirstSeenLedger

The first-seen ledger of a host without a workflow store. It lives in process memory, so it counts what this process has seen (in practice the code catalogue: such a host has no definition store to import into) and starts empty on every restart. This is the documented limitation of hosts without a workflow store; the PostgreSQL and MongoDB stores replace this ledger with a durable one. Its lock serialises recording within the process. Recording never refuses a workflow.

Members

MemberKindSummary
InMemoryWorkflowFirstSeenLedger()constructorCreates an instance of InMemoryWorkflowFirstSeenLedger.
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 InMemoryWorkflowFirstSeenLedger() #

public InMemoryWorkflowFirstSeenLedger()

Creates an instance of InMemoryWorkflowFirstSeenLedger.

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 WorkflowComponentLicenceOptions

public sealed class WorkflowComponentLicenceOptions

Configuration of the component licence reader, section StellaOps:ComponentLicence. Every value is optional: without a licence record the engine reports its status from the count alone, and an invalid value never stops the host (the record is then not loaded, with the reason as a detail).

Members

MemberKindSummary
WorkflowComponentLicenceOptions()constructorCreates an instance of WorkflowComponentLicenceOptions.
SectionNameconstantThe configuration section the options bind from: StellaOps:ComponentLicence.
InstallationIdpropertyThe Installation identifier the licence files name: a lowercase UUID.
KeypropertyThe licence key: the standard base64 of a licence file as one line, the same signed record as the file (an encoding, not a protection).
PathpropertyA licence file, or a directory whose *.dsse.json files are read.

constructor WorkflowComponentLicenceOptions() #

public WorkflowComponentLicenceOptions()

Creates an instance of WorkflowComponentLicenceOptions.

constant SectionName #

public const string SectionName = "StellaOps:ComponentLicence"

The configuration section the options bind from: StellaOps:ComponentLicence.

property InstallationId #

public string? InstallationId { get; set; }

The Installation identifier the licence files name: a lowercase UUID.

property Key #

public string? Key { get; set; }

The licence key: the standard base64 of a licence file as one line, the same signed record as the file (an encoding, not a protection). Configure the path or the key; with both, neither is read and the details show conflicting_sources.

property Path #

public string? Path { get; set; }

A licence file, or a directory whose *.dsse.json files are read. Local path only.

class WorkflowDesignatedWorkflowQueryService

public sealed class WorkflowDesignatedWorkflowQueryService

Reads the Designated Workflows from the first-seen ledger for the self-attestation count, with the licence status and the licence notice of the latest licence evaluation. It only reads: it records nothing, so the list is the ledger as the latest recording left it (the licence evaluation at startup and every hour, and each definition import). Nothing is sent anywhere.

Members

MemberKindSummary
WorkflowDesignatedWorkflowQueryService(IWorkflowFirstSeenLedger, WorkflowLicenceState)constructorReads the Designated Workflows from the first-seen ledger for the self-attestation count, with the licence status and the licence notice of the latest licence evaluation.
GetAsync(CancellationToken)methodReturns the designated workflows of the first-seen ledger, with the licence status and the notice of the latest licence evaluation.

constructor WorkflowDesignatedWorkflowQueryService(IWorkflowFirstSeenLedger, WorkflowLicenceState) #

public WorkflowDesignatedWorkflowQueryService(IWorkflowFirstSeenLedger ledger, WorkflowLicenceState state)

Reads the Designated Workflows from the first-seen ledger for the self-attestation count, with the licence status and the licence notice of the latest licence evaluation. It only reads: it records nothing, so the list is the ledger as the latest recording left it (the licence evaluation at startup and every hour, and each definition import). Nothing is sent anywhere.

method GetAsync(CancellationToken) #

public Task<WorkflowDesignatedWorkflowsGetResponse> GetAsync(CancellationToken cancellationToken = default)

Returns the designated workflows of the first-seen ledger, with the licence status and the notice of the latest licence evaluation.

Parameters

  • cancellationToken: Cancels the operation.

Returns

The designated workflows.

class WorkflowLicenceAssessor

public sealed class WorkflowLicenceAssessor

Evaluates the engine’s licence status: records the code catalogue and the definition store in the first-seen ledger, counts the ledger (the technical count of recorded workflow names), reads the licence records offline and runs the shared component licence evaluator against the running version’s first-publication date. Warnings only: it refuses, restricts and stops nothing, never fails readiness or liveness, makes no network call and sends nothing anywhere. A ledger that cannot be read gives the count-unavailable status, and a record that cannot be read a detail; neither is thrown.

Members

MemberKindSummary
WorkflowLicenceAssessor(IServiceScopeFactory, IWorkflowRegistrationCatalog, WorkflowLicenceFileReader, WorkflowLicenceState, TimeProvider, ILogger<WorkflowLicenceAssessor>)constructorEvaluates the engine’s licence status: records the code catalogue and the definition store in the first-seen ledger, counts the ledger (the technical count of recorded workflow names), reads the licence records offline and runs the shared component licence evaluator against the running version’s first-publication date.
EvaluateAsync(bool, CancellationToken)methodRuns one evaluation and publishes it to WorkflowLicenceState.

constructor WorkflowLicenceAssessor(IServiceScopeFactory, IWorkflowRegistrationCatalog, WorkflowLicenceFileReader, WorkflowLicenceState, TimeProvider, ILogger<WorkflowLicenceAssessor>) #

public WorkflowLicenceAssessor(IServiceScopeFactory scopeFactory, IWorkflowRegistrationCatalog catalog, WorkflowLicenceFileReader licenceFiles, WorkflowLicenceState state, TimeProvider timeProvider, ILogger<WorkflowLicenceAssessor> logger)

Evaluates the engine’s licence status: records the code catalogue and the definition store in the first-seen ledger, counts the ledger (the technical count of recorded workflow names), reads the licence records offline and runs the shared component licence evaluator against the running version’s first-publication date. Warnings only: it refuses, restricts and stops nothing, never fails readiness or liveness, makes no network call and sends nothing anywhere. A ledger that cannot be read gives the count-unavailable status, and a record that cannot be read a detail; neither is thrown.

method EvaluateAsync(bool, CancellationToken) #

public Task<WorkflowLicenceSnapshot> EvaluateAsync(bool startup, CancellationToken cancellationToken = default)

Runs one evaluation and publishes it to WorkflowLicenceState. The licence notice is logged at information level on every evaluation (startup and hourly). The warning log is written on every evaluation whose status warns (ComponentLicenceAssessment.Warns: every status but within-free-limit and record-matches); those two are logged at information level at startup and when the status changes.

class WorkflowLicenceFileReader

public sealed class WorkflowLicenceFileReader

Reads the configured licence records offline, from the path (StellaOps:ComponentLicence:Path) or the licence key (StellaOps:ComponentLicence:Key), and verifies them against the release context’s trust roots. With both set neither is read (conflicting_sources). The licence evaluation reads them again at every pass. A failure to read is reported, never thrown.

Members

MemberKindSummary
WorkflowLicenceFileReader(IOptionsMonitor<WorkflowComponentLicenceOptions>, IWorkflowLicenceReleaseContext, ILogger<WorkflowLicenceFileReader>)constructorReads the configured licence records offline, from the path (StellaOps:ComponentLicence:Path) or the licence key (StellaOps:ComponentLicence:Key), and verifies them against the release context’s trust roots.
PublishedAtpropertyThe running version’s first-publication date; null in a development build.
Read()methodReads and verifies the configured licence files for the Workflow component.

constructor WorkflowLicenceFileReader(IOptionsMonitor<WorkflowComponentLicenceOptions>, IWorkflowLicenceReleaseContext, ILogger<WorkflowLicenceFileReader>) #

public WorkflowLicenceFileReader(IOptionsMonitor<WorkflowComponentLicenceOptions> options, IWorkflowLicenceReleaseContext releaseContext, ILogger<WorkflowLicenceFileReader> logger)

Reads the configured licence records offline, from the path (StellaOps:ComponentLicence:Path) or the licence key (StellaOps:ComponentLicence:Key), and verifies them against the release context’s trust roots. With both set neither is read (conflicting_sources). The licence evaluation reads them again at every pass. A failure to read is reported, never thrown.

property PublishedAt #

public DateOnly? PublishedAt { get; }

The running version’s first-publication date; null in a development build.

method Read() #

public WorkflowLicenceFiles Read()

Reads and verifies the configured licence files for the Workflow component. No path and no key reads nothing; a read that fails is logged and reported as an issue, not raised.

Returns

The verified licence sources, any issue, and whether an installation id is configured.

record WorkflowLicenceFiles

public sealed record WorkflowLicenceFiles

The licence records one read loaded, with the reason when they could not be read.

Members

MemberKindSummary
WorkflowLicenceFiles()constructorCreates an instance of WorkflowLicenceFiles.
InstallationIdConfiguredpropertyWhether an Installation identifier is configured.
IssuepropertySet when the files could not be read; then WorkflowLicenceFiles.Sourcesis empty.
SourcespropertyEvery record read (each file, or the licence key), loaded or not, with its verification.

constructor WorkflowLicenceFiles() #

public WorkflowLicenceFiles()

Creates an instance of WorkflowLicenceFiles.

property InstallationIdConfigured #

public required bool InstallationIdConfigured { get; init; }

Whether an Installation identifier is configured.

property Issue #

public string? Issue { get; init; }

Set when the files could not be read; then WorkflowLicenceFiles.Sourcesis empty.

property Sources #

public required IReadOnlyList<ComponentLicenceSource> Sources { get; init; }

Every record read (each file, or the licence key), loaded or not, with its verification.

class WorkflowLicenceHealthCheck

public sealed class WorkflowLicenceHealthCheck : IHealthCheck

The licence entry of the health output. Informational only: it always reports HealthStatus.Healthy, so it never fails readiness or liveness, never removes the engine from service and never triggers a restart; the licence status and the licence notice are in its data.

Members

MemberKindSummary
WorkflowLicenceHealthCheck(WorkflowLicenceState)constructorThe licence entry of the health output.
NameconstantThe health check name.
CheckHealthAsync(HealthCheckContext, CancellationToken)methodSee IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken).

constructor WorkflowLicenceHealthCheck(WorkflowLicenceState) #

public WorkflowLicenceHealthCheck(WorkflowLicenceState state)

The licence entry of the health output. Informational only: it always reports HealthStatus.Healthy, so it never fails readiness or liveness, never removes the engine from service and never triggers a restart; the licence status and the licence notice are in its data.

constant Name #

public const string Name = "licence"

The health check name.

method CheckHealthAsync(HealthCheckContext, CancellationToken) #

public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)

See IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken).

class WorkflowLicenceMetrics

public sealed class WorkflowLicenceMetrics : IDisposable

The licence gauge: the count of recorded workflow names of the latest evaluation, tagged with its status name; no measurement while the count is unavailable. It is exported only through the host’s own metrics pipeline; nothing is sent to the vendor.

Members

MemberKindSummary
WorkflowLicenceMetrics(WorkflowLicenceState, IMeterFactory)constructorCreates the gauge of the designated workflows, tagged with the licence status.
GaugeNameconstantThe gauge name.
MeterNameconstantThe meter name.
StatusTagconstantThe status tag of the gauge.
MeterpropertyThe meter of this instance.
Dispose()methodDisposes the meter when the metrics created it.

constructor WorkflowLicenceMetrics(WorkflowLicenceState, IMeterFactory) #

public WorkflowLicenceMetrics(WorkflowLicenceState state, IMeterFactory? meterFactory = null)

Creates the gauge of the designated workflows, tagged with the licence status.

Parameters

  • state: The licence state.
  • meterFactory: Creates the meter; when not set, the metrics create their own meter and dispose it.

constant GaugeName #

public const string GaugeName = "stellaops.workflow.licence.designated_workflows"

The gauge name.

constant MeterName #

public const string MeterName = "StellaOps.Workflow.Licence"

The meter name.

constant StatusTag #

public const string StatusTag = "licence.status"

The status tag of the gauge.

property Meter #

public Meter Meter { get; }

The meter of this instance.

method Dispose() #

public void Dispose()

Disposes the meter when the metrics created it.

class WorkflowLicenceMonitor

public sealed class WorkflowLicenceMonitor : BackgroundService

Evaluates the licence status once the host has started (after its startup migrations) and then once per hour, so the warning log appears at startup and hourly while the status warrants it. It never stops, delays or degrades the engine: a failed evaluation is logged and retried at the next interval.

Members

MemberKindSummary
WorkflowLicenceMonitor(WorkflowLicenceAssessor, WorkflowLicenceMetrics, TimeProvider, ILogger<WorkflowLicenceMonitor>, IHostApplicationLifetime)constructorEvaluates the licence status once the host has started (after its startup migrations) and then once per hour, so the warning log appears at startup and hourly while the status warrants it.
EvaluationIntervalfieldThe interval between evaluations.

constructor WorkflowLicenceMonitor(WorkflowLicenceAssessor, WorkflowLicenceMetrics, TimeProvider, ILogger<WorkflowLicenceMonitor>, IHostApplicationLifetime) #

public WorkflowLicenceMonitor(WorkflowLicenceAssessor assessor, WorkflowLicenceMetrics metrics, TimeProvider timeProvider, ILogger<WorkflowLicenceMonitor> logger, IHostApplicationLifetime? lifetime = null)

Evaluates the licence status once the host has started (after its startup migrations) and then once per hour, so the warning log appears at startup and hourly while the status warrants it. It never stops, delays or degrades the engine: a failed evaluation is logged and retried at the next interval.

field EvaluationInterval #

public static readonly TimeSpan EvaluationInterval

The interval between evaluations.

class WorkflowLicenceNoticeView

public static class WorkflowLicenceNoticeView

The licence notice in the engine’s health and API output: the fields and case names the Router reports in its licence health output, so both components show it alike.

Members

MemberKindSummary
From(ComponentLicenceNotice)methodConverts a licence notice for the API: the notice text and its fields.
HealthData(WorkflowLicenceNotice)methodThe notice as the nested notice object of the licence health data.

method From(ComponentLicenceNotice) #

public static WorkflowLicenceNotice From(ComponentLicenceNotice notice)

Converts a licence notice for the API: the notice text and its fields.

Parameters

  • notice: The notice.

Returns

The notice view.

method HealthData(WorkflowLicenceNotice) #

public static IReadOnlyDictionary<string, object?> HealthData(WorkflowLicenceNotice notice)

The notice as the nested notice object of the licence health data.

class WorkflowLicenceReleaseContext

public sealed class WorkflowLicenceReleaseContext : IWorkflowLicenceReleaseContext

The release context of the running engine: the stamp of the engine assembly and the roots of ComponentLicenceTrustRoots.FromEnvironment(IEs256Verifier) (the embedded published root, or the set STELLAOPS_VENDOR_TRUST_ROOTS names). Local reads only.

Members

MemberKindSummary
WorkflowLicenceReleaseContext()constructorCreates an instance of WorkflowLicenceReleaseContext.
PublishedAtpropertyThe StellaOps.Component.PublishedAt stamp of the engine’s source release; a build or adaptation of a released version keeps it, and its own build date is never used.
ResolveTrustRoots()methodThe vendor-entitlement roots that licence file signatures are checked against, resolved per evaluation.

constructor WorkflowLicenceReleaseContext() #

public WorkflowLicenceReleaseContext()

Creates an instance of WorkflowLicenceReleaseContext.

property PublishedAt #

public DateOnly? PublishedAt { get; }

The StellaOps.Component.PublishedAt stamp of the engine’s source release; a build or adaptation of a released version keeps it, and its own build date is never used. null in a development build.

method ResolveTrustRoots() #

public ComponentLicenceTrustRoots ResolveTrustRoots()

The vendor-entitlement roots that licence file signatures are checked against, resolved per evaluation.

record WorkflowLicenceSnapshot

public sealed record WorkflowLicenceSnapshot

One licence evaluation of the running engine, as the health detail, the gauge and the notice report it.

Members

MemberKindSummary
WorkflowLicenceSnapshot()constructorCreates an instance of WorkflowLicenceSnapshot.
AssessmentpropertyThe component licence evaluator’s result: status, message, count and details.
InstallationIdConfiguredpropertyWhether an Installation identifier is configured.
LedgerDurablepropertytrue when the count comes from a durable ledger (PostgreSQL or MongoDB).
LedgerIssuepropertySet when the ledger could not be read and the count fell back to the code catalogue.
LicenceFilesLoadedpropertyLicence files read and loaded.
LicenceFilesNotLoadedpropertyLicence files read and not loaded (the reasons are in the assessment details).
NoticepropertyThe licence notice of WorkflowLicenceSnapshot.Assessment.
NoticeHeadlinepropertyThe short notice text: “Licensed to” the licensee, or the message of the notice case.
SequencepropertyThe evaluation number in this process, from 1.
Warnspropertytrue while the status is one the monitor logs as a warning at startup and hourly: ComponentLicenceAssessment.Warns, every status but within-free-limit and record-matches.

constructor WorkflowLicenceSnapshot() #

public WorkflowLicenceSnapshot()

Creates an instance of WorkflowLicenceSnapshot.

property Assessment #

public required ComponentLicenceAssessment Assessment { get; init; }

The component licence evaluator’s result: status, message, count and details.

property InstallationIdConfigured #

public required bool InstallationIdConfigured { get; init; }

Whether an Installation identifier is configured.

property LedgerDurable #

public required bool LedgerDurable { get; init; }

true when the count comes from a durable ledger (PostgreSQL or MongoDB).

property LedgerIssue #

public string? LedgerIssue { get; init; }

Set when the ledger could not be read and the count fell back to the code catalogue.

property LicenceFilesLoaded #

public required int LicenceFilesLoaded { get; init; }

Licence files read and loaded.

property LicenceFilesNotLoaded #

public required int LicenceFilesNotLoaded { get; init; }

Licence files read and not loaded (the reasons are in the assessment details).

property Notice #

public required ComponentLicenceNotice Notice { get; init; }

The licence notice of WorkflowLicenceSnapshot.Assessment.

property NoticeHeadline #

public string NoticeHeadline { get; }

The short notice text: “Licensed to” the licensee, or the message of the notice case. Pass it to the SVG renderer, which writes it into every diagram.

property Sequence #

public required long Sequence { get; init; }

The evaluation number in this process, from 1.

property Warns #

public bool Warns { get; }

true while the status is one the monitor logs as a warning at startup and hourly: ComponentLicenceAssessment.Warns, every status but within-free-limit and record-matches. A warning refuses nothing.

class WorkflowLicenceState

public sealed class WorkflowLicenceState

The latest licence evaluation of this process; read by the health detail and the gauge.

Members

MemberKindSummary
WorkflowLicenceState()constructorCreates an instance of WorkflowLicenceState.
CurrentpropertyThe latest evaluation; null before the first one.

constructor WorkflowLicenceState() #

public WorkflowLicenceState()

Creates an instance of WorkflowLicenceState.

property Current #

public WorkflowLicenceSnapshot? Current { get; }

The latest evaluation; null before the first one.

namespace StellaOps.Workflow.Engine.Maps

TypeKindDescription
IWorkflowMapItemExecutionHandlerinterfaceRuns the body of a map item.
WorkflowMapAdvanceDecisionrecordWhether a completed step belongs to a map item, and the signal that resumes it.
WorkflowMapCompletedSignalDispatcherclassMaterializes a durable map when the runtime reaches it (MapCompleted pending signal) and publishes the completion signal the coordinator returns once every item has finished.
WorkflowMapCoordinatorclassOwns normalized map materialization, bounded item dispatch and deterministic fan-in.
WorkflowMapCreateRequestrecordA map execution to create with its items.
WorkflowMapExecutionPlanrecordThe frozen plan of a map: its workflow, bounds, policies and body.
WorkflowMapItemExecutionDecisionrecordThe next step of a map item: an activity, a nested map, or its end.
WorkflowMapItemExecutionRequestrecordA map item to run or resume.
WorkflowMapItemExecutionStaterecordThe progress of a map item.
WorkflowMapItemLeaserecordA claimed map item.
WorkflowMapItemSeedrecordAn item to create in a map.
WorkflowMapMaterializationItemPlanrecordAn item of a map plan.
WorkflowMapMaterializationPlanrecordA map to create: its plan and items.
WorkflowMapRuntimeExceptionclassRaised when a map breaks a runtime rule, such as MAP_BOUND_INVALID or MAP_ITEM_LIMIT_EXCEEDED.
WorkflowMapRuntimeServiceclassRuns map executions: creates a map and its items, leases ready items to workers within the concurrency limits, and records item progress and outcomes.
WorkflowRetryClassifierclassComputes the delay before a retry from a retry policy: fixed, exponential (doubling with each attempt) or the provider’s hint up to its maximum; capped at the maximum delay and spread by a deterministic jitter.

interface IWorkflowMapItemExecutionHandler

public interface IWorkflowMapItemExecutionHandler

Runs the body of a map item.

Members

MemberKindSummary
ExecuteMapItemAsync(WorkflowMapItemExecutionRequest, CancellationToken)methodRuns the item until it waits or ends.

method ExecuteMapItemAsync(WorkflowMapItemExecutionRequest, CancellationToken) #

Task<WorkflowMapItemExecutionDecision> ExecuteMapItemAsync(WorkflowMapItemExecutionRequest request, CancellationToken cancellationToken = default)

Runs the item until it waits or ends.

Parameters

  • request: The item.
  • cancellationToken: Cancels the operation.

Returns

What happens next.

record WorkflowMapAdvanceDecision

public sealed record WorkflowMapAdvanceDecision

Whether a completed step belongs to a map item, and the signal that resumes it.

Parameters

  • IsMapItem: Whether the step runs for a map item.
  • ResumeSignal: The signal that resumes the item, when there is one.

Members

MemberKindSummary
WorkflowMapAdvanceDecision(bool, WorkflowSignalEnvelope)constructorWhether a completed step belongs to a map item, and the signal that resumes it.
IsMapItempropertyWhether the step runs for a map item.
ResumeSignalpropertyThe signal that resumes the item, when there is one.

constructor WorkflowMapAdvanceDecision(bool, WorkflowSignalEnvelope) #

public WorkflowMapAdvanceDecision(bool IsMapItem, WorkflowSignalEnvelope? ResumeSignal)

Whether a completed step belongs to a map item, and the signal that resumes it.

Parameters

  • IsMapItem: Whether the step runs for a map item.
  • ResumeSignal: The signal that resumes the item, when there is one.

property IsMapItem #

public bool IsMapItem { get; init; }

Whether the step runs for a map item.

property ResumeSignal #

public WorkflowSignalEnvelope? ResumeSignal { get; init; }

The signal that resumes the item, when there is one.

class WorkflowMapCompletedSignalDispatcher

public sealed class WorkflowMapCompletedSignalDispatcher : IWorkflowPendingSignalDispatcher

Materializes a durable map when the runtime reaches it (MapCompleted pending signal) and publishes the completion signal the coordinator returns once every item has finished.

Members

MemberKindSummary
WorkflowMapCompletedSignalDispatcher(WorkflowMapCoordinator, IWorkflowSignalBus, IWorkflowRuntimeStateStore)constructorMaterializes a durable map when the runtime reaches it (MapCompleted pending signal) and publishes the completion signal the coordinator returns once every item has finished.
CanDispatch(WorkflowPendingSignalPlan)methodWhether this dispatcher sends a pending signal.
DispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken)methodDispatches the signal and returns the execution version the next signal must expect.

constructor WorkflowMapCompletedSignalDispatcher(WorkflowMapCoordinator, IWorkflowSignalBus, IWorkflowRuntimeStateStore) #

public WorkflowMapCompletedSignalDispatcher(WorkflowMapCoordinator coordinator, IWorkflowSignalBus signalBus, IWorkflowRuntimeStateStore runtimeStateStore)

Materializes a durable map when the runtime reaches it (MapCompleted pending signal) and publishes the completion signal the coordinator returns once every item has finished.

method CanDispatch(WorkflowPendingSignalPlan) #

public bool CanDispatch(WorkflowPendingSignalPlan pendingSignal)

Whether this dispatcher sends a pending signal.

Parameters

  • pendingSignal: The signal.

Returns

Whether it does.

method DispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken) #

public Task<long> DispatchAsync(string workflowInstanceId, WorkflowPendingSignalPlan pendingSignal, WorkflowRuntimeStateRecord runtimeState, CancellationToken cancellationToken = default)

Dispatches the signal and returns the execution version the next signal must expect.

class WorkflowMapCoordinator

public sealed class WorkflowMapCoordinator

Owns normalized map materialization, bounded item dispatch and deterministic fan-in. All mutations run in one Workflow mutation scope (the caller’s, when it has one) so a map item can never be visible without its durable activity dispatch, or terminal without the fan-in state that follows it.

Members

MemberKindSummary
WorkflowMapCoordinator(IWorkflowMapStore, IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, WorkflowMapRuntimeService, WorkflowExternalActivityDispatchService, IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory)constructorOwns normalized map materialization, bounded item dispatch and deterministic fan-in.
MaterializeAndDispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken)methodCreates the map a map step plans, in one change scope, and dispatches the items the capacity allows.
TryAdvanceCompletedStepAsync(string, string, IReadOnlyDictionary<string, JsonElement>, CancellationToken)methodAdvances the map item a completed step runs for, in one change scope: runs the item on, records its outcome, dispatches more items and builds the signal that resumes the item or completes the map.

constructor WorkflowMapCoordinator(IWorkflowMapStore, IWorkflowExternalActivityStore, IWorkflowMutationCoordinator, WorkflowMapRuntimeService, WorkflowExternalActivityDispatchService, IWorkflowRuntimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory) #

public WorkflowMapCoordinator(IWorkflowMapStore mapStore, IWorkflowExternalActivityStore activityStore, IWorkflowMutationCoordinator mutationCoordinator, WorkflowMapRuntimeService mapRuntimeService, WorkflowExternalActivityDispatchService activityDispatchService, IWorkflowRuntimeDefinitionStore runtimeDefinitionStore, IWorkflowRuntimeExecutionHandlerFactory executionHandlerFactory)

Owns normalized map materialization, bounded item dispatch and deterministic fan-in. All mutations run in one Workflow mutation scope (the caller’s, when it has one) so a map item can never be visible without its durable activity dispatch, or terminal without the fan-in state that follows it.

method MaterializeAndDispatchAsync(string, WorkflowPendingSignalPlan, WorkflowRuntimeStateRecord, CancellationToken) #

public Task<WorkflowSignalEnvelope?> MaterializeAndDispatchAsync(string workflowExecutionId, WorkflowPendingSignalPlan pendingSignal, WorkflowRuntimeStateRecord runtimeState, CancellationToken cancellationToken = default)

Creates the map a map step plans, in one change scope, and dispatches the items the capacity allows.

Parameters

  • workflowExecutionId: The execution.
  • pendingSignal: The map plan.
  • runtimeState: The runtime state of the execution.
  • cancellationToken: Cancels the operation.

Returns

The signal that completes the map step when the map is already complete; null while items run.

Exceptions

  • InvalidOperationException: The runtime state belongs to another execution, the root scope is missing, or the signal is not a map plan.

method TryAdvanceCompletedStepAsync(string, string, IReadOnlyDictionary<string, JsonElement>, CancellationToken) #

public Task<WorkflowMapAdvanceDecision> TryAdvanceCompletedStepAsync(string workflowExecutionId, string stepExecutionId, IReadOnlyDictionary<string, JsonElement> completionPayload, CancellationToken cancellationToken = default)

Advances the map item a completed step runs for, in one change scope: runs the item on, records its outcome, dispatches more items and builds the signal that resumes the item or completes the map.

Parameters

  • workflowExecutionId: The execution.
  • stepExecutionId: The completed step.
  • completionPayload: The completion payload of the step.
  • cancellationToken: Cancels the operation.

Returns

Whether the step runs for a map item, and the resume signal.

Exceptions

  • InvalidOperationException: The step or its map does not exist, belongs to another execution, or its item has no active lease.

record WorkflowMapCreateRequest

public sealed record WorkflowMapCreateRequest

A map execution to create with its items.

Parameters

  • MapExecutionId: The map execution.
  • WorkflowExecutionId: The execution.
  • ScopeExecutionId: The scope of the map.
  • StepExecutionId: The map step.
  • FanInPolicy: The fan-in policy.
  • FailurePolicy: The failure policy.
  • MinimumSucceeded: The items that must succeed under MIN_SUCCEEDED.
  • MaxConcurrency: The items in flight at once.
  • MaxItems: The items allowed.
  • MaxAggregateStateBytes: The size limit of the collected results, in bytes.
  • GlobalActivityClass: The class of activities whose concurrency is limited across all maps.
  • ExecutionPlanSha256: The SHA-256 of the map plan.
  • ExecutionPlanJson: The map plan, as JSON.
  • AbsoluteDeadlineAtUtc: The deadline of the map, in UTC.
  • Items: The items.

Members

MemberKindSummary
WorkflowMapCreateRequest(string, string, string, string, string, string, int?, int, int, int, string, string, string, DateTime?, IReadOnlyCollection<WorkflowMapItemSeed>)constructorA map execution to create with its items.
AbsoluteDeadlineAtUtcpropertyThe deadline of the map, in UTC.
ExecutionPlanJsonpropertyThe map plan, as JSON.
ExecutionPlanSha256propertyThe SHA-256 of the map plan.
FailurePolicypropertyThe failure policy.
FanInPolicypropertyThe fan-in policy.
GlobalActivityClasspropertyThe class of activities whose concurrency is limited across all maps.
ItemspropertyThe items.
MapExecutionIdpropertyThe map execution.
MaxAggregateStateBytespropertyThe size limit of the collected results, in bytes.
MaxConcurrencypropertyThe items in flight at once.
MaxItemspropertyThe items allowed.
MinimumSucceededpropertyThe items that must succeed under MIN_SUCCEEDED.
ScopeExecutionIdpropertyThe scope of the map.
StepExecutionIdpropertyThe map step.
WorkflowExecutionIdpropertyThe execution.

constructor WorkflowMapCreateRequest(string, string, string, string, string, string, int?, int, int, int, string, string, string, DateTime?, IReadOnlyCollection<WorkflowMapItemSeed>) #

public WorkflowMapCreateRequest(string MapExecutionId, string WorkflowExecutionId, string ScopeExecutionId, string StepExecutionId, string FanInPolicy, string FailurePolicy, int? MinimumSucceeded, int MaxConcurrency, int MaxItems, int MaxAggregateStateBytes, string? GlobalActivityClass, string ExecutionPlanSha256, string ExecutionPlanJson, DateTime? AbsoluteDeadlineAtUtc, IReadOnlyCollection<WorkflowMapItemSeed> Items)

A map execution to create with its items.

Parameters

  • MapExecutionId: The map execution.
  • WorkflowExecutionId: The execution.
  • ScopeExecutionId: The scope of the map.
  • StepExecutionId: The map step.
  • FanInPolicy: The fan-in policy.
  • FailurePolicy: The failure policy.
  • MinimumSucceeded: The items that must succeed under MIN_SUCCEEDED.
  • MaxConcurrency: The items in flight at once.
  • MaxItems: The items allowed.
  • MaxAggregateStateBytes: The size limit of the collected results, in bytes.
  • GlobalActivityClass: The class of activities whose concurrency is limited across all maps.
  • ExecutionPlanSha256: The SHA-256 of the map plan.
  • ExecutionPlanJson: The map plan, as JSON.
  • AbsoluteDeadlineAtUtc: The deadline of the map, in UTC.
  • Items: The items.

property AbsoluteDeadlineAtUtc #

public DateTime? AbsoluteDeadlineAtUtc { get; init; }

The deadline of the map, in UTC.

property ExecutionPlanJson #

public string ExecutionPlanJson { get; init; }

The map plan, as JSON.

property ExecutionPlanSha256 #

public string ExecutionPlanSha256 { get; init; }

The SHA-256 of the map plan.

property FailurePolicy #

public string FailurePolicy { get; init; }

The failure policy.

property FanInPolicy #

public string FanInPolicy { get; init; }

The fan-in policy.

property GlobalActivityClass #

public string? GlobalActivityClass { get; init; }

The class of activities whose concurrency is limited across all maps.

property Items #

public IReadOnlyCollection<WorkflowMapItemSeed> Items { get; init; }

The items.

property MapExecutionId #

public string MapExecutionId { get; init; }

The map execution.

property MaxAggregateStateBytes #

public int MaxAggregateStateBytes { get; init; }

The size limit of the collected results, in bytes.

property MaxConcurrency #

public int MaxConcurrency { get; init; }

The items in flight at once.

property MaxItems #

public int MaxItems { get; init; }

The items allowed.

property MinimumSucceeded #

public int? MinimumSucceeded { get; init; }

The items that must succeed under MIN_SUCCEEDED.

property ScopeExecutionId #

public string ScopeExecutionId { get; init; }

The scope of the map.

property StepExecutionId #

public string StepExecutionId { get; init; }

The map step.

property WorkflowExecutionId #

public string WorkflowExecutionId { get; init; }

The execution.

record WorkflowMapExecutionPlan

public sealed record WorkflowMapExecutionPlan

The frozen plan of a map: its workflow, bounds, policies and body.

Members

MemberKindSummary
WorkflowMapExecutionPlan()constructorCreates an instance of WorkflowMapExecutionPlan.
AbsoluteDeadlineAtUtcpropertyThe deadline of the map, in UTC.
BodyResumePointerpropertyWhere the body starts.
FailurePolicypropertyThe failure policy.
FanInPolicypropertyThe fan-in policy.
GlobalActivityClasspropertyThe class of activities whose concurrency is limited across all maps.
ItemResultExpressionpropertyThe result of an item, evaluated after its body.
ItemStateKeypropertyThe state key that holds the current item.
MapStepExecutionIdpropertyThe map step.
MaxAggregateStateBytespropertyThe size limit of the collected results, in bytes.
MaxConcurrencypropertyThe items in flight at once.
MaxItemspropertyThe items allowed.
MinimumSucceededpropertyThe items that must succeed under MIN_SUCCEEDED.
RetryPolicypropertyThe retry policy of an item.
StepNamepropertyThe step name.
WorkflowNamepropertyThe workflow name.
WorkflowVersionpropertyThe workflow version.

constructor WorkflowMapExecutionPlan() #

public WorkflowMapExecutionPlan()

Creates an instance of WorkflowMapExecutionPlan.

property AbsoluteDeadlineAtUtc #

public DateTime? AbsoluteDeadlineAtUtc { get; init; }

The deadline of the map, in UTC.

property BodyResumePointer #

public required JsonElement BodyResumePointer { get; init; }

Where the body starts.

property FailurePolicy #

public required string FailurePolicy { get; init; }

The failure policy.

property FanInPolicy #

public required string FanInPolicy { get; init; }

The fan-in policy.

property GlobalActivityClass #

public string? GlobalActivityClass { get; init; }

The class of activities whose concurrency is limited across all maps.

property ItemResultExpression #

public required WorkflowExpressionDefinition ItemResultExpression { get; init; }

The result of an item, evaluated after its body.

property ItemStateKey #

public required string ItemStateKey { get; init; }

The state key that holds the current item.

property MapStepExecutionId #

public required string MapStepExecutionId { get; init; }

The map step.

property MaxAggregateStateBytes #

public required int MaxAggregateStateBytes { get; init; }

The size limit of the collected results, in bytes.

property MaxConcurrency #

public required int MaxConcurrency { get; init; }

The items in flight at once.

property MaxItems #

public required int MaxItems { get; init; }

The items allowed.

property MinimumSucceeded #

public int? MinimumSucceeded { get; init; }

The items that must succeed under MIN_SUCCEEDED.

property RetryPolicy #

public required WorkflowRetryPolicyDeclaration RetryPolicy { get; init; }

The retry policy of an item.

property StepName #

public required string StepName { get; init; }

The step name.

property WorkflowName #

public required string WorkflowName { get; init; }

The workflow name.

property WorkflowVersion #

public required string WorkflowVersion { get; init; }

The workflow version.

record WorkflowMapItemExecutionDecision

public sealed record WorkflowMapItemExecutionDecision

The next step of a map item: an activity, a nested map, or its end.

Members

MemberKindSummary
WorkflowMapItemExecutionDecision()constructorCreates an instance of WorkflowMapItemExecutionDecision.
ExecutionStatepropertyThe progress after the step.
IsTerminalpropertyWhether the item ended.
PendingActivitypropertyAn activity to dispatch.
PendingMappropertyA nested map to create.
SafeResultDescriptorpropertyThe safe result descriptor.
TerminalOutcomepropertyThe final outcome, when the item ended.

constructor WorkflowMapItemExecutionDecision() #

public WorkflowMapItemExecutionDecision()

Creates an instance of WorkflowMapItemExecutionDecision.

property ExecutionState #

public required WorkflowMapItemExecutionState ExecutionState { get; init; }

The progress after the step.

property IsTerminal #

public bool IsTerminal { get; }

Whether the item ended.

property PendingActivity #

public WorkflowPendingSignalPlan? PendingActivity { get; init; }

An activity to dispatch.

property PendingMap #

public WorkflowPendingSignalPlan? PendingMap { get; init; }

A nested map to create.

property SafeResultDescriptor #

public JsonElement? SafeResultDescriptor { get; init; }

The safe result descriptor.

property TerminalOutcome #

public string? TerminalOutcome { get; init; }

The final outcome, when the item ended.

record WorkflowMapItemExecutionRequest

public sealed record WorkflowMapItemExecutionRequest

A map item to run or resume.

Members

MemberKindSummary
WorkflowMapItemExecutionRequest()constructorCreates an instance of WorkflowMapItemExecutionRequest.
BusinessReferencepropertyThe business reference.
CompletionPayloadpropertyThe payload of the completion that resumes the item.
CompletionSignalTypepropertyThe type of the signal that resumes the item.
ExecutionPlanpropertyThe map plan.
ItemDescriptorpropertyThe item descriptor.
PriorExecutionStatepropertyThe progress so far, when the item resumes.
RootWorkflowStatepropertyThe state of the execution.

constructor WorkflowMapItemExecutionRequest() #

public WorkflowMapItemExecutionRequest()

Creates an instance of WorkflowMapItemExecutionRequest.

property BusinessReference #

public WorkflowBusinessReference? BusinessReference { get; init; }

The business reference.

property CompletionPayload #

public IReadOnlyDictionary<string, JsonElement>? CompletionPayload { get; init; }

The payload of the completion that resumes the item.

property CompletionSignalType #

public string? CompletionSignalType { get; init; }

The type of the signal that resumes the item.

property ExecutionPlan #

public required WorkflowMapExecutionPlan ExecutionPlan { get; init; }

The map plan.

property ItemDescriptor #

public required JsonElement ItemDescriptor { get; init; }

The item descriptor.

property PriorExecutionState #

public WorkflowMapItemExecutionState? PriorExecutionState { get; init; }

The progress so far, when the item resumes.

property RootWorkflowState #

public required IReadOnlyDictionary<string, JsonElement> RootWorkflowState { get; init; }

The state of the execution.

record WorkflowMapItemExecutionState

public sealed record WorkflowMapItemExecutionState

The progress of a map item.

Members

MemberKindSummary
WorkflowMapItemExecutionState()constructorCreates an instance of WorkflowMapItemExecutionState.
ResumeStatepropertyWhere the body resumes.
WorkflowStatepropertyThe item state.

constructor WorkflowMapItemExecutionState() #

public WorkflowMapItemExecutionState()

Creates an instance of WorkflowMapItemExecutionState.

property ResumeState #

public IReadOnlyDictionary<string, JsonElement> ResumeState { get; init; }

Where the body resumes.

property WorkflowState #

public IReadOnlyDictionary<string, JsonElement> WorkflowState { get; init; }

The item state.

record WorkflowMapItemLease

public sealed record WorkflowMapItemLease

A claimed map item.

Parameters

  • MapItemId: The map item.
  • ItemKey: The item key.
  • Ordinal: The position of the item.
  • ClaimFence: The claim fence.
  • DescriptorSha256: The SHA-256 of the descriptor.
  • DescriptorJson: The item descriptor, as JSON.

Members

MemberKindSummary
WorkflowMapItemLease(string, string, int, long, string, string)constructorA claimed map item.
ClaimFencepropertyThe claim fence.
DescriptorJsonpropertyThe item descriptor, as JSON.
DescriptorSha256propertyThe SHA-256 of the descriptor.
ItemKeypropertyThe item key.
MapItemIdpropertyThe map item.
OrdinalpropertyThe position of the item.

constructor WorkflowMapItemLease(string, string, int, long, string, string) #

public WorkflowMapItemLease(string MapItemId, string ItemKey, int Ordinal, long ClaimFence, string DescriptorSha256, string DescriptorJson)

A claimed map item.

Parameters

  • MapItemId: The map item.
  • ItemKey: The item key.
  • Ordinal: The position of the item.
  • ClaimFence: The claim fence.
  • DescriptorSha256: The SHA-256 of the descriptor.
  • DescriptorJson: The item descriptor, as JSON.

property ClaimFence #

public long ClaimFence { get; init; }

The claim fence.

property DescriptorJson #

public string DescriptorJson { get; init; }

The item descriptor, as JSON.

property DescriptorSha256 #

public string DescriptorSha256 { get; init; }

The SHA-256 of the descriptor.

property ItemKey #

public string ItemKey { get; init; }

The item key.

property MapItemId #

public string MapItemId { get; init; }

The map item.

property Ordinal #

public int Ordinal { get; init; }

The position of the item.

record WorkflowMapItemSeed

public sealed record WorkflowMapItemSeed

An item to create in a map.

Parameters

  • ItemKey: The item key.
  • DescriptorSha256: The SHA-256 of the descriptor.
  • DescriptorJson: The item descriptor, as JSON.

Members

MemberKindSummary
WorkflowMapItemSeed(string, string, string)constructorAn item to create in a map.
DescriptorJsonpropertyThe item descriptor, as JSON.
DescriptorSha256propertyThe SHA-256 of the descriptor.
ItemKeypropertyThe item key.

constructor WorkflowMapItemSeed(string, string, string) #

public WorkflowMapItemSeed(string ItemKey, string DescriptorSha256, string DescriptorJson)

An item to create in a map.

Parameters

  • ItemKey: The item key.
  • DescriptorSha256: The SHA-256 of the descriptor.
  • DescriptorJson: The item descriptor, as JSON.

property DescriptorJson #

public string DescriptorJson { get; init; }

The item descriptor, as JSON.

property DescriptorSha256 #

public string DescriptorSha256 { get; init; }

The SHA-256 of the descriptor.

property ItemKey #

public string ItemKey { get; init; }

The item key.

record WorkflowMapMaterializationItemPlan

public sealed record WorkflowMapMaterializationItemPlan

An item of a map plan.

Members

MemberKindSummary
WorkflowMapMaterializationItemPlan()constructorCreates an instance of WorkflowMapMaterializationItemPlan.
DescriptorJsonpropertyThe item descriptor, as JSON.
DescriptorSha256propertyThe SHA-256 of the descriptor.
ItemKeypropertyThe item key.
OrdinalpropertyThe position of the item.

constructor WorkflowMapMaterializationItemPlan() #

public WorkflowMapMaterializationItemPlan()

Creates an instance of WorkflowMapMaterializationItemPlan.

property DescriptorJson #

public required string DescriptorJson { get; init; }

The item descriptor, as JSON.

property DescriptorSha256 #

public required string DescriptorSha256 { get; init; }

The SHA-256 of the descriptor.

property ItemKey #

public required string ItemKey { get; init; }

The item key.

property Ordinal #

public required int Ordinal { get; init; }

The position of the item.

record WorkflowMapMaterializationPlan

public sealed record WorkflowMapMaterializationPlan

A map to create: its plan and items.

Members

MemberKindSummary
WorkflowMapMaterializationPlan()constructorCreates an instance of WorkflowMapMaterializationPlan.
ExecutionPlanpropertyThe plan.
ItemspropertyThe items.
MapExecutionIdpropertyThe map execution.

constructor WorkflowMapMaterializationPlan() #

public WorkflowMapMaterializationPlan()

Creates an instance of WorkflowMapMaterializationPlan.

property ExecutionPlan #

public required WorkflowMapExecutionPlan ExecutionPlan { get; init; }

The plan.

property Items #

public IReadOnlyCollection<WorkflowMapMaterializationItemPlan> Items { get; init; }

The items.

property MapExecutionId #

public required string MapExecutionId { get; init; }

The map execution.

class WorkflowMapRuntimeException

public sealed class WorkflowMapRuntimeException : Exception

Raised when a map breaks a runtime rule, such as MAP_BOUND_INVALID or MAP_ITEM_LIMIT_EXCEEDED.

Parameters

  • code: The code.

Members

MemberKindSummary
WorkflowMapRuntimeException(string)constructorRaised when a map breaks a runtime rule, such as MAP_BOUND_INVALID or MAP_ITEM_LIMIT_EXCEEDED.
CodepropertyThe code.

constructor WorkflowMapRuntimeException(string) #

public WorkflowMapRuntimeException(string code)

Raised when a map breaks a runtime rule, such as MAP_BOUND_INVALID or MAP_ITEM_LIMIT_EXCEEDED.

Parameters

  • code: The code.

property Code #

public string Code { get; }

The code.

class WorkflowMapRuntimeService

public sealed class WorkflowMapRuntimeService

Runs map executions: creates a map and its items, leases ready items to workers within the concurrency limits, and records item progress and outcomes.

Members

MemberKindSummary
WorkflowMapRuntimeService(IWorkflowMapStore, TimeProvider)constructorCreates the service with the default runtime options.
WorkflowMapRuntimeService(IWorkflowMapStore, TimeProvider, IOptions<WorkflowRuntimeOptions>)constructorCreates the service.
ClaimReadyAsync(string, string, int, TimeSpan, CancellationToken)methodLeases ready items to a worker, up to the free capacity: the smaller of the map’s MaxConcurrency and the runtime’s MaxMapConcurrency, less the active claims, and for a global activity class also the class limit less its active claims.
CompleteItemAsync(string, string, long, string, string, CancellationToken)methodRecords the outcome of a leased item and recalculates the map.
CreateAsync(WorkflowMapCreateRequest, CancellationToken)methodCreates a map and its items, each READY, with the id {map}:{ordinal}.
UpdateItemProgressAsync(string, string, long, string, string, CancellationToken)methodRecords the running step and the execution state of a leased item.

constructor WorkflowMapRuntimeService(IWorkflowMapStore, TimeProvider) #

public WorkflowMapRuntimeService(IWorkflowMapStore store, TimeProvider timeProvider)

Creates the service with the default runtime options.

Parameters

  • store: The map store.
  • timeProvider: The clock.

constructor WorkflowMapRuntimeService(IWorkflowMapStore, TimeProvider, IOptions<WorkflowRuntimeOptions>) #

public WorkflowMapRuntimeService(IWorkflowMapStore store, TimeProvider timeProvider, IOptions<WorkflowRuntimeOptions> options)

Creates the service.

Parameters

  • store: The map store.
  • timeProvider: The clock.
  • options: The runtime options; MaxMapConcurrency caps the items in flight.

method ClaimReadyAsync(string, string, int, TimeSpan, CancellationToken) #

public Task<IReadOnlyCollection<WorkflowMapItemLease>> ClaimReadyAsync(string mapExecutionId, string claimOwner, int requestedCount, TimeSpan leaseDuration, CancellationToken cancellationToken = default)

Leases ready items to a worker, up to the free capacity: the smaller of the map’s MaxConcurrency and the runtime’s MaxMapConcurrency, less the active claims, and for a global activity class also the class limit less its active claims. A map that is not ready or running leases nothing.

Parameters

  • mapExecutionId: The map.
  • claimOwner: The worker.
  • requestedCount: The most items to lease; positive.
  • leaseDuration: How long a lease lasts; positive.
  • cancellationToken: Cancels the operation.

Returns

The leased items.

Exceptions

  • ArgumentOutOfRangeException: The count or the duration is not positive.

method CompleteItemAsync(string, string, long, string, string, CancellationToken) #

public Task CompleteItemAsync(string mapItemId, string claimOwner, long claimFence, string outcome, string? safeResultDescriptorJson, CancellationToken cancellationToken = default)

Records the outcome of a leased item and recalculates the map.

Parameters

  • mapItemId: The map item.
  • claimOwner: The worker that holds the lease.
  • claimFence: The claim fence of the lease.
  • outcome: SUCCEEDED, PARTIAL, SKIPPED or FAILED.
  • safeResultDescriptorJson: The result descriptor of the item, as JSON; none when not set.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the outcome is recorded.

Exceptions

  • WorkflowMapRuntimeException: The outcome is not one of the four, the lease is not current, or the collected state would exceed MaxAggregateStateBytes.

method CreateAsync(WorkflowMapCreateRequest, CancellationToken) #

public Task<WorkflowMapExecutionRecord> CreateAsync(WorkflowMapCreateRequest request, CancellationToken cancellationToken = default)

Creates a map and its items, each READY, with the id {map}:{ordinal}. A map without items completes at once, or fails under MIN_SUCCEEDED. A map already created under its id is returned when the request is the same.

Parameters

  • request: The map and its items.
  • cancellationToken: Cancels the operation.

Returns

The map.

Exceptions

  • WorkflowMapRuntimeException: More items than MaxItems (MAP_ITEM_LIMIT_EXCEEDED), a repeated item key, or descriptors over MaxAggregateStateBytes.

method UpdateItemProgressAsync(string, string, long, string, string, CancellationToken) #

public Task UpdateItemProgressAsync(string mapItemId, string claimOwner, long claimFence, string activeStepExecutionId, string executionStateJson, CancellationToken cancellationToken = default)

Records the running step and the execution state of a leased item.

Parameters

  • mapItemId: The map item.
  • claimOwner: The worker that holds the lease.
  • claimFence: The claim fence of the lease.
  • activeStepExecutionId: The running step.
  • executionStateJson: The execution state of the item, as JSON.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the progress is recorded.

Exceptions

class WorkflowRetryClassifier

public static class WorkflowRetryClassifier

Computes the delay before a retry from a retry policy: fixed, exponential (doubling with each attempt) or the provider’s hint up to its maximum; capped at the maximum delay and spread by a deterministic jitter.

Members

MemberKindSummary
GetDelay(WorkflowRetryPolicyDeclaration, int, string, TimeSpan?, int)methodThe delay before the next retry, or null when no retry is left or the category is not retryable.

method GetDelay(WorkflowRetryPolicyDeclaration, int, string, TimeSpan?, int) #

public static TimeSpan? GetDelay(WorkflowRetryPolicyDeclaration policy, int completedSemanticAttempts, string failureCategory, TimeSpan? providerHint, int deterministicJitterSeed)

The delay before the next retry, or null when no retry is left or the category is not retryable.

Parameters

  • policy: The retry policy.
  • completedSemanticAttempts: The attempts made.
  • failureCategory: The failure category.
  • providerHint: The delay the provider asked for.
  • deterministicJitterSeed: The seed of the deterministic jitter.

Returns

The delay, or null.

namespace StellaOps.Workflow.Engine.Observability

TypeKindDescription
WorkflowMetricCatalogclassThe metric names reserved for the Workflow engine.
WorkflowMetricLabelPolicyclassThe metric labels the engine allows, so that no metric carries an unbounded label.
WorkflowObservabilityclassThe engine’s meter and activity source (StellaOps.Workflow): console requests and their duration, and terminal transitions.

class WorkflowMetricCatalog

public static class WorkflowMetricCatalog

The metric names reserved for the Workflow engine. The engine emits workflow.console.requests, workflow.console.duration.ms and workflow.execution.terminal.

Members

MemberKindSummary
NamesfieldThe names.

field Names #

public static readonly IReadOnlyCollection<string> Names

The names.

class WorkflowMetricLabelPolicy

public static class WorkflowMetricLabelPolicy

The metric labels the engine allows, so that no metric carries an unbounded label.

Members

MemberKindSummary
Validate(IEnumerable<KeyValuePair<string, object>>)methodChecks that every label is allowed.

method Validate(IEnumerable<KeyValuePair<string, object>>) #

public static void Validate(IEnumerable<KeyValuePair<string, object?>> labels)

Checks that every label is allowed.

Parameters

  • labels: The labels.

Exceptions

  • InvalidOperationException: A label is not allowed.

class WorkflowObservability

public sealed class WorkflowObservability : IDisposable

The engine’s meter and activity source (StellaOps.Workflow): console requests and their duration, and terminal transitions.

Members

MemberKindSummary
WorkflowObservability()constructorCreates an instance of WorkflowObservability.
ActivitySourcefieldThe activity source.
InstrumentationNameconstantThe meter and activity source name.
Dispose()methodDisposes the meter.
ObserveConsole(string, string)methodCounts an execution console request and times it until the result is disposed.
RecordTerminal(string, string)methodCounts a terminal transition of an execution.

constructor WorkflowObservability() #

public WorkflowObservability()

Creates an instance of WorkflowObservability.

field ActivitySource #

public static readonly ActivitySource ActivitySource

The activity source.

constant InstrumentationName #

public const string InstrumentationName = "StellaOps.Workflow"

The meter and activity source name.

method Dispose() #

public void Dispose()

Disposes the meter.

method ObserveConsole(string, string) #

public IDisposable ObserveConsole(string operation, string profile)

Counts an execution console request and times it until the result is disposed.

Parameters

  • operation: The console operation.
  • profile: The console profile.

Returns

Ends the timing when disposed.

method RecordTerminal(string, string) #

public void RecordTerminal(string definition, string outcome)

Counts a terminal transition of an execution.

Parameters

  • definition: The workflow definition.
  • outcome: The outcome.

namespace StellaOps.Workflow.Engine.Rendering

TypeKindDescription
WorkflowRenderGraphCompilerclassBuilds the render graph of a workflow definition: its start, steps, tasks and branches as nodes, and the flow between them as edges.
WorkflowRenderLayoutEngineResolverclassSelects a registered layout engine by provider name, ignoring case.

class WorkflowRenderGraphCompiler

public sealed class WorkflowRenderGraphCompiler : IWorkflowRenderGraphCompiler

Builds the render graph of a workflow definition: its start, steps, tasks and branches as nodes, and the flow between them as edges.

Members

MemberKindSummary
WorkflowRenderGraphCompiler()constructorCreates an instance of WorkflowRenderGraphCompiler.
Compile(WorkflowRuntimeDefinition)methodBuilds the render graph of a workflow definition.

constructor WorkflowRenderGraphCompiler() #

public WorkflowRenderGraphCompiler()

Creates an instance of WorkflowRenderGraphCompiler.

method Compile(WorkflowRuntimeDefinition) #

public WorkflowRenderGraph Compile(WorkflowRuntimeDefinition definition)

Builds the render graph of a workflow definition.

Parameters

  • definition: The workflow definition.

Returns

The render graph.

class WorkflowRenderLayoutEngineResolver

public sealed class WorkflowRenderLayoutEngineResolver : IWorkflowRenderLayoutEngineResolver

Selects a registered layout engine by provider name, ignoring case.

Parameters

  • engines: The registered layout engines.
  • options: The rendering options, with the default provider.

Members

MemberKindSummary
WorkflowRenderLayoutEngineResolver(IEnumerable<INamedWorkflowRenderGraphLayoutEngine>, IOptions<WorkflowRenderingOptions>)constructorSelects a registered layout engine by provider name, ignoring case.
Resolve(string)methodReturns the registered layout engine of a provider: providerName, else WorkflowRendering:LayoutProvider, else ElkSharp.

constructor WorkflowRenderLayoutEngineResolver(IEnumerable<INamedWorkflowRenderGraphLayoutEngine>, IOptions<WorkflowRenderingOptions>) #

public WorkflowRenderLayoutEngineResolver(IEnumerable<INamedWorkflowRenderGraphLayoutEngine> engines, IOptions<WorkflowRenderingOptions> options)

Selects a registered layout engine by provider name, ignoring case.

Parameters

  • engines: The registered layout engines.
  • options: The rendering options, with the default provider.

method Resolve(string) #

public INamedWorkflowRenderGraphLayoutEngine Resolve(string? providerName = null)

Returns the registered layout engine of a provider: providerName, else WorkflowRendering:LayoutProvider, else ElkSharp.

Parameters

  • providerName: The provider name; the configured provider when not set.

Returns

The layout engine.

Exceptions

  • InvalidOperationException: No engine of that provider is registered.

namespace StellaOps.Workflow.Engine.Scheduling

TypeKindDescription
NullWorkflowScheduleBusclassThe schedule bus of a host without scheduling: every call raises NotSupportedException.
NullWorkflowSignalSchedulerclassThe signal scheduler of a host without a signal store: it logs a warning and stores nothing.
WorkflowScheduleBusBridgeclassThe schedule bus over the registered signal scheduler.

class NullWorkflowScheduleBus

public sealed class NullWorkflowScheduleBus : IWorkflowScheduleBus

The schedule bus of a host without scheduling: every call raises NotSupportedException.

Members

MemberKindSummary
NullWorkflowScheduleBus()constructorCreates an instance of NullWorkflowScheduleBus.
ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken)methodStores a signal that becomes available at dueAtUtc.

constructor NullWorkflowScheduleBus() #

public NullWorkflowScheduleBus()

Creates an instance of NullWorkflowScheduleBus.

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 NullWorkflowSignalScheduler

public sealed class NullWorkflowSignalScheduler : IWorkflowSignalScheduler

The signal scheduler of a host without a signal store: it logs a warning and stores nothing.

Parameters

  • logger: Receives the warnings.

Members

MemberKindSummary
NullWorkflowSignalScheduler(ILogger<NullWorkflowSignalScheduler>)constructorThe signal scheduler of a host without a signal store: it logs a warning and stores nothing.
ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken)methodStores a signal that becomes available at dueAtUtc.

constructor NullWorkflowSignalScheduler(ILogger<NullWorkflowSignalScheduler>) #

public NullWorkflowSignalScheduler(ILogger<NullWorkflowSignalScheduler> logger)

The signal scheduler of a host without a signal store: it logs a warning and stores nothing.

Parameters

  • logger: Receives the warnings.

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 WorkflowScheduleBusBridge

public sealed class WorkflowScheduleBusBridge : IWorkflowScheduleBus

The schedule bus over the registered signal scheduler.

Parameters

  • signalScheduler: Stores the scheduled signals.

Members

MemberKindSummary
WorkflowScheduleBusBridge(IWorkflowSignalScheduler)constructorThe schedule bus over the registered signal scheduler.
ScheduleAsync(WorkflowSignalEnvelope, DateTime, CancellationToken)methodStores a signal that becomes available at dueAtUtc.

constructor WorkflowScheduleBusBridge(IWorkflowSignalScheduler) #

public WorkflowScheduleBusBridge(IWorkflowSignalScheduler signalScheduler)

The schedule bus over the registered signal scheduler.

Parameters

  • signalScheduler: Stores the scheduled signals.

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.

namespace StellaOps.Workflow.Engine.Services

TypeKindDescription
DeclarativeWorkflowExecutionHandler<TWorkflow, TStartRequest>classRuns a declarative workflow class: starts, task completions and signal resumes.
DefaultWorkflowAssignmentPermissionEvaluatorclassThe default assignment rules: an actor in the effective roles (ignoring case) may assign a task to itself; assigning to another actor needs a permissions plugin; only the assignee may release; the assignee or an actor in the effective roles may complete.
GenericAssignmentPermissionEvaluatorclassA permission evaluator that recognizes configured admin roles.
GenericAssignmentPermissionOptionsclassOptions for the generic assignment permission evaluator.
InMemoryWorkflowDefinitionStoreclassIn-process definition store.
InMemoryWorkflowHostedJobLockServiceclassAn in-process hosted job lock, for a single-node host.
InMemoryWorkflowRuntimeStateStoreclassKeeps runtime states in process memory, the default when no store library registers a store; instance ids compare ignoring case, and the states end with the process.
InProcessWorkflowRuntimeOrchestratorclassThe Stella.InProcess runtime: runs the execution handler of a workflow in the calling process.
NullWorkflowDefinitionStoreclassUnsupported definition store used only as a local/test fallback until a backend-specific store is registered.
UnconfiguredWorkflowEndpointTransportclassThe endpoint transport used when none is configured: every call fails with an error that names the service and the route.
UnconfiguredWorkflowGraphqlTransportclassThe GraphQL transport used when none is configured: every call fails with an error that names the target.
UnconfiguredWorkflowHttpTransportclassThe HTTP transport used when none is configured: every call fails with an error that names the method, the target and the path.
UnconfiguredWorkflowRabbitTransportclassThe RabbitMQ transport used when none is configured: every call fails with an error that names the exchange and the routing key.
WorkflowBundledDefinitionstructA workflow an assembly ships as an embedded bundled *.definition.json.
WorkflowBundledDefinitionCoveragerecordHow many of an assembly’s bundled definitions its registrations cover, and which ones they miss.
WorkflowBundledDefinitionsclassReads the bundled definitions a workflow assembly embeds and compares them with what the assembly registered, so a host can refuse to report ready when a workflow it ships is not registered under its name and version.
WorkflowCanonicalDefinitionServiceclassServes the canonical definition schema and validates definitions.
WorkflowCanonicalJsonSchemaclassThe JSON schema of canonical workflow definitions.
WorkflowConsoleOptionsclassWhat the execution console shows of an instance’s state, per profile (WorkflowConsole).
WorkflowCoreServiceCollectionExtensionsclassRegisters the core services of the workflow engine.
WorkflowDefinitionCatalogclassThe definition descriptors of the registered workflows.
WorkflowDefinitionDeploymentServiceclassHandles import, export, versioning, and activation of canonical workflow definitions.
WorkflowDefinitionQueryServiceclassQueries the workflow definitions known to the engine: bundled in the catalog and imported into the store.
WorkflowDefinitionRenderServiceclassLays out the diagram of a registered definition.
WorkflowDiagramServiceclassLays out workflow diagrams, with the progress of an instance when the request names one.
WorkflowDurableServiceCollectionExtensionsclassRegisters the durable engine features.
WorkflowExecutionConsoleServiceclassThe execution console: lists executions and reads their resources for one profile.
WorkflowExecutionHandlerCatalogclassFinds the execution handler of a registered workflow: its registered handler type, else a declarative handler when the workflow is declarative.
WorkflowFunctionCatalogServiceclassServes the function catalog.
WorkflowMutationScopeAccessorclassHolds the change scope of the running operation.
WorkflowRegistrationCatalogclassThe registered workflows, ordered by name and then by version, newest first; names and versions compare ignoring case.
WorkflowRetentionHostedJobOptionsclassThe schedule of the retention job (WorkflowRetentionHostedJob), which marks stale instances and tasks and purges expired ones.
WorkflowRetentionOptionsclassWhen the retention job marks an open instance stale and purges a completed one (WorkflowRetention).
WorkflowRetentionRunResultrecordThe counts of a retention run.
WorkflowRetentionServiceclassRuns the instance retention: marks stale and purges projections and runtime states.
WorkflowRoleResolutionServiceclassComputes the roles that may work a task.
WorkflowRuntimeServiceclassThe engine’s workflow runtime: starts instances, reads instances and tasks, completes, assigns and releases tasks, raises signals, cancels instances, and resumes instances with signals.
WorkflowSignalDeadLetterServiceclassLists and replays dead-lettered signals.
WorkflowSignalPumpTelemetryServiceclassCounts the signal pump’s work in this process, for the pump statistics.
WorkflowStudioDescriptorclassDescribes the workflow service to tools.
WorkflowStudioOptionsclassNames the host and its diagram provider in the workflow service metadata.
WorkflowTaskCreationNotifierclassSingleton notification service that allows CompleteTaskAsync to block until the signal pump creates the next user task for a workflow instance.

class DeclarativeWorkflowExecutionHandler<TWorkflow, TStartRequest>

public sealed class DeclarativeWorkflowExecutionHandler<TWorkflow, TStartRequest> : IWorkflowExecutionHandler, IWorkflowSignalResumableExecutionHandler where TWorkflow : class, IDeclarativeWorkflow<TStartRequest>, new() where TStartRequest : class

Runs a declarative workflow class: starts, task completions and signal resumes.

Type parameters

  • TWorkflow: The workflow class.
  • TStartRequest: The start request type.

Parameters

  • endpointTransport: The endpoint transport.
  • graphqlTransport: The GraphQL transport.
  • httpTransport: The HTTP transport.
  • rabbitTransport: The RabbitMQ transport.
  • workflowFunctionRuntime: Evaluates the expression functions.
  • workflowExecutionHandlerCatalog: Finds the handlers of child and parent workflows.
  • workflowRegistrationCatalog: The registered workflows, for child workflows.

Members

MemberKindSummary
DeclarativeWorkflowExecutionHandler(IWorkflowEndpointTransport, IWorkflowGraphqlTransport, IWorkflowHttpTransport, IWorkflowRabbitTransport, IWorkflowFunctionRuntime, IWorkflowExecutionHandlerCatalog, IWorkflowRegistrationCatalog)constructorRuns a declarative workflow class: starts, task completions and signal resumes.
CompleteTaskAsync(WorkflowTaskExecutionContext, CancellationToken)methodPlans the completion of a task.
StartAsync(WorkflowStartExecutionContext, CancellationToken)methodPlans the start of an instance.

constructor DeclarativeWorkflowExecutionHandler(IWorkflowEndpointTransport, IWorkflowGraphqlTransport, IWorkflowHttpTransport, IWorkflowRabbitTransport, IWorkflowFunctionRuntime, IWorkflowExecutionHandlerCatalog, IWorkflowRegistrationCatalog) #

public DeclarativeWorkflowExecutionHandler(IWorkflowEndpointTransport endpointTransport, IWorkflowGraphqlTransport graphqlTransport, IWorkflowHttpTransport httpTransport, IWorkflowRabbitTransport rabbitTransport, IWorkflowFunctionRuntime workflowFunctionRuntime, IWorkflowExecutionHandlerCatalog workflowExecutionHandlerCatalog, IWorkflowRegistrationCatalog workflowRegistrationCatalog)

Runs a declarative workflow class: starts, task completions and signal resumes.

Type parameters

  • TWorkflow: The workflow class.
  • TStartRequest: The start request type.

Parameters

  • endpointTransport: The endpoint transport.
  • graphqlTransport: The GraphQL transport.
  • httpTransport: The HTTP transport.
  • rabbitTransport: The RabbitMQ transport.
  • workflowFunctionRuntime: Evaluates the expression functions.
  • workflowExecutionHandlerCatalog: Finds the handlers of child and parent workflows.
  • workflowRegistrationCatalog: The registered workflows, for child workflows.

method CompleteTaskAsync(WorkflowTaskExecutionContext, CancellationToken) #

public Task<WorkflowTaskCompletionPlan> CompleteTaskAsync(WorkflowTaskExecutionContext context, CancellationToken cancellationToken = default)

Plans the completion of a task.

Parameters

  • context: The task context.
  • cancellationToken: Cancels the operation.

Returns

The plan.

method StartAsync(WorkflowStartExecutionContext, CancellationToken) #

public Task<WorkflowStartExecutionPlan> StartAsync(WorkflowStartExecutionContext context, CancellationToken cancellationToken = default)

Plans the start of an instance.

Parameters

  • context: The start context.
  • cancellationToken: Cancels the operation.

Returns

The plan.

class DefaultWorkflowAssignmentPermissionEvaluator

public sealed class DefaultWorkflowAssignmentPermissionEvaluator : IWorkflowAssignmentPermissionEvaluator

The default assignment rules: an actor in the effective roles (ignoring case) may assign a task to itself; assigning to another actor needs a permissions plugin; only the assignee may release; the assignee or an actor in the effective roles may complete.

Members

MemberKindSummary
DefaultWorkflowAssignmentPermissionEvaluator()constructorCreates an instance of DefaultWorkflowAssignmentPermissionEvaluator.
Evaluate(WorkflowAssignmentPermissionContext)methodDecides on an action.

constructor DefaultWorkflowAssignmentPermissionEvaluator() #

public DefaultWorkflowAssignmentPermissionEvaluator()

Creates an instance of DefaultWorkflowAssignmentPermissionEvaluator.

method Evaluate(WorkflowAssignmentPermissionContext) #

public WorkflowAssignmentPermissionDecision Evaluate(WorkflowAssignmentPermissionContext context)

Decides on an action.

Parameters

  • context: The action and the task.

Returns

The decision.

class GenericAssignmentPermissionEvaluator

public sealed class GenericAssignmentPermissionEvaluator : IWorkflowAssignmentPermissionEvaluator

A permission evaluator that recognizes configured admin roles. Admin users receive full assignment permissions (AssignOther, AssignRoles, Release) in addition to standard permissions.

Members

MemberKindSummary
GenericAssignmentPermissionEvaluator(IOptions<GenericAssignmentPermissionOptions>)constructorA permission evaluator that recognizes configured admin roles.
Evaluate(WorkflowAssignmentPermissionContext)methodDecides on an action.

constructor GenericAssignmentPermissionEvaluator(IOptions<GenericAssignmentPermissionOptions>) #

public GenericAssignmentPermissionEvaluator(IOptions<GenericAssignmentPermissionOptions> options)

A permission evaluator that recognizes configured admin roles. Admin users receive full assignment permissions (AssignOther, AssignRoles, Release) in addition to standard permissions.

method Evaluate(WorkflowAssignmentPermissionContext) #

public WorkflowAssignmentPermissionDecision Evaluate(WorkflowAssignmentPermissionContext context)

Decides on an action.

Parameters

  • context: The action and the task.

Returns

The decision.

class GenericAssignmentPermissionOptions

public sealed class GenericAssignmentPermissionOptions

Options for the generic assignment permission evaluator.

Members

MemberKindSummary
GenericAssignmentPermissionOptions()constructorCreates an instance of GenericAssignmentPermissionOptions.
SectionNameconstantThe configuration section the options bind from: GenericAssignmentPermissions.
AdminRolespropertyRoles that are considered admin roles for workflow task assignment.
AssigneeCanCompletepropertyWhen true, the current assignee may complete the task even without one of its effective roles (for example after an admin assigned it to them).

constructor GenericAssignmentPermissionOptions() #

public GenericAssignmentPermissionOptions()

Creates an instance of GenericAssignmentPermissionOptions.

constant SectionName #

public const string SectionName = "GenericAssignmentPermissions"

The configuration section the options bind from: GenericAssignmentPermissions.

property AdminRoles #

public List<string> AdminRoles { get; set; }

Roles that are considered admin roles for workflow task assignment. Admin users can assign tasks to others, assign roles, and release tasks.

property AssigneeCanComplete #

public bool AssigneeCanComplete { get; set; }

When true, the current assignee may complete the task even without one of its effective roles (for example after an admin assigned it to them). Default false.

class InMemoryWorkflowDefinitionStore

public sealed class InMemoryWorkflowDefinitionStore : IWorkflowDefinitionStore, IWorkflowDefinitionGovernanceStore

In-process definition store. Keeps imported definitions for the lifetime of the host process. Suitable for development, demonstrations and tests. For production deployments, register a durable store (PostgreSQL or MongoDB) that overrides this registration.

Members

MemberKindSummary
InMemoryWorkflowDefinitionStore(ILogger<InMemoryWorkflowDefinitionStore>)constructorIn-process definition store.
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 InMemoryWorkflowDefinitionStore(ILogger<InMemoryWorkflowDefinitionStore>) #

public InMemoryWorkflowDefinitionStore(ILogger<InMemoryWorkflowDefinitionStore> logger)

In-process definition store. Keeps imported definitions for the lifetime of the host process. Suitable for development, demonstrations and tests. For production deployments, register a durable store (PostgreSQL or MongoDB) that overrides this registration.

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 InMemoryWorkflowHostedJobLockService

public sealed class InMemoryWorkflowHostedJobLockService : IWorkflowHostedJobLockService

An in-process hosted job lock, for a single-node host.

Members

MemberKindSummary
InMemoryWorkflowHostedJobLockService()constructorCreates an instance of InMemoryWorkflowHostedJobLockService.
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 InMemoryWorkflowHostedJobLockService() #

public InMemoryWorkflowHostedJobLockService()

Creates an instance of InMemoryWorkflowHostedJobLockService.

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 InMemoryWorkflowRuntimeStateStore

public sealed class InMemoryWorkflowRuntimeStateStore : IWorkflowRuntimeStateStore

Keeps runtime states in process memory, the default when no store library registers a store; instance ids compare ignoring case, and the states end with the process.

Members

MemberKindSummary
InMemoryWorkflowRuntimeStateStore()constructorCreates an instance of InMemoryWorkflowRuntimeStateStore.
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 InMemoryWorkflowRuntimeStateStore() #

public InMemoryWorkflowRuntimeStateStore()

Creates an instance of InMemoryWorkflowRuntimeStateStore.

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 InProcessWorkflowRuntimeOrchestrator

public sealed class InProcessWorkflowRuntimeOrchestrator : IWorkflowRuntimeProvider

The Stella.InProcess runtime: runs the execution handler of a workflow in the calling process.

Parameters

  • workflowExecutionHandlerCatalog: Finds the handlers.

Members

MemberKindSummary
InProcessWorkflowRuntimeOrchestrator(IWorkflowExecutionHandlerCatalog)constructorThe Stella.InProcess runtime: runs the execution handler of a workflow in the calling process.
ProviderNameconstantThe provider name: Stella.InProcess.
CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken)methodCompletes a task.
ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken)methodResumes an instance with a signal.
StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken)methodStarts an instance.

constructor InProcessWorkflowRuntimeOrchestrator(IWorkflowExecutionHandlerCatalog) #

public InProcessWorkflowRuntimeOrchestrator(IWorkflowExecutionHandlerCatalog workflowExecutionHandlerCatalog)

The Stella.InProcess runtime: runs the execution handler of a workflow in the calling process.

Parameters

  • workflowExecutionHandlerCatalog: Finds the handlers.

constant ProviderName #

public const string ProviderName = "Stella.InProcess"

The provider name: Stella.InProcess.

method CompleteAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowTaskExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> CompleteAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowTaskExecutionContext context, CancellationToken cancellationToken = default)

Completes a task.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The task context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method ResumeAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowSignalExecutionContext, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> ResumeAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowSignalExecutionContext context, CancellationToken cancellationToken = default)

Resumes an instance with a signal.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • context: The signal context.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method StartAsync(WorkflowRegistration, WorkflowDefinitionDescriptor, WorkflowBusinessReference, StartWorkflowRequest, object, CancellationToken) #

public Task<WorkflowRuntimeExecutionResult> StartAsync(WorkflowRegistration registration, WorkflowDefinitionDescriptor definition, WorkflowBusinessReference? businessReference, StartWorkflowRequest request, object startRequest, CancellationToken cancellationToken = default)

Starts an instance.

Parameters

  • registration: The workflow registration.
  • definition: The definition descriptor.
  • businessReference: The business reference.
  • request: The start request.
  • startRequest: The typed start request.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

class NullWorkflowDefinitionStore

public sealed class NullWorkflowDefinitionStore : IWorkflowDefinitionStore

Unsupported definition store used only as a local/test fallback until a backend-specific store is registered.

Members

MemberKindSummary
NullWorkflowDefinitionStore(ILogger<NullWorkflowDefinitionStore>)constructorUnsupported definition store used only as a local/test fallback until a backend-specific store is registered.
ActivateAsync(string, string, CancellationToken)methodSets a specific version as active for a workflow name.
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 NullWorkflowDefinitionStore(ILogger<NullWorkflowDefinitionStore>) #

public NullWorkflowDefinitionStore(ILogger<NullWorkflowDefinitionStore> logger)

Unsupported definition store used only as a local/test fallback until a backend-specific store is registered.

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 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 UnconfiguredWorkflowEndpointTransport

public sealed class UnconfiguredWorkflowEndpointTransport : IWorkflowEndpointTransport

The endpoint transport used when none is configured: every call fails with an error that names the service and the route.

Members

MemberKindSummary
UnconfiguredWorkflowEndpointTransport()constructorCreates an instance of UnconfiguredWorkflowEndpointTransport.
ExecuteAsync(WorkflowEndpointRequest, CancellationToken)methodSends the request and returns the response.

constructor UnconfiguredWorkflowEndpointTransport() #

public UnconfiguredWorkflowEndpointTransport()

Creates an instance of UnconfiguredWorkflowEndpointTransport.

method ExecuteAsync(WorkflowEndpointRequest, CancellationToken) #

public Task<WorkflowEndpointResponse> ExecuteAsync(WorkflowEndpointRequest request, CancellationToken cancellationToken = default)

Sends the request and returns the response. A failure, such as a non-success status or a target that is not configured, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.

Parameters

  • request: The endpoint request.
  • cancellationToken: Cancels the operation.

Returns

The response.

class UnconfiguredWorkflowGraphqlTransport

public sealed class UnconfiguredWorkflowGraphqlTransport : IWorkflowGraphqlTransport

The GraphQL transport used when none is configured: every call fails with an error that names the target.

Members

MemberKindSummary
UnconfiguredWorkflowGraphqlTransport()constructorCreates an instance of UnconfiguredWorkflowGraphqlTransport.
ExecuteAsync(WorkflowGraphqlRequest, CancellationToken)methodSends the query and returns the response.

constructor UnconfiguredWorkflowGraphqlTransport() #

public UnconfiguredWorkflowGraphqlTransport()

Creates an instance of UnconfiguredWorkflowGraphqlTransport.

method ExecuteAsync(WorkflowGraphqlRequest, CancellationToken) #

public Task<WorkflowGraphqlResponse> ExecuteAsync(WorkflowGraphqlRequest request, CancellationToken cancellationToken = default)

Sends the query and returns the response. A failure, such as a non-success status or an errors array in the response, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.

Parameters

  • request: The GraphQL request.
  • cancellationToken: Cancels the operation.

Returns

The response.

class UnconfiguredWorkflowHttpTransport

public sealed class UnconfiguredWorkflowHttpTransport : IWorkflowHttpTransport

The HTTP transport used when none is configured: every call fails with an error that names the method, the target and the path.

Members

MemberKindSummary
UnconfiguredWorkflowHttpTransport()constructorCreates an instance of UnconfiguredWorkflowHttpTransport.
ExecuteAsync(WorkflowHttpRequest, CancellationToken)methodSends the request and returns the response.

constructor UnconfiguredWorkflowHttpTransport() #

public UnconfiguredWorkflowHttpTransport()

Creates an instance of UnconfiguredWorkflowHttpTransport.

method ExecuteAsync(WorkflowHttpRequest, CancellationToken) #

public Task<WorkflowHttpResponse> ExecuteAsync(WorkflowHttpRequest request, CancellationToken cancellationToken = default)

Sends the request and returns the response. A failure, such as a non-success status or a target that is not configured, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.

Parameters

  • request: The HTTP request.
  • cancellationToken: Cancels the operation.

Returns

The response.

class UnconfiguredWorkflowRabbitTransport

public sealed class UnconfiguredWorkflowRabbitTransport : IWorkflowRabbitTransport

The RabbitMQ transport used when none is configured: every call fails with an error that names the exchange and the routing key.

Members

MemberKindSummary
UnconfiguredWorkflowRabbitTransport()constructorCreates an instance of UnconfiguredWorkflowRabbitTransport.
ExecuteAsync(WorkflowRabbitRequest, CancellationToken)methodPublishes the request, and for a command that expects a reply, waits for the correlated reply.

constructor UnconfiguredWorkflowRabbitTransport() #

public UnconfiguredWorkflowRabbitTransport()

Creates an instance of UnconfiguredWorkflowRabbitTransport.

method ExecuteAsync(WorkflowRabbitRequest, CancellationToken) #

public Task<WorkflowRabbitResponse> ExecuteAsync(WorkflowRabbitRequest request, CancellationToken cancellationToken = default)

Publishes the request, and for a command that expects a reply, waits for the correlated reply. A failure is a response that did not succeed; a reply that does not arrive in time raises a TimeoutException.

Parameters

  • request: The RabbitMQ request.
  • cancellationToken: Cancels the operation.

Returns

The response.

struct WorkflowBundledDefinition

public readonly struct WorkflowBundledDefinition : IEquatable<WorkflowBundledDefinition>

A workflow an assembly ships as an embedded bundled *.definition.json.

Parameters

  • WorkflowName: The workflow name.
  • WorkflowVersion: The workflow version.

Members

MemberKindSummary
WorkflowBundledDefinition(string, string)constructorA workflow an assembly ships as an embedded bundled *.definition.json.
WorkflowNamepropertyThe workflow name.
WorkflowVersionpropertyThe workflow version.
ToString()methodReturns the name and the version, separated by a space.

constructor WorkflowBundledDefinition(string, string) #

public WorkflowBundledDefinition(string WorkflowName, string WorkflowVersion)

A workflow an assembly ships as an embedded bundled *.definition.json.

Parameters

  • WorkflowName: The workflow name.
  • WorkflowVersion: The workflow version.

property WorkflowName #

public string WorkflowName { get; init; }

The workflow name.

property WorkflowVersion #

public string WorkflowVersion { get; init; }

The workflow version.

method ToString() #

public override string ToString()

Returns the name and the version, separated by a space.

Returns

The text.

record WorkflowBundledDefinitionCoverage

public sealed record WorkflowBundledDefinitionCoverage

How many of an assembly’s bundled definitions its registrations cover, and which ones they miss.

Parameters

  • AssemblyName: The assembly.
  • Bundled: The bundled definitions.
  • RegisteredCount: The registrations of the assembly.
  • Missing: The bundled definitions no registration covers.

Members

MemberKindSummary
WorkflowBundledDefinitionCoverage(string, IReadOnlyCollection<WorkflowBundledDefinition>, int, IReadOnlyCollection<WorkflowBundledDefinition>)constructorHow many of an assembly’s bundled definitions its registrations cover, and which ones they miss.
AssemblyNamepropertyThe assembly.
BundledpropertyThe bundled definitions.
MissingpropertyThe bundled definitions no registration covers.
RegisteredCountpropertyThe registrations of the assembly.

constructor WorkflowBundledDefinitionCoverage(string, IReadOnlyCollection<WorkflowBundledDefinition>, int, IReadOnlyCollection<WorkflowBundledDefinition>) #

public WorkflowBundledDefinitionCoverage(string AssemblyName, IReadOnlyCollection<WorkflowBundledDefinition> Bundled, int RegisteredCount, IReadOnlyCollection<WorkflowBundledDefinition> Missing)

How many of an assembly’s bundled definitions its registrations cover, and which ones they miss.

Parameters

  • AssemblyName: The assembly.
  • Bundled: The bundled definitions.
  • RegisteredCount: The registrations of the assembly.
  • Missing: The bundled definitions no registration covers.

property AssemblyName #

public string AssemblyName { get; init; }

The assembly.

property Bundled #

public IReadOnlyCollection<WorkflowBundledDefinition> Bundled { get; init; }

The bundled definitions.

property Missing #

public IReadOnlyCollection<WorkflowBundledDefinition> Missing { get; init; }

The bundled definitions no registration covers.

property RegisteredCount #

public int RegisteredCount { get; init; }

The registrations of the assembly.

class WorkflowBundledDefinitions

public static class WorkflowBundledDefinitions

Reads the bundled definitions a workflow assembly embeds and compares them with what the assembly registered, so a host can refuse to report ready when a workflow it ships is not registered under its name and version.

Members

MemberKindSummary
ResourceMarkerconstantPart of the manifest resource name of an embedded bundled definition: a workflow assembly embeds each *.definition.json as $(AssemblyName).WorkflowDefinitions.<file name>.
Compare(Assembly, IEnumerable<WorkflowRegistration>)methodCompares the bundled definitions of assembly with the registrations its types made.
Read(Assembly)methodThe bundled definitions assembly embeds (name and version of each).

constant ResourceMarker #

public const string ResourceMarker = ".WorkflowDefinitions."

Part of the manifest resource name of an embedded bundled definition: a workflow assembly embeds each *.definition.json as $(AssemblyName).WorkflowDefinitions.<file name>.

method Compare(Assembly, IEnumerable<WorkflowRegistration>) #

public static WorkflowBundledDefinitionCoverage Compare(Assembly assembly, IEnumerable<WorkflowRegistration> registrations)

Compares the bundled definitions of assembly with the registrations its types made.

method Read(Assembly) #

public static IReadOnlyCollection<WorkflowBundledDefinition> Read(Assembly assembly)

The bundled definitions assembly embeds (name and version of each).

class WorkflowCanonicalDefinitionService

public sealed class WorkflowCanonicalDefinitionService

Serves the canonical definition schema and validates definitions.

Parameters

  • workflowModuleCatalog: The installed modules.
  • workflowFunctionCatalog: The function catalog.
  • externalActivityRegistry: The external activity registry.

Members

MemberKindSummary
WorkflowCanonicalDefinitionService(IWorkflowModuleCatalog, IWorkflowFunctionCatalog, IWorkflowExternalActivityRegistry)constructorServes the canonical definition schema and validates definitions.
GetSchema()methodReturns the JSON schema of canonical definitions.
Validate(WorkflowCanonicalValidateRequest)methodValidates a canonical definition without importing it.

constructor WorkflowCanonicalDefinitionService(IWorkflowModuleCatalog, IWorkflowFunctionCatalog, IWorkflowExternalActivityRegistry) #

public WorkflowCanonicalDefinitionService(IWorkflowModuleCatalog workflowModuleCatalog, IWorkflowFunctionCatalog workflowFunctionCatalog, IWorkflowExternalActivityRegistry externalActivityRegistry)

Serves the canonical definition schema and validates definitions.

Parameters

  • workflowModuleCatalog: The installed modules.
  • workflowFunctionCatalog: The function catalog.
  • externalActivityRegistry: The external activity registry.

method GetSchema() #

public WorkflowCanonicalSchemaGetResponse GetSchema()

Returns the JSON schema of canonical definitions.

Returns

The schema.

method Validate(WorkflowCanonicalValidateRequest) #

public WorkflowCanonicalValidateResponse Validate(WorkflowCanonicalValidateRequest request)

Validates a canonical definition without importing it.

Parameters

  • request: The request.

Returns

The findings.

class WorkflowCanonicalJsonSchema

public static class WorkflowCanonicalJsonSchema

The JSON schema of canonical workflow definitions.

Members

MemberKindSummary
DefinitionSchemapropertyThe schema.
GetSchemaJson()methodReturns the schema as JSON.
ValidateJson(string)methodValidates JSON against the schema.

property DefinitionSchema #

public static JsonSchema DefinitionSchema { get; }

The schema.

method GetSchemaJson() #

public static string GetSchemaJson()

Returns the schema as JSON.

Returns

The schema JSON.

method ValidateJson(string) #

public static IReadOnlyCollection<WorkflowCanonicalValidationError> ValidateJson(string json)

Validates JSON against the schema.

Parameters

  • json: The JSON.

Returns

The findings.

class WorkflowConsoleOptions

public sealed class WorkflowConsoleOptions

What the execution console shows of an instance’s state, per profile (WorkflowConsole).

Members

MemberKindSummary
WorkflowConsoleOptions()constructorCreates an instance of WorkflowConsoleOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowConsole.
SafeStateKeyspropertyTop-level state keys the SAFE profile shows; everything else is hidden.
TechnicalRedactedFragmentspropertyName fragments the TECHNICAL profile removes from the top-level state.

constructor WorkflowConsoleOptions() #

public WorkflowConsoleOptions()

Creates an instance of WorkflowConsoleOptions.

constant SectionName #

public const string SectionName = "WorkflowConsole"

The configuration section the options bind from: WorkflowConsole.

property SafeStateKeys #

public List<string> SafeStateKeys { get; set; }

Top-level state keys the SAFE profile shows; everything else is hidden.

property TechnicalRedactedFragments #

public List<string> TechnicalRedactedFragments { get; set; }

Name fragments the TECHNICAL profile removes from the top-level state.

class WorkflowCoreServiceCollectionExtensions

public static class WorkflowCoreServiceCollectionExtensions

Registers the core services of the workflow engine. Platform integrations, such as the data context, plugin loading, authentication, health checks and rendering layout engines, are registered separately.

Members

MemberKindSummary
AddWorkflowEngineCoreServices(IServiceCollection, IConfiguration)extension methodRegisters the core services of the workflow engine: the backend, signal driver and runtime options; the module and function catalogs; the registration and definition catalogs; the execution handlers, the runtime providers and their orchestrator; signal processing and the signal pump; the definition deployment and query services; the licence services; the source format converters; and the render graph compiler.
AddWorkflowEngineHostedServices(IServiceCollection)extension methodRegisters the hosted services for signal pump and retention background processing, and the component licence monitor with its informational licence health entry.
ConfigureWorkflowRuntimeProviderDefault(IServiceCollection, IConfiguration, string)extension methodMakes providerName the default runtime provider unless WorkflowRuntime:DefaultProvider is configured.

extension method AddWorkflowEngineCoreServices(IServiceCollection, IConfiguration) #

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

Registers the core services of the workflow engine: the backend, signal driver and runtime options; the module and function catalogs; the registration and definition catalogs; the execution handlers, the runtime providers and their orchestrator; signal processing and the signal pump; the definition deployment and query services; the licence services; the source format converters; and the render graph compiler. A runtime state store, a hosted job lock, the signal stores and the transports are registered only when none is, as in-memory, empty or unconfigured defaults.

Remarks

It does not register a projection store, a mutation coordinator or a projection retention store (the selected backend does), plugin loading, authentication, health checks or rendering layout engines; the host or another extension method registers them.

extension method AddWorkflowEngineHostedServices(IServiceCollection) #

public static IServiceCollection AddWorkflowEngineHostedServices(this IServiceCollection services)

Registers the hosted services for signal pump and retention background processing, and the component licence monitor with its informational licence health entry. Call this only when running as the workflow engine service host.

extension method ConfigureWorkflowRuntimeProviderDefault(IServiceCollection, IConfiguration, string) #

public static IServiceCollection ConfigureWorkflowRuntimeProviderDefault(this IServiceCollection services, IConfiguration configuration, string providerName)

Makes providerName the default runtime provider unless WorkflowRuntime:DefaultProvider is configured. The latest call wins, so a host calls it after WorkflowCoreServiceCollectionExtensions.AddWorkflowEngineCoreServices(IServiceCollection, IConfiguration)to replace the engine’s default.

class WorkflowDefinitionCatalog

public sealed class WorkflowDefinitionCatalog : IWorkflowDefinitionCatalog

The definition descriptors of the registered workflows.

Parameters

  • workflowRegistrationCatalog: The registered workflows.

Members

MemberKindSummary
WorkflowDefinitionCatalog(IWorkflowRegistrationCatalog)constructorThe definition descriptors of the registered workflows.
GetDefinition(string, string)methodFinds a descriptor.
GetDefinitions()methodReturns every descriptor.

constructor WorkflowDefinitionCatalog(IWorkflowRegistrationCatalog) #

public WorkflowDefinitionCatalog(IWorkflowRegistrationCatalog workflowRegistrationCatalog)

The definition descriptors of the registered workflows.

Parameters

  • workflowRegistrationCatalog: The registered workflows.

method GetDefinition(string, string) #

public WorkflowDefinitionDescriptor? GetDefinition(string workflowName, string? workflowVersion = null)

Finds a descriptor.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version; the latest when not set.

Returns

The descriptor, or null.

method GetDefinitions() #

public IReadOnlyCollection<WorkflowDefinitionDescriptor> GetDefinitions()

Returns every descriptor.

Returns

The descriptors.

class WorkflowDefinitionDeploymentService

public sealed class WorkflowDefinitionDeploymentService

Handles import, export, versioning, and activation of canonical workflow definitions.

Members

MemberKindSummary
WorkflowDefinitionDeploymentService(IWorkflowDefinitionStore, IWorkflowRuntimeDefinitionStore, IWorkflowRenderGraphCompiler, IWorkflowRenderLayoutEngineResolver, IWorkflowSourceFormatRegistry, WorkflowCanonicalDefinitionService, IWorkflowFirstSeenLedger, TimeProvider, ILogger<WorkflowDefinitionDeploymentService>, WorkflowLicenceState, IWorkflowRenderSvgRenderer)constructorHandles import, export, versioning, and activation of canonical workflow definitions.
ActivateAsync(WorkflowDefinitionActivateRequest, CancellationToken)methodActivates a specific version of a workflow definition.
CreateImportRequestAsync(string, string, string, CancellationToken)methodExports a definition (with its rendering) as the import request another engine accepts; null when the definition or version does not exist.
ExportAsync(WorkflowDefinitionExportRequest, CancellationToken)methodExports a stored definition.
ExportMultiAsync(WorkflowDefinitionExportMultiRequest, CancellationToken)methodExports a definition in a source format.
GetDefinitionByIdAsync(WorkflowDefinitionByIdRequest, CancellationToken)methodGets a single definition by name (and optional version) with optional rendering assets.
GetRenderGraphAsync(WorkflowRenderGraphGetRequest, CancellationToken)methodReturns the typed render graph (nodes + edges) for a workflow, compiled from its canonical AST.
GetSupportedFormats()methodReturns the source formats the server converts.
GetVersionsAsync(WorkflowDefinitionVersionsGetRequest, CancellationToken)methodLists all versions of a workflow definition.
ImportAsync(WorkflowDefinitionImportRequest, CancellationToken)methodImports an immutable canonical definition.
ImportMultiAsync(WorkflowDefinitionImportMultiRequest, CancellationToken)methodConverts content of a source format to a canonical definition and imports it.
RenderAsync(WorkflowRenderingRequest, CancellationToken)methodRenders a workflow definition in the requested format (SVG, PNG, or JSON render graph).

constructor WorkflowDefinitionDeploymentService(IWorkflowDefinitionStore, IWorkflowRuntimeDefinitionStore, IWorkflowRenderGraphCompiler, IWorkflowRenderLayoutEngineResolver, IWorkflowSourceFormatRegistry, WorkflowCanonicalDefinitionService, IWorkflowFirstSeenLedger, TimeProvider, ILogger<WorkflowDefinitionDeploymentService>, WorkflowLicenceState, IWorkflowRenderSvgRenderer) #

public WorkflowDefinitionDeploymentService(IWorkflowDefinitionStore definitionStore, IWorkflowRuntimeDefinitionStore runtimeDefinitionStore, IWorkflowRenderGraphCompiler renderGraphCompiler, IWorkflowRenderLayoutEngineResolver renderLayoutEngineResolver, IWorkflowSourceFormatRegistry sourceFormatRegistry, WorkflowCanonicalDefinitionService canonicalDefinitionService, IWorkflowFirstSeenLedger firstSeenLedger, TimeProvider timeProvider, ILogger<WorkflowDefinitionDeploymentService> logger, WorkflowLicenceState? licenceState = null, IWorkflowRenderSvgRenderer? svgRenderer = null)

Handles import, export, versioning, and activation of canonical workflow definitions.

method ActivateAsync(WorkflowDefinitionActivateRequest, CancellationToken) #

public Task<WorkflowDefinitionActivateResponse> ActivateAsync(WorkflowDefinitionActivateRequest request, CancellationToken cancellationToken = default)

Activates a specific version of a workflow definition.

method CreateImportRequestAsync(string, string, string, CancellationToken) #

public Task<WorkflowDefinitionImportRequest?> CreateImportRequestAsync(string workflowName, string? version, string importedBy, CancellationToken cancellationToken = default)

Exports a definition (with its rendering) as the import request another engine accepts; null when the definition or version does not exist. The caller chooses the transport that delivers it.

method ExportAsync(WorkflowDefinitionExportRequest, CancellationToken) #

public Task<WorkflowDefinitionExportResponse> ExportAsync(WorkflowDefinitionExportRequest request, CancellationToken cancellationToken = default)

Exports a stored definition.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The definition.

method ExportMultiAsync(WorkflowDefinitionExportMultiRequest, CancellationToken) #

public Task<WorkflowDefinitionExportMultiResponse> ExportMultiAsync(WorkflowDefinitionExportMultiRequest request, CancellationToken cancellationToken = default)

Exports a definition in a source format.

Parameters

  • request: The definition and format.
  • cancellationToken: Cancels the operation.

Returns

The content.

method GetDefinitionByIdAsync(WorkflowDefinitionByIdRequest, CancellationToken) #

public Task<WorkflowDefinitionByIdResponse> GetDefinitionByIdAsync(WorkflowDefinitionByIdRequest request, CancellationToken cancellationToken = default)

Gets a single definition by name (and optional version) with optional rendering assets. Precedence matches the engine: runtime store (code-registered) first, persistent store (imported) fallback.

method GetRenderGraphAsync(WorkflowRenderGraphGetRequest, CancellationToken) #

public Task<WorkflowRenderGraphGetResponse> GetRenderGraphAsync(WorkflowRenderGraphGetRequest request, CancellationToken cancellationToken = default)

Returns the typed render graph (nodes + edges) for a workflow, compiled from its canonical AST. Runtime store first, persistent store fallback (reconstructs a stub runtime definition).

method GetSupportedFormats() #

public WorkflowSupportedFormatsGetResponse GetSupportedFormats()

Returns the source formats the server converts.

Returns

The formats.

method GetVersionsAsync(WorkflowDefinitionVersionsGetRequest, CancellationToken) #

public Task<WorkflowDefinitionVersionsGetResponse> GetVersionsAsync(WorkflowDefinitionVersionsGetRequest request, CancellationToken cancellationToken = default)

Lists all versions of a workflow definition.

method ImportAsync(WorkflowDefinitionImportRequest, CancellationToken) #

public Task<WorkflowDefinitionImportResponse> ImportAsync(WorkflowDefinitionImportRequest request, CancellationToken cancellationToken = default)

Imports an immutable canonical definition. Import and activation are deliberately separate. A stored workflow is then recorded in the first-seen ledger (the technical count of recorded workflow names). Nothing is refused for licence reasons: an import that fails before it is stored records nothing, and a ledger failure never fails the import.

method ImportMultiAsync(WorkflowDefinitionImportMultiRequest, CancellationToken) #

public Task<WorkflowDefinitionImportMultiResponse> ImportMultiAsync(WorkflowDefinitionImportMultiRequest request, CancellationToken cancellationToken = default)

Converts content of a source format to a canonical definition and imports it.

Parameters

  • request: The format and content.
  • cancellationToken: Cancels the operation.

Returns

The outcome.

method RenderAsync(WorkflowRenderingRequest, CancellationToken) #

public Task<WorkflowRenderingResponse> RenderAsync(WorkflowRenderingRequest request, CancellationToken cancellationToken = default)

Renders a workflow definition in the requested format (SVG, PNG, or JSON render graph).

class WorkflowDefinitionQueryService

public sealed class WorkflowDefinitionQueryService

Queries the workflow definitions known to the engine: bundled in the catalog and imported into the store.

Members

MemberKindSummary
WorkflowDefinitionQueryService(IWorkflowDefinitionCatalog, IWorkflowDefinitionStore)constructorQueries the workflow definitions known to the engine: bundled in the catalog and imported into the store.
QueryAsync(WorkflowDefinitionGetRequest)methodLists definitions from the catalog (bundled) and the store (imported); the catalog wins on a duplicate (name, version).

constructor WorkflowDefinitionQueryService(IWorkflowDefinitionCatalog, IWorkflowDefinitionStore) #

public WorkflowDefinitionQueryService(IWorkflowDefinitionCatalog workflowDefinitionCatalog, IWorkflowDefinitionStore workflowDefinitionStore)

Queries the workflow definitions known to the engine: bundled in the catalog and imported into the store.

method QueryAsync(WorkflowDefinitionGetRequest) #

public Task<WorkflowDefinitionGetResponse> QueryAsync(WorkflowDefinitionGetRequest request)

Lists definitions from the catalog (bundled) and the store (imported); the catalog wins on a duplicate (name, version). Without a version or names filter each name keeps only its latest version.

class WorkflowDefinitionRenderService

public sealed class WorkflowDefinitionRenderService

Lays out the diagram of a registered definition.

Parameters

  • runtimeDefinitionStore: The runtime definitions.
  • renderGraphCompiler: Builds the render graphs.
  • renderLayoutEngineResolver: Selects the layout engines.

Members

MemberKindSummary
WorkflowDefinitionRenderService(IWorkflowRuntimeDefinitionStore, IWorkflowRenderGraphCompiler, IWorkflowRenderLayoutEngineResolver)constructorLays out the diagram of a registered definition.
RenderDefinitionAsync(string, string, string, WorkflowRenderLayoutRequest, CancellationToken)methodLays out a definition.

constructor WorkflowDefinitionRenderService(IWorkflowRuntimeDefinitionStore, IWorkflowRenderGraphCompiler, IWorkflowRenderLayoutEngineResolver) #

public WorkflowDefinitionRenderService(IWorkflowRuntimeDefinitionStore runtimeDefinitionStore, IWorkflowRenderGraphCompiler renderGraphCompiler, IWorkflowRenderLayoutEngineResolver renderLayoutEngineResolver)

Lays out the diagram of a registered definition.

Parameters

  • runtimeDefinitionStore: The runtime definitions.
  • renderGraphCompiler: Builds the render graphs.
  • renderLayoutEngineResolver: Selects the layout engines.

method RenderDefinitionAsync(string, string, string, WorkflowRenderLayoutRequest, CancellationToken) #

public Task<(string ProviderName, WorkflowRenderLayoutResult Layout)> RenderDefinitionAsync(string workflowName, string? workflowVersion = null, string? layoutProvider = null, WorkflowRenderLayoutRequest? layoutRequest = null, CancellationToken cancellationToken = default)

Lays out a definition.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version; the latest when not set.
  • layoutProvider: The layout provider; the configured one when not set.
  • layoutRequest: The layout settings; the defaults when not set.
  • cancellationToken: Cancels the operation.

Returns

The provider used and the layout.

class WorkflowDiagramService

public sealed class WorkflowDiagramService

Lays out workflow diagrams, with the progress of an instance when the request names one.

Parameters

  • workflowDefinitionCatalog: The definitions.
  • workflowRuntimeService: Reads instances and tasks.
  • definitionRenderService: Lays out the definitions.

Members

MemberKindSummary
WorkflowDiagramService(IWorkflowDefinitionCatalog, WorkflowRuntimeService, WorkflowDefinitionRenderService)constructorLays out workflow diagrams, with the progress of an instance when the request names one.
GetDiagramAsync(WorkflowDiagramGetRequest, CancellationToken)methodLays out a diagram.

constructor WorkflowDiagramService(IWorkflowDefinitionCatalog, WorkflowRuntimeService, WorkflowDefinitionRenderService) #

public WorkflowDiagramService(IWorkflowDefinitionCatalog workflowDefinitionCatalog, WorkflowRuntimeService workflowRuntimeService, WorkflowDefinitionRenderService definitionRenderService)

Lays out workflow diagrams, with the progress of an instance when the request names one.

Parameters

  • workflowDefinitionCatalog: The definitions.
  • workflowRuntimeService: Reads instances and tasks.
  • definitionRenderService: Lays out the definitions.

method GetDiagramAsync(WorkflowDiagramGetRequest, CancellationToken) #

public Task<WorkflowDiagramGetResponse> GetDiagramAsync(WorkflowDiagramGetRequest request, CancellationToken cancellationToken = default)

Lays out a diagram.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The diagram.

class WorkflowDurableServiceCollectionExtensions

public static class WorkflowDurableServiceCollectionExtensions

Registers the durable engine features.

Members

MemberKindSummary
AddWorkflowEngineDurableServices(IServiceCollection, IConfiguration)extension methodRegisters the durable engine features on top of WorkflowCoreServiceCollectionExtensions.AddWorkflowEngineCoreServices(IServiceCollection, IConfiguration): durable start and root continuation, registered signals, external activities, maps, child executions, history, observability, the execution console and the Studio descriptor.
ValidateWorkflowProviderRegistrations(IServiceCollection, IConfiguration)extension methodFails fast when the configured backend (WorkflowBackend:Provider) or signal driver (WorkflowSignalDriver:Provider) was not registered by any store or driver library.

extension method AddWorkflowEngineDurableServices(IServiceCollection, IConfiguration) #

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

Registers the durable engine features on top of WorkflowCoreServiceCollectionExtensions.AddWorkflowEngineCoreServices(IServiceCollection, IConfiguration): durable start and root continuation, registered signals, external activities, maps, child executions, history, observability, the execution console and the Studio descriptor. Every store these services use comes from a store library (PostgreSQL or MongoDB).

extension method ValidateWorkflowProviderRegistrations(IServiceCollection, IConfiguration) #

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

Fails fast when the configured backend (WorkflowBackend:Provider) or signal driver (WorkflowSignalDriver:Provider) was not registered by any store or driver library. Call it after every store and driver registration (manual, plug-in routine or host loader).

class WorkflowExecutionConsoleService

public sealed class WorkflowExecutionConsoleService

The execution console: lists executions and reads their resources for one profile.

Parameters

  • readStore: Reads the console rows.
  • historyService: Reads the history events.
  • observability: Counts and times the console requests, when given.
  • consoleOptions: The profile settings; the defaults when not set.

Members

MemberKindSummary
WorkflowExecutionConsoleService(IWorkflowExecutionConsoleReadStore, WorkflowHistoryService, WorkflowObservability, IOptions<WorkflowConsoleOptions>)constructorThe execution console: lists executions and reads their resources for one profile.
GetAttemptsAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the step attempts of an execution.
GetDeliveryChronologyAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the activity dispatches and completions of an execution, in time order.
GetExecutionAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads an execution: its identity, status and history position.
GetGraphAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the scopes and steps of an execution as a graph.
GetMapItemsAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the map items of an execution.
GetMapsAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the map executions of an execution.
GetScopesAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the scopes of an execution.
GetSnapshotAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the state of an execution, filtered by the profile.
GetStepsAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads the external activity steps of an execution.
GetTimelineAsync(WorkflowExecutionResourceRequest, CancellationToken)methodReads a page of the history events after a sequence.
ListAsync(WorkflowExecutionListRequest, CancellationToken)methodLists executions, newest first, a page at a time.
RenderSvgAsync(WorkflowExecutionResourceRequest, CancellationToken)methodDraws the execution graph as SVG.

constructor WorkflowExecutionConsoleService(IWorkflowExecutionConsoleReadStore, WorkflowHistoryService, WorkflowObservability, IOptions<WorkflowConsoleOptions>) #

public WorkflowExecutionConsoleService(IWorkflowExecutionConsoleReadStore readStore, WorkflowHistoryService historyService, WorkflowObservability? observability = null, IOptions<WorkflowConsoleOptions>? consoleOptions = null)

The execution console: lists executions and reads their resources for one profile.

Parameters

  • readStore: Reads the console rows.
  • historyService: Reads the history events.
  • observability: Counts and times the console requests, when given.
  • consoleOptions: The profile settings; the defaults when not set.

method GetAttemptsAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetAttemptsAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the step attempts of an execution.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetDeliveryChronologyAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetDeliveryChronologyAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the activity dispatches and completions of an execution, in time order.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetExecutionAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetExecutionAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads an execution: its identity, status and history position.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetGraphAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetGraphAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the scopes and steps of an execution as a graph.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetMapItemsAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetMapItemsAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the map items of an execution.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetMapsAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetMapsAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the map executions of an execution.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetScopesAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetScopesAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the scopes of an execution.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetSnapshotAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetSnapshotAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the state of an execution, filtered by the profile.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetStepsAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetStepsAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads the external activity steps of an execution.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method GetTimelineAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> GetTimelineAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Reads a page of the history events after a sequence.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

method ListAsync(WorkflowExecutionListRequest, CancellationToken) #

public Task<WorkflowExecutionListResponse> ListAsync(WorkflowExecutionListRequest request, CancellationToken cancellationToken = default)

Lists executions, newest first, a page at a time.

Parameters

  • request: The cursor, page size and profile.
  • cancellationToken: Cancels the operation.

Returns

A page of executions.

Exceptions

  • ArgumentException: The profile is not SAFE or TECHNICAL.

method RenderSvgAsync(WorkflowExecutionResourceRequest, CancellationToken) #

public Task<WorkflowExecutionResourceResponse> RenderSvgAsync(WorkflowExecutionResourceRequest request, CancellationToken cancellationToken = default)

Draws the execution graph as SVG.

Parameters

  • request: The execution, profile and limits.
  • cancellationToken: Cancels the operation.

Returns

The resource; not found when the execution does not exist.

class WorkflowExecutionHandlerCatalog

public sealed class WorkflowExecutionHandlerCatalog : IWorkflowExecutionHandlerCatalog

Finds the execution handler of a registered workflow: its registered handler type, else a declarative handler when the workflow is declarative.

Parameters

  • serviceProvider: Resolves the handlers.
  • workflowRegistrationCatalog: The registered workflows.

Members

MemberKindSummary
WorkflowExecutionHandlerCatalog(IServiceProvider, IWorkflowRegistrationCatalog)constructorFinds the execution handler of a registered workflow: its registered handler type, else a declarative handler when the workflow is declarative.
GetHandler(string, string)methodFinds the handler of a workflow version.

constructor WorkflowExecutionHandlerCatalog(IServiceProvider, IWorkflowRegistrationCatalog) #

public WorkflowExecutionHandlerCatalog(IServiceProvider serviceProvider, IWorkflowRegistrationCatalog workflowRegistrationCatalog)

Finds the execution handler of a registered workflow: its registered handler type, else a declarative handler when the workflow is declarative.

Parameters

  • serviceProvider: Resolves the handlers.
  • workflowRegistrationCatalog: The registered workflows.

method GetHandler(string, string) #

public IWorkflowExecutionHandler? GetHandler(string workflowName, string workflowVersion)

Finds the handler of a workflow version.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version.

Returns

The handler, or null.

class WorkflowFunctionCatalogService

public sealed class WorkflowFunctionCatalogService

Serves the function catalog.

Parameters

  • workflowFunctionCatalog: The functions.
  • workflowModuleCatalog: The installed modules.

Members

MemberKindSummary
WorkflowFunctionCatalogService(IWorkflowFunctionCatalog, IWorkflowModuleCatalog)constructorServes the function catalog.
GetCatalog()methodReturns the functions and installed modules.

constructor WorkflowFunctionCatalogService(IWorkflowFunctionCatalog, IWorkflowModuleCatalog) #

public WorkflowFunctionCatalogService(IWorkflowFunctionCatalog workflowFunctionCatalog, IWorkflowModuleCatalog workflowModuleCatalog)

Serves the function catalog.

Parameters

  • workflowFunctionCatalog: The functions.
  • workflowModuleCatalog: The installed modules.

method GetCatalog() #

public WorkflowFunctionCatalogGetResponse GetCatalog()

Returns the functions and installed modules.

Returns

The catalog.

class WorkflowMutationScopeAccessor

public sealed class WorkflowMutationScopeAccessor : IWorkflowMutationScopeAccessor

Holds the change scope of the running operation.

Members

MemberKindSummary
WorkflowMutationScopeAccessor()constructorCreates an instance of WorkflowMutationScopeAccessor.
CurrentpropertyThe change scope of the running operation, when one is open.

constructor WorkflowMutationScopeAccessor() #

public WorkflowMutationScopeAccessor()

Creates an instance of WorkflowMutationScopeAccessor.

property Current #

public IWorkflowMutationScope? Current { get; set; }

The change scope of the running operation, when one is open.

class WorkflowRegistrationCatalog

public sealed class WorkflowRegistrationCatalog : IWorkflowRegistrationCatalog

The registered workflows, ordered by name and then by version, newest first; names and versions compare ignoring case.

Parameters

  • registrations: The registrations.

Members

MemberKindSummary
WorkflowRegistrationCatalog(IEnumerable<WorkflowRegistration>)constructorThe registered workflows, ordered by name and then by version, newest first; names and versions compare ignoring case.
GetRegistration(string, string)methodFinds a registered workflow.
GetRegistrations()methodReturns every registered workflow.

constructor WorkflowRegistrationCatalog(IEnumerable<WorkflowRegistration>) #

public WorkflowRegistrationCatalog(IEnumerable<WorkflowRegistration> registrations)

The registered workflows, ordered by name and then by version, newest first; names and versions compare ignoring case.

Parameters

  • registrations: The registrations.

method GetRegistration(string, string) #

public WorkflowRegistration? GetRegistration(string workflowName, string? workflowVersion = null)

Finds a registered workflow.

Parameters

  • workflowName: The workflow name.
  • workflowVersion: The version; the latest when not set.

Returns

The registration, or null.

method GetRegistrations() #

public IReadOnlyCollection<WorkflowRegistration> GetRegistrations()

Returns every registered workflow.

Returns

The registrations.

class WorkflowRetentionHostedJobOptions

public sealed class WorkflowRetentionHostedJobOptions

The schedule of the retention job (WorkflowRetentionHostedJob), which marks stale instances and tasks and purges expired ones. A lease lock lets one host at a time run it.

Members

MemberKindSummary
WorkflowRetentionHostedJobOptions()constructorCreates an instance of WorkflowRetentionHostedJobOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowRetentionHostedJob.
EnabledpropertyWhether the retention job runs.
InitialDelaypropertyThe wait before the first run when the job does not run at startup.
IntervalpropertyThe time between runs.
LockLeasepropertyHow long a host holds the lock for one run.
LockNamepropertyThe name of the lock that lets one host at a time run the job.
RunOnStartuppropertyWhether the job runs once when the host starts, without the initial delay.

constructor WorkflowRetentionHostedJobOptions() #

public WorkflowRetentionHostedJobOptions()

Creates an instance of WorkflowRetentionHostedJobOptions.

constant SectionName #

public const string SectionName = "WorkflowRetentionHostedJob"

The configuration section the options bind from: WorkflowRetentionHostedJob.

property Enabled #

public bool Enabled { get; set; }

Whether the retention job runs. The default is true.

property InitialDelay #

public TimeSpan InitialDelay { get; set; }

The wait before the first run when the job does not run at startup. The default is 5 minutes.

property Interval #

public TimeSpan Interval { get; set; }

The time between runs. The default is 24 hours.

property LockLease #

public TimeSpan LockLease { get; set; }

How long a host holds the lock for one run. The default is 2 hours.

property LockName #

public string LockName { get; set; }

The name of the lock that lets one host at a time run the job. The default is workflow.retention.

property RunOnStartup #

public bool RunOnStartup { get; set; }

Whether the job runs once when the host starts, without the initial delay. The default is false.

class WorkflowRetentionOptions

public sealed class WorkflowRetentionOptions

When the retention job marks an open instance stale and purges a completed one (WorkflowRetention).

Members

MemberKindSummary
WorkflowRetentionOptions()constructorCreates an instance of WorkflowRetentionOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowRetention.
CompletedPurgeAfterDayspropertyThe number of days after completion after which the retention job purges an instance.
OpenStaleAfterDayspropertyThe number of days after which the retention job marks an open instance and its tasks stale.

constructor WorkflowRetentionOptions() #

public WorkflowRetentionOptions()

Creates an instance of WorkflowRetentionOptions.

constant SectionName #

public const string SectionName = "WorkflowRetention"

The configuration section the options bind from: WorkflowRetention.

property CompletedPurgeAfterDays #

public int CompletedPurgeAfterDays { get; set; }

The number of days after completion after which the retention job purges an instance. The default is 180.

property OpenStaleAfterDays #

public int OpenStaleAfterDays { get; set; }

The number of days after which the retention job marks an open instance and its tasks stale. The default is 30.

record WorkflowRetentionRunResult

public sealed record WorkflowRetentionRunResult

The counts of a retention run.

Members

MemberKindSummary
WorkflowRetentionRunResult()constructorCreates an instance of WorkflowRetentionRunResult.
PurgedInstancespropertyInstance projections purged.
PurgedRuntimeStatespropertyRuntime states deleted.
PurgedTaskEventspropertyTask events purged.
PurgedTaskspropertyTask projections purged.
StaleInstancesMarkedpropertyInstances marked stale: the larger of the projection count and the runtime state count.
StaleTasksMarkedpropertyTask projections marked stale.

constructor WorkflowRetentionRunResult() #

public WorkflowRetentionRunResult()

Creates an instance of WorkflowRetentionRunResult.

property PurgedInstances #

public required int PurgedInstances { get; init; }

Instance projections purged.

property PurgedRuntimeStates #

public required int PurgedRuntimeStates { get; init; }

Runtime states deleted.

property PurgedTaskEvents #

public required int PurgedTaskEvents { get; init; }

Task events purged.

property PurgedTasks #

public required int PurgedTasks { get; init; }

Task projections purged.

property StaleInstancesMarked #

public required int StaleInstancesMarked { get; init; }

Instances marked stale: the larger of the projection count and the runtime state count.

property StaleTasksMarked #

public required int StaleTasksMarked { get; init; }

Task projections marked stale.

class WorkflowRetentionService

public sealed class WorkflowRetentionService

Runs the instance retention: marks stale and purges projections and runtime states.

Parameters

  • projectionRetentionStore: Applies retention to the projections.
  • workflowRuntimeStateStore: The runtime states.

Members

MemberKindSummary
WorkflowRetentionService(IWorkflowProjectionRetentionStore, IWorkflowRuntimeStateStore)constructorRuns the instance retention: marks stale and purges projections and runtime states.
RunAsync(DateTime?, WorkflowRetentionOverride, CancellationToken)methodRuns retention once.
RunAsync(WorkflowRetentionRunRequest, CancellationToken)methodRuns retention for an operator request: ReferenceUtc (default now) and optional day thresholds that override the configured ones for this run.

constructor WorkflowRetentionService(IWorkflowProjectionRetentionStore, IWorkflowRuntimeStateStore) #

public WorkflowRetentionService(IWorkflowProjectionRetentionStore projectionRetentionStore, IWorkflowRuntimeStateStore workflowRuntimeStateStore)

Runs the instance retention: marks stale and purges projections and runtime states.

Parameters

  • projectionRetentionStore: Applies retention to the projections.
  • workflowRuntimeStateStore: The runtime states.

method RunAsync(DateTime?, WorkflowRetentionOverride, CancellationToken) #

public Task<WorkflowRetentionRunResult> RunAsync(DateTime? nowUtc = null, WorkflowRetentionOverride? retentionOverride = null, CancellationToken cancellationToken = default)

Runs retention once.

Parameters

  • nowUtc: The reference time, in UTC; now when not set.
  • retentionOverride: Age thresholds that replace the configured ones for this run.
  • cancellationToken: Cancels the operation.

Returns

The counts.

method RunAsync(WorkflowRetentionRunRequest, CancellationToken) #

public Task<WorkflowRetentionRunResponse> RunAsync(WorkflowRetentionRunRequest request, CancellationToken cancellationToken = default)

Runs retention for an operator request: ReferenceUtc (default now) and optional day thresholds that override the configured ones for this run.

class WorkflowRoleResolutionService

public sealed class WorkflowRoleResolutionService

Computes the roles that may work a task.

Members

MemberKindSummary
WorkflowRoleResolutionService()constructorCreates an instance of WorkflowRoleResolutionService.
NormalizeRoles(IReadOnlyCollection<string>)methodDrops empty roles and duplicates, ignoring case.
ResolveEffectiveRoles(IReadOnlyCollection<string>, IReadOnlyCollection<string>, IReadOnlyCollection<string>)methodThe runtime roles when there are any, else the task roles, else the workflow roles; normalized.

constructor WorkflowRoleResolutionService() #

public WorkflowRoleResolutionService()

Creates an instance of WorkflowRoleResolutionService.

method NormalizeRoles(IReadOnlyCollection<string>) #

public IReadOnlyCollection<string> NormalizeRoles(IReadOnlyCollection<string> roles)

Drops empty roles and duplicates, ignoring case.

Parameters

  • roles: The roles.

Returns

The roles.

method ResolveEffectiveRoles(IReadOnlyCollection<string>, IReadOnlyCollection<string>, IReadOnlyCollection<string>) #

public IReadOnlyCollection<string> ResolveEffectiveRoles(IReadOnlyCollection<string> workflowRoles, IReadOnlyCollection<string> taskRoles, IReadOnlyCollection<string>? runtimeRoles = null)

The runtime roles when there are any, else the task roles, else the workflow roles; normalized.

Parameters

  • workflowRoles: The workflow roles.
  • taskRoles: The task roles.
  • runtimeRoles: The roles computed at runtime.

Returns

The effective roles.

class WorkflowRuntimeService

public sealed class WorkflowRuntimeService

The engine’s workflow runtime: starts instances, reads instances and tasks, completes, assigns and releases tasks, raises signals, cancels instances, and resumes instances with signals.

Members

MemberKindSummary
WorkflowRuntimeService(IWorkflowRegistrationCatalog, IWorkflowDefinitionCatalog, IWorkflowRuntimeOrchestrator, IWorkflowMutationCoordinator, IWorkflowProjectionStore, WorkflowTaskAuthorizationService, IWorkflowRuntimeStateStore, IWorkflowStateJsonPolicy, IWorkflowSignalBus, IWorkflowScheduleBus, IEnumerable<IWorkflowPendingSignalDispatcher>, WorkflowTaskCreationNotifier, IWorkflowActorRoleResolver, WorkflowExecutionActorContext, IWorkflowCallerIdentityAccessor, IWorkflowCancellationCleanupPolicy, IOptions<WorkflowRetentionOptions>, IOptions<WorkflowEngineOptions>, ILogger<WorkflowRuntimeService>, WorkflowObservability)constructorThe engine’s workflow runtime: starts instances, reads instances and tasks, completes, assigns and releases tasks, raises signals, cancels instances, and resumes instances with signals.
AssignTaskAsync(WorkflowTaskAssignRequest, CancellationToken)methodAssigns a human task to a user or to roles.
CancelWorkflowAsync(WorkflowCancelRequest, CancellationToken)methodCancels an instance by queuing its cancel signal, and starts the cleanup workflow when the request names one.
CompleteTaskAsync(WorkflowTaskCompleteRequest, CancellationToken)methodCompletes a human task with a payload; the task’s completion steps run.
ContinueDurableStartAsync(StartWorkflowExecutionV1, long, CancellationToken)methodRuns the start of a durable root whose start decision committed.
GetInstanceAsync(WorkflowInstanceGetRequest, CancellationToken)methodReads one workflow instance.
GetInstancesAsync(WorkflowInstancesGetRequest, CancellationToken)methodLists workflow instances.
GetTaskAsync(WorkflowTaskGetRequest, CancellationToken)methodReads one human task.
GetTasksAsync(WorkflowTasksGetRequest, CancellationToken)methodLists human tasks.
RaiseExternalSignalAsync(WorkflowSignalRaiseRequest, CancellationToken)methodQueues a signal for an instance that waits for it.
ReleaseTaskAsync(WorkflowTaskReleaseRequest, CancellationToken)methodReleases an assigned human task, so another user can take it.
ResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken)methodApplies a signal to its instance; see WorkflowRuntimeService.TryResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken).
StartWorkflowAsync(StartWorkflowRequest, CancellationToken)methodStarts a workflow instance.
TryResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken)methodApplies a signal to its instance.

constructor WorkflowRuntimeService(IWorkflowRegistrationCatalog, IWorkflowDefinitionCatalog, IWorkflowRuntimeOrchestrator, IWorkflowMutationCoordinator, IWorkflowProjectionStore, WorkflowTaskAuthorizationService, IWorkflowRuntimeStateStore, IWorkflowStateJsonPolicy, IWorkflowSignalBus, IWorkflowScheduleBus, IEnumerable<IWorkflowPendingSignalDispatcher>, WorkflowTaskCreationNotifier, IWorkflowActorRoleResolver, WorkflowExecutionActorContext, IWorkflowCallerIdentityAccessor, IWorkflowCancellationCleanupPolicy, IOptions<WorkflowRetentionOptions>, IOptions<WorkflowEngineOptions>, ILogger<WorkflowRuntimeService>, WorkflowObservability) #

public WorkflowRuntimeService(IWorkflowRegistrationCatalog workflowRegistrationCatalog, IWorkflowDefinitionCatalog workflowDefinitionCatalog, IWorkflowRuntimeOrchestrator workflowRuntimeOrchestrator, IWorkflowMutationCoordinator workflowMutationCoordinator, IWorkflowProjectionStore workflowProjectionStore, WorkflowTaskAuthorizationService workflowTaskAuthorizationService, IWorkflowRuntimeStateStore workflowRuntimeStateStore, IWorkflowStateJsonPolicy stateJsonPolicy, IWorkflowSignalBus workflowSignalBus, IWorkflowScheduleBus workflowScheduleBus, IEnumerable<IWorkflowPendingSignalDispatcher> pendingSignalDispatchers, WorkflowTaskCreationNotifier taskCreationNotifier, IWorkflowActorRoleResolver actorContextResolver, WorkflowExecutionActorContext executionActorContext, IWorkflowCallerIdentityAccessor callerIdentity, IWorkflowCancellationCleanupPolicy cancellationCleanupPolicy, IOptions<WorkflowRetentionOptions> retentionOptions, IOptions<WorkflowEngineOptions> engineOptions, ILogger<WorkflowRuntimeService> logger, WorkflowObservability observability)

The engine’s workflow runtime: starts instances, reads instances and tasks, completes, assigns and releases tasks, raises signals, cancels instances, and resumes instances with signals.

method AssignTaskAsync(WorkflowTaskAssignRequest, CancellationToken) #

public Task<WorkflowTaskAssignResponse> AssignTaskAsync(WorkflowTaskAssignRequest request, CancellationToken cancellationToken = default)

Assigns a human task to a user or to roles.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The assigned task.

method CancelWorkflowAsync(WorkflowCancelRequest, CancellationToken) #

public Task<WorkflowCancelResponse> CancelWorkflowAsync(WorkflowCancelRequest request, CancellationToken cancellationToken = default)

Cancels an instance by queuing its cancel signal, and starts the cleanup workflow when the request names one.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

Whether the cancel signal was queued, and the cleanup instance.

method CompleteTaskAsync(WorkflowTaskCompleteRequest, CancellationToken) #

public Task<WorkflowTaskCompleteResponse> CompleteTaskAsync(WorkflowTaskCompleteRequest request, CancellationToken cancellationToken = default)

Completes a human task with a payload; the task’s completion steps run.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The outcome of the completion.

method ContinueDurableStartAsync(StartWorkflowExecutionV1, long, CancellationToken) #

public Task<bool> ContinueDurableStartAsync(StartWorkflowExecutionV1 durableRequest, long expectedExecutionVersion, CancellationToken cancellationToken = default)

Runs the start of a durable root whose start decision committed.

Parameters

  • durableRequest: The durable start request.
  • expectedExecutionVersion: The execution version the root was created at.
  • cancellationToken: Cancels the operation.

Returns

true when the start ran; false when the execution already moved past that version.

Exceptions

method GetInstanceAsync(WorkflowInstanceGetRequest, CancellationToken) #

public Task<WorkflowInstanceGetResponse> GetInstanceAsync(WorkflowInstanceGetRequest request, CancellationToken cancellationToken = default)

Reads one workflow instance.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The instance.

method GetInstancesAsync(WorkflowInstancesGetRequest, CancellationToken) #

public Task<WorkflowInstancesGetResponse> GetInstancesAsync(WorkflowInstancesGetRequest request, CancellationToken cancellationToken = default)

Lists workflow instances.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

A page of instances.

method GetTaskAsync(WorkflowTaskGetRequest, CancellationToken) #

public Task<WorkflowTaskGetResponse> GetTaskAsync(WorkflowTaskGetRequest request, CancellationToken cancellationToken = default)

Reads one human task.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The task.

method GetTasksAsync(WorkflowTasksGetRequest, CancellationToken) #

public Task<WorkflowTasksGetResponse> GetTasksAsync(WorkflowTasksGetRequest request, CancellationToken cancellationToken = default)

Lists human tasks.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

A page of tasks.

method RaiseExternalSignalAsync(WorkflowSignalRaiseRequest, CancellationToken) #

public Task<WorkflowSignalRaiseResponse> RaiseExternalSignalAsync(WorkflowSignalRaiseRequest request, CancellationToken cancellationToken = default)

Queues a signal for an instance that waits for it.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The queued signal.

method ReleaseTaskAsync(WorkflowTaskReleaseRequest, CancellationToken) #

public Task<WorkflowTaskReleaseResponse> ReleaseTaskAsync(WorkflowTaskReleaseRequest request, CancellationToken cancellationToken = default)

Releases an assigned human task, so another user can take it.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The released task.

method ResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken) #

public Task ResumeSignalAsync(WorkflowSignalEnvelope signal, CancellationToken cancellationToken = default)

Applies a signal to its instance; see WorkflowRuntimeService.TryResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken).

Parameters

  • signal: The signal.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the signal is handled.

method StartWorkflowAsync(StartWorkflowRequest, CancellationToken) #

public Task<StartWorkflowResponse> StartWorkflowAsync(StartWorkflowRequest request, CancellationToken cancellationToken = default)

Starts a workflow instance.

Parameters

  • request: The request.
  • cancellationToken: Cancels the operation.

Returns

The new instance.

method TryResumeSignalAsync(WorkflowSignalEnvelope, CancellationToken) #

public Task<bool> TryResumeSignalAsync(WorkflowSignalEnvelope signal, CancellationToken cancellationToken = default)

Applies a signal to its instance. A signal that loses the version check is applied again on the reloaded instance, up to five times; a duplicate or stale signal is ignored.

Parameters

  • signal: The signal.
  • cancellationToken: Cancels the operation.

Returns

Whether the signal was applied.

Exceptions

class WorkflowSignalDeadLetterService

public sealed class WorkflowSignalDeadLetterService

Lists and replays dead-lettered signals.

Parameters

  • deadLetterStore: The dead letter store.

Members

MemberKindSummary
WorkflowSignalDeadLetterService(IWorkflowSignalDeadLetterStore)constructorLists and replays dead-lettered signals.
GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken)methodLists the dead letters.
ReplayAsync(WorkflowSignalDeadLetterReplayRequest, CancellationToken)methodPuts a dead letter back on the signal queue.

constructor WorkflowSignalDeadLetterService(IWorkflowSignalDeadLetterStore) #

public WorkflowSignalDeadLetterService(IWorkflowSignalDeadLetterStore deadLetterStore)

Lists and replays dead-lettered signals.

Parameters

  • deadLetterStore: The dead letter store.

method GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken) #

public Task<WorkflowSignalDeadLettersGetResponse> GetMessagesAsync(WorkflowSignalDeadLettersGetRequest request, CancellationToken cancellationToken = default)

Lists the dead letters.

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 WorkflowSignalPumpTelemetryService

public sealed class WorkflowSignalPumpTelemetryService

Counts the signal pump’s work in this process, for the pump statistics.

Members

MemberKindSummary
WorkflowSignalPumpTelemetryService()constructorCreates an instance of WorkflowSignalPumpTelemetryService.
GetStats()methodReturns the counts so far.
RecordConcurrencySkip(string, WorkflowSignalEnvelope, int, TimeSpan)methodCounts a delivery put back because the instance kept changing.
RecordDeadLetter(string, WorkflowSignalEnvelope, int, TimeSpan, string)methodCounts a dead-lettered signal.
RecordEmptyPoll(string)methodCounts a poll that found no signal.
RecordFailure(string, WorkflowSignalEnvelope, int, TimeSpan, Exception)methodCounts a failed delivery.
RecordProcessed(string, WorkflowSignalEnvelope, int, TimeSpan)methodCounts a processed signal.

constructor WorkflowSignalPumpTelemetryService() #

public WorkflowSignalPumpTelemetryService()

Creates an instance of WorkflowSignalPumpTelemetryService.

method GetStats() #

public WorkflowSignalPumpStatsGetResponse GetStats()

Returns the counts so far.

Returns

The statistics.

method RecordConcurrencySkip(string, WorkflowSignalEnvelope, int, TimeSpan) #

public void RecordConcurrencySkip(string consumerName, WorkflowSignalEnvelope envelope, int deliveryCount, TimeSpan duration)

Counts a delivery put back because the instance kept changing.

Parameters

  • consumerName: The consumer.
  • envelope: The signal.
  • deliveryCount: The delivery attempt.
  • duration: How long it took.

method RecordDeadLetter(string, WorkflowSignalEnvelope, int, TimeSpan, string) #

public void RecordDeadLetter(string consumerName, WorkflowSignalEnvelope envelope, int deliveryCount, TimeSpan duration, string? message)

Counts a dead-lettered signal.

Parameters

  • consumerName: The consumer.
  • envelope: The signal.
  • deliveryCount: The delivery attempt.
  • duration: How long it took.
  • message: The error message.

method RecordEmptyPoll(string) #

public void RecordEmptyPoll(string consumerName)

Counts a poll that found no signal.

Parameters

  • consumerName: The consumer.

method RecordFailure(string, WorkflowSignalEnvelope, int, TimeSpan, Exception) #

public void RecordFailure(string consumerName, WorkflowSignalEnvelope envelope, int deliveryCount, TimeSpan duration, Exception exception)

Counts a failed delivery.

Parameters

  • consumerName: The consumer.
  • envelope: The signal.
  • deliveryCount: The delivery attempt.
  • duration: How long it took.
  • exception: The failure.

method RecordProcessed(string, WorkflowSignalEnvelope, int, TimeSpan) #

public void RecordProcessed(string consumerName, WorkflowSignalEnvelope envelope, int deliveryCount, TimeSpan duration)

Counts a processed signal.

Parameters

  • consumerName: The consumer.
  • envelope: The signal.
  • deliveryCount: The delivery attempt.
  • duration: How long it took.

class WorkflowStudioDescriptor

public sealed class WorkflowStudioDescriptor

Describes the workflow service to tools.

Parameters

  • options: The studio options.

Members

MemberKindSummary
WorkflowStudioDescriptor(IOptions<WorkflowStudioOptions>)constructorDescribes the workflow service to tools.
GetMetadata()methodReturns the service metadata.

constructor WorkflowStudioDescriptor(IOptions<WorkflowStudioOptions>) #

public WorkflowStudioDescriptor(IOptions<WorkflowStudioOptions> options)

Describes the workflow service to tools.

Parameters

  • options: The studio options.

method GetMetadata() #

public WorkflowServiceMetadata GetMetadata()

Returns the service metadata.

Returns

The metadata.

class WorkflowStudioOptions

public sealed class WorkflowStudioOptions

Names the host and its diagram provider in the workflow service metadata.

Members

MemberKindSummary
WorkflowStudioOptions()constructorCreates an instance of WorkflowStudioOptions.
SectionNameconstantThe configuration section the options bind from: WorkflowStudio.
DiagramProviderpropertyThe diagram provider name the workflow service metadata reports.
ServiceNamepropertyThe service name the workflow service metadata reports.

constructor WorkflowStudioOptions() #

public WorkflowStudioOptions()

Creates an instance of WorkflowStudioOptions.

constant SectionName #

public const string SectionName = "WorkflowStudio"

The configuration section the options bind from: WorkflowStudio.

property DiagramProvider #

public string DiagramProvider { get; set; }

The diagram provider name the workflow service metadata reports. The default is StellaOps Engine.

property ServiceName #

public string ServiceName { get; set; }

The service name the workflow service metadata reports. The default is StellaOps.Workflow.

class WorkflowTaskCreationNotifier

public sealed class WorkflowTaskCreationNotifier

Singleton notification service that allows CompleteTaskAsync to block until the signal pump creates the next user task for a workflow instance.

Members

MemberKindSummary
WorkflowTaskCreationNotifier()constructorCreates an instance of WorkflowTaskCreationNotifier.
NotifyTaskCreated(string)methodCalled by the projection store when a new task is created for a workflow instance.
WaitForTaskAsync(string, TimeSpan, CancellationToken)methodRegister a waiter for a workflow instance.

constructor WorkflowTaskCreationNotifier() #

public WorkflowTaskCreationNotifier()

Creates an instance of WorkflowTaskCreationNotifier.

method NotifyTaskCreated(string) #

public void NotifyTaskCreated(string workflowInstanceId)

Called by the projection store when a new task is created for a workflow instance. Unblocks any waiting CompleteTaskAsync call.

method WaitForTaskAsync(string, TimeSpan, CancellationToken) #

public Task<bool> WaitForTaskAsync(string workflowInstanceId, TimeSpan timeout, CancellationToken cancellationToken)

Register a waiter for a workflow instance. Returns a task that completes when NotifyTaskCreated is called for this instance, or when the timeout expires.

namespace StellaOps.Workflow.Engine.Services.Converters

TypeKindDescription
CanonicalBundleSourceConverterclassCanonical workflow definition plus its rendering assets, packed as a single ZIP archive.
CanonicalJsonSourceConverterclassPass-through converter for the engine’s native canonical JSON format.
CanonicalYamlSourceConverterclassRound-trips canonical workflow definitions through YAML.
WorkflowSourceFormatRegistryclassThe registry of the source format converters.

class CanonicalBundleSourceConverter

public sealed class CanonicalBundleSourceConverter : IWorkflowSourceFormatConverter

Canonical workflow definition plus its rendering assets, packed as a single ZIP archive. Layout:

manifest.json              # { "schema": "stellaops.bundle/v1", "workflowName", "workflowVersion", "createdOnUtc" }
canonical.json             # the canonical definition JSON
renderings/elksharp.svg    # optional
renderings/elksharp.png    # optional
renderings/elksharp.render.json   # optional

Members

MemberKindSummary
CanonicalBundleSourceConverter()constructorCreates an instance of CanonicalBundleSourceConverter.
ContentTypepropertyMIME type of the content this converter produces / consumes.
DisplayNamepropertyHuman-friendly name, for example for a format picker.
FileExtensionpropertyCanonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).
FormatIdpropertyStable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).
IsBinarypropertyTrue when the format is not safely paste-able as text (e.g., binary ZIP).
SupportsExportpropertyTrue when the converter supports encoding a stored definition into its format.
SupportsImportpropertyTrue when the converter supports decoding its format into canonical JSON.
ExportAsync(WorkflowDefinitionRecord, CancellationToken)methodConverts a stored definition to the format.
ImportAsync(byte[], CancellationToken)methodConverts content of the format to a canonical definition.

constructor CanonicalBundleSourceConverter() #

public CanonicalBundleSourceConverter()

Creates an instance of CanonicalBundleSourceConverter.

property ContentType #

public string ContentType { get; }

MIME type of the content this converter produces / consumes.

property DisplayName #

public string DisplayName { get; }

Human-friendly name, for example for a format picker.

property FileExtension #

public string FileExtension { get; }

Canonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).

property FormatId #

public string FormatId { get; }

Stable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).

property IsBinary #

public bool IsBinary { get; }

True when the format is not safely paste-able as text (e.g., binary ZIP). UI uses this to disable the textarea mode and force file upload.

property SupportsExport #

public bool SupportsExport { get; }

True when the converter supports encoding a stored definition into its format.

property SupportsImport #

public bool SupportsImport { get; }

True when the converter supports decoding its format into canonical JSON.

method ExportAsync(WorkflowDefinitionRecord, CancellationToken) #

public Task<WorkflowSourceExportResult> ExportAsync(WorkflowDefinitionRecord record, CancellationToken cancellationToken = default)

Converts a stored definition to the format.

Parameters

  • record: The stored definition.
  • cancellationToken: Cancels the operation.

Returns

The content, its media type and a file name.

method ImportAsync(byte[], CancellationToken) #

public Task<WorkflowSourceImportResult> ImportAsync(byte[] content, CancellationToken cancellationToken = default)

Converts content of the format to a canonical definition.

Parameters

  • content: The content.
  • cancellationToken: Cancels the operation.

Returns

The canonical definition, or the diagnostics of a failed conversion.

class CanonicalJsonSourceConverter

public sealed class CanonicalJsonSourceConverter : IWorkflowSourceFormatConverter

Pass-through converter for the engine’s native canonical JSON format. Import does a light UTF-8 decode + structural probe; export emits the stored CanonicalDefinitionJson verbatim.

Members

MemberKindSummary
CanonicalJsonSourceConverter()constructorCreates an instance of CanonicalJsonSourceConverter.
ContentTypepropertyMIME type of the content this converter produces / consumes.
DisplayNamepropertyHuman-friendly name, for example for a format picker.
FileExtensionpropertyCanonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).
FormatIdpropertyStable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).
IsBinarypropertyTrue when the format is not safely paste-able as text (e.g., binary ZIP).
SupportsExportpropertyTrue when the converter supports encoding a stored definition into its format.
SupportsImportpropertyTrue when the converter supports decoding its format into canonical JSON.
ExportAsync(WorkflowDefinitionRecord, CancellationToken)methodConverts a stored definition to the format.
ImportAsync(byte[], CancellationToken)methodConverts content of the format to a canonical definition.

constructor CanonicalJsonSourceConverter() #

public CanonicalJsonSourceConverter()

Creates an instance of CanonicalJsonSourceConverter.

property ContentType #

public string ContentType { get; }

MIME type of the content this converter produces / consumes.

property DisplayName #

public string DisplayName { get; }

Human-friendly name, for example for a format picker.

property FileExtension #

public string FileExtension { get; }

Canonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).

property FormatId #

public string FormatId { get; }

Stable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).

property IsBinary #

public bool IsBinary { get; }

True when the format is not safely paste-able as text (e.g., binary ZIP). UI uses this to disable the textarea mode and force file upload.

property SupportsExport #

public bool SupportsExport { get; }

True when the converter supports encoding a stored definition into its format.

property SupportsImport #

public bool SupportsImport { get; }

True when the converter supports decoding its format into canonical JSON.

method ExportAsync(WorkflowDefinitionRecord, CancellationToken) #

public Task<WorkflowSourceExportResult> ExportAsync(WorkflowDefinitionRecord record, CancellationToken cancellationToken = default)

Converts a stored definition to the format.

Parameters

  • record: The stored definition.
  • cancellationToken: Cancels the operation.

Returns

The content, its media type and a file name.

method ImportAsync(byte[], CancellationToken) #

public Task<WorkflowSourceImportResult> ImportAsync(byte[] content, CancellationToken cancellationToken = default)

Converts content of the format to a canonical definition.

Parameters

  • content: The content.
  • cancellationToken: Cancels the operation.

Returns

The canonical definition, or the diagnostics of a failed conversion.

class CanonicalYamlSourceConverter

public sealed class CanonicalYamlSourceConverter : IWorkflowSourceFormatConverter

Round-trips canonical workflow definitions through YAML. YAML offers a friendlier authoring experience for the same schema; the engine’s validator is JSON-based, so the converter always converts YAML to JSON before the core import pipeline receives it.

Members

MemberKindSummary
CanonicalYamlSourceConverter()constructorCreates an instance of CanonicalYamlSourceConverter.
ContentTypepropertyMIME type of the content this converter produces / consumes.
DisplayNamepropertyHuman-friendly name, for example for a format picker.
FileExtensionpropertyCanonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).
FormatIdpropertyStable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).
IsBinarypropertyTrue when the format is not safely paste-able as text (e.g., binary ZIP).
SupportsExportpropertyTrue when the converter supports encoding a stored definition into its format.
SupportsImportpropertyTrue when the converter supports decoding its format into canonical JSON.
ExportAsync(WorkflowDefinitionRecord, CancellationToken)methodConverts a stored definition to the format.
ImportAsync(byte[], CancellationToken)methodConverts content of the format to a canonical definition.

constructor CanonicalYamlSourceConverter() #

public CanonicalYamlSourceConverter()

Creates an instance of CanonicalYamlSourceConverter.

property ContentType #

public string ContentType { get; }

MIME type of the content this converter produces / consumes.

property DisplayName #

public string DisplayName { get; }

Human-friendly name, for example for a format picker.

property FileExtension #

public string FileExtension { get; }

Canonical file extension including the leading dot (e.g., “.json”, “.yaml”, “.zip”).

property FormatId #

public string FormatId { get; }

Stable, machine-readable identifier (e.g., “canonical-json”, “canonical-yaml”, “canonical-bundle”).

property IsBinary #

public bool IsBinary { get; }

True when the format is not safely paste-able as text (e.g., binary ZIP). UI uses this to disable the textarea mode and force file upload.

property SupportsExport #

public bool SupportsExport { get; }

True when the converter supports encoding a stored definition into its format.

property SupportsImport #

public bool SupportsImport { get; }

True when the converter supports decoding its format into canonical JSON.

method ExportAsync(WorkflowDefinitionRecord, CancellationToken) #

public Task<WorkflowSourceExportResult> ExportAsync(WorkflowDefinitionRecord record, CancellationToken cancellationToken = default)

Converts a stored definition to the format.

Parameters

  • record: The stored definition.
  • cancellationToken: Cancels the operation.

Returns

The content, its media type and a file name.

method ImportAsync(byte[], CancellationToken) #

public Task<WorkflowSourceImportResult> ImportAsync(byte[] content, CancellationToken cancellationToken = default)

Converts content of the format to a canonical definition.

Parameters

  • content: The content.
  • cancellationToken: Cancels the operation.

Returns

The canonical definition, or the diagnostics of a failed conversion.

class WorkflowSourceFormatRegistry

public sealed class WorkflowSourceFormatRegistry : IWorkflowSourceFormatRegistry

The registry of the source format converters.

Parameters

  • converters: The registered converters.

Members

MemberKindSummary
WorkflowSourceFormatRegistry(IEnumerable<IWorkflowSourceFormatConverter>)constructorThe registry of the source format converters.
GetAll()methodReturns the converters, ordered by display name.
GetRequired(string)methodFinds a converter by format id, ignoring case.
TryGet(string)methodFinds a converter by format id, ignoring case.

constructor WorkflowSourceFormatRegistry(IEnumerable<IWorkflowSourceFormatConverter>) #

public WorkflowSourceFormatRegistry(IEnumerable<IWorkflowSourceFormatConverter> converters)

The registry of the source format converters.

Parameters

  • converters: The registered converters.

method GetAll() #

public IReadOnlyCollection<IWorkflowSourceFormatConverter> GetAll()

Returns the converters, ordered by display name.

Returns

The converters.

method GetRequired(string) #

public IWorkflowSourceFormatConverter GetRequired(string formatId)

Finds a converter by format id, ignoring case.

Parameters

  • formatId: The format id.

Returns

The converter.

Exceptions

  • InvalidOperationException: No converter has the format id.

method TryGet(string) #

public IWorkflowSourceFormatConverter? TryGet(string formatId)

Finds a converter by format id, ignoring case.

Parameters

  • formatId: The format id.

Returns

The converter, or null.

namespace StellaOps.Workflow.Engine.Signaling

TypeKindDescription
IWorkflowSignalCommandDispatcherinterfaceRuns the start and resume commands that arrive as signals.
NullWorkflowSignalBusclassThe signal bus of a host without signaling: every call raises NotSupportedException.
NullWorkflowSignalClaimStoreclassA claim store that never has a signal to claim.
NullWorkflowSignalDeadLetterStoreclassThe dead letter store used when the backend registers none: every call raises NotSupportedException.
NullWorkflowSignalDriverclassThe signal driver None: it sends no wake and has no signal to receive.
NullWorkflowSignalStoreclassThe signal store of a host without one: it logs a warning and stores nothing.
NullWorkflowWakeOutboxclassA wake outbox that stores nothing.
NullWorkflowWakeOutboxReceiverclassA wake outbox receiver that never has a notification.
WorkflowSignalBusBridgeclassThe signal bus over the signal store and driver: it stores a signal, then wakes the consumers as the driver’s dispatch mode says, and receives through the driver.
WorkflowSignalCommandDispatcherclassRuns signal commands through the workflow runtime service.
WorkflowSignalEnvelopeSerializerclassSerializes signal envelopes as JSON with the web defaults (camel-case names); payload keys compare ignoring case.
WorkflowSignalProcessorclassApplies the engine’s signals: a timer, retry, external signal or child completion resumes its instance, and an internal continue starts the next workflow; another type raises NotSupportedException.

interface IWorkflowSignalCommandDispatcher

public interface IWorkflowSignalCommandDispatcher

Runs the start and resume commands that arrive as signals.

Members

MemberKindSummary
DispatchResumeWorkflowAsync(WorkflowSignalEnvelope, CancellationToken)methodApplies a signal to its instance.
DispatchStartWorkflowAsync(StartWorkflowRequest, CancellationToken)methodStarts a workflow.

method DispatchResumeWorkflowAsync(WorkflowSignalEnvelope, CancellationToken) #

Task DispatchResumeWorkflowAsync(WorkflowSignalEnvelope envelope, CancellationToken cancellationToken = default)

Applies a signal to its instance.

Parameters

  • envelope: The signal.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the signal is handled.

method DispatchStartWorkflowAsync(StartWorkflowRequest, CancellationToken) #

Task DispatchStartWorkflowAsync(StartWorkflowRequest request, CancellationToken cancellationToken = default)

Starts a workflow.

Parameters

  • request: The start request.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the start has run.

class NullWorkflowSignalBus

public sealed class NullWorkflowSignalBus : IWorkflowSignalBus

The signal bus of a host without signaling: every call raises NotSupportedException.

Members

MemberKindSummary
NullWorkflowSignalBus()constructorCreates an instance of NullWorkflowSignalBus.
PublishAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal for delivery.
PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal that could not be processed as a dead letter.
ReceiveAsync(string, CancellationToken)methodWaits for a signal to claim.

constructor NullWorkflowSignalBus() #

public NullWorkflowSignalBus()

Creates an instance of NullWorkflowSignalBus.

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 ReceiveAsync(string, CancellationToken) #

public Task<IWorkflowSignalLease?> ReceiveAsync(string consumerName, CancellationToken cancellationToken = default)

Waits 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 NullWorkflowSignalClaimStore

public sealed class NullWorkflowSignalClaimStore : IWorkflowSignalClaimStore

A claim store that never has a signal to claim.

Members

MemberKindSummary
NullWorkflowSignalClaimStore()constructorCreates an instance of NullWorkflowSignalClaimStore.
TryClaimAsync(string, CancellationToken)methodClaims one available signal for a consumer.

constructor NullWorkflowSignalClaimStore() #

public NullWorkflowSignalClaimStore()

Creates an instance of NullWorkflowSignalClaimStore.

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 NullWorkflowSignalDeadLetterStore

public sealed class NullWorkflowSignalDeadLetterStore : IWorkflowSignalDeadLetterStore

The dead letter store used when the backend registers none: every call raises NotSupportedException.

Members

MemberKindSummary
NullWorkflowSignalDeadLetterStore()constructorCreates an instance of NullWorkflowSignalDeadLetterStore.
GetMessagesAsync(WorkflowSignalDeadLettersGetRequest, CancellationToken)methodLists the dead-lettered signals.
ReplayAsync(WorkflowSignalDeadLetterReplayRequest, CancellationToken)methodPuts a dead letter back on the signal queue.

constructor NullWorkflowSignalDeadLetterStore() #

public NullWorkflowSignalDeadLetterStore()

Creates an instance of NullWorkflowSignalDeadLetterStore.

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 NullWorkflowSignalDriver

public sealed class NullWorkflowSignalDriver : IWorkflowSignalDriver

The signal driver None: it sends no wake and has no signal to receive.

Members

MemberKindSummary
NullWorkflowSignalDriver()constructorCreates an instance of NullWorkflowSignalDriver.
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 NullWorkflowSignalDriver() #

public NullWorkflowSignalDriver()

Creates an instance of NullWorkflowSignalDriver.

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 NullWorkflowSignalStore

public sealed class NullWorkflowSignalStore : IWorkflowSignalStore

The signal store of a host without one: it logs a warning and stores nothing.

Parameters

  • logger: Receives the warnings.

Members

MemberKindSummary
NullWorkflowSignalStore(ILogger<NullWorkflowSignalStore>)constructorThe signal store of a host without one: it logs a warning and stores nothing.
PublishAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal for delivery.
PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal that could not be processed as a dead letter.

constructor NullWorkflowSignalStore(ILogger<NullWorkflowSignalStore>) #

public NullWorkflowSignalStore(ILogger<NullWorkflowSignalStore> logger)

The signal store of a host without one: it logs a warning and stores nothing.

Parameters

  • logger: Receives the warnings.

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.

class NullWorkflowWakeOutbox

public sealed class NullWorkflowWakeOutbox : IWorkflowWakeOutbox

A wake outbox that stores nothing.

Members

MemberKindSummary
NullWorkflowWakeOutbox()constructorCreates an instance of NullWorkflowWakeOutbox.
EnqueueAsync(WorkflowSignalWakeNotification, CancellationToken)methodWrites a wake notification to the outbox.

constructor NullWorkflowWakeOutbox() #

public NullWorkflowWakeOutbox()

Creates an instance of NullWorkflowWakeOutbox.

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.

class NullWorkflowWakeOutboxReceiver

public sealed class NullWorkflowWakeOutboxReceiver : IWorkflowWakeOutboxReceiver

A wake outbox receiver that never has a notification.

Members

MemberKindSummary
NullWorkflowWakeOutboxReceiver()constructorCreates an instance of NullWorkflowWakeOutboxReceiver.
ReceiveAsync(string, CancellationToken)methodClaims one wake notification of the outbox for a consumer.

constructor NullWorkflowWakeOutboxReceiver() #

public NullWorkflowWakeOutboxReceiver()

Creates an instance of NullWorkflowWakeOutboxReceiver.

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 WorkflowSignalBusBridge

public sealed class WorkflowSignalBusBridge : IWorkflowSignalBus

The signal bus over the signal store and driver: it stores a signal, then wakes the consumers as the driver’s dispatch mode says, and receives through the driver.

Parameters

  • signalStore: Stores the signals.
  • signalDriver: Wakes the consumers and hands out signals.
  • wakeOutbox: The wake outbox, for the WakeOutbox dispatch mode.
  • mutationScopeAccessor: The open change scope, for post-commit wakes.

Members

MemberKindSummary
WorkflowSignalBusBridge(IWorkflowSignalStore, IWorkflowSignalDriver, IWorkflowWakeOutbox, IWorkflowMutationScopeAccessor)constructorThe signal bus over the signal store and driver: it stores a signal, then wakes the consumers as the driver’s dispatch mode says, and receives through the driver.
PublishAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal for delivery.
PublishDeadLetterAsync(WorkflowSignalEnvelope, CancellationToken)methodStores a signal that could not be processed as a dead letter.
ReceiveAsync(string, CancellationToken)methodWaits for a signal to claim.

constructor WorkflowSignalBusBridge(IWorkflowSignalStore, IWorkflowSignalDriver, IWorkflowWakeOutbox, IWorkflowMutationScopeAccessor) #

public WorkflowSignalBusBridge(IWorkflowSignalStore signalStore, IWorkflowSignalDriver signalDriver, IWorkflowWakeOutbox wakeOutbox, IWorkflowMutationScopeAccessor mutationScopeAccessor)

The signal bus over the signal store and driver: it stores a signal, then wakes the consumers as the driver’s dispatch mode says, and receives through the driver.

Parameters

  • signalStore: Stores the signals.
  • signalDriver: Wakes the consumers and hands out signals.
  • wakeOutbox: The wake outbox, for the WakeOutbox dispatch mode.
  • mutationScopeAccessor: The open change scope, for post-commit wakes.

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 ReceiveAsync(string, CancellationToken) #

public Task<IWorkflowSignalLease?> ReceiveAsync(string consumerName, CancellationToken cancellationToken = default)

Waits 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 WorkflowSignalCommandDispatcher

public sealed class WorkflowSignalCommandDispatcher : IWorkflowSignalCommandDispatcher

Runs signal commands through the workflow runtime service.

Parameters

  • workflowRuntimeService: The runtime service.

Members

MemberKindSummary
WorkflowSignalCommandDispatcher(WorkflowRuntimeService)constructorRuns signal commands through the workflow runtime service.
DispatchResumeWorkflowAsync(WorkflowSignalEnvelope, CancellationToken)methodApplies a signal to its instance.
DispatchStartWorkflowAsync(StartWorkflowRequest, CancellationToken)methodStarts a workflow.

constructor WorkflowSignalCommandDispatcher(WorkflowRuntimeService) #

public WorkflowSignalCommandDispatcher(WorkflowRuntimeService workflowRuntimeService)

Runs signal commands through the workflow runtime service.

Parameters

  • workflowRuntimeService: The runtime service.

method DispatchResumeWorkflowAsync(WorkflowSignalEnvelope, CancellationToken) #

public Task DispatchResumeWorkflowAsync(WorkflowSignalEnvelope envelope, CancellationToken cancellationToken = default)

Applies a signal to its instance.

Parameters

  • envelope: The signal.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the signal is handled.

method DispatchStartWorkflowAsync(StartWorkflowRequest, CancellationToken) #

public Task DispatchStartWorkflowAsync(StartWorkflowRequest request, CancellationToken cancellationToken = default)

Starts a workflow.

Parameters

  • request: The start request.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the start has run.

class WorkflowSignalEnvelopeSerializer

public sealed class WorkflowSignalEnvelopeSerializer

Serializes signal envelopes as JSON with the web defaults (camel-case names); payload keys compare ignoring case.

Members

MemberKindSummary
WorkflowSignalEnvelopeSerializer()constructorCreates an instance of WorkflowSignalEnvelopeSerializer.
Deserialize(byte[])methodDeserializes an envelope.
Serialize(WorkflowSignalEnvelope)methodSerializes an envelope.

constructor WorkflowSignalEnvelopeSerializer() #

public WorkflowSignalEnvelopeSerializer()

Creates an instance of WorkflowSignalEnvelopeSerializer.

method Deserialize(byte[]) #

public WorkflowSignalEnvelope Deserialize(byte[] payload)

Deserializes an envelope.

Parameters

  • payload: The UTF-8 JSON.

Returns

The envelope.

Exceptions

  • InvalidOperationException: The JSON is null.

method Serialize(WorkflowSignalEnvelope) #

public byte[] Serialize(WorkflowSignalEnvelope envelope)

Serializes an envelope.

Parameters

  • envelope: The envelope.

Returns

The UTF-8 JSON.

class WorkflowSignalProcessor

public sealed class WorkflowSignalProcessor : IWorkflowSignalProcessor

Applies the engine’s signals: a timer, retry, external signal or child completion resumes its instance, and an internal continue starts the next workflow; another type raises NotSupportedException.

Parameters

  • commandDispatcher: Runs the resume and start commands.
  • callerIdentity: Restores the caller a continuation signal carries.

Members

MemberKindSummary
WorkflowSignalProcessor(IWorkflowSignalCommandDispatcher, IWorkflowCallerIdentityAccessor)constructorApplies the engine’s signals: a timer, retry, external signal or child completion resumes its instance, and an internal continue starts the next workflow; another type raises NotSupportedException.
ProcessAsync(WorkflowSignalEnvelope, CancellationToken)methodApplies a signal to its instance.

constructor WorkflowSignalProcessor(IWorkflowSignalCommandDispatcher, IWorkflowCallerIdentityAccessor) #

public WorkflowSignalProcessor(IWorkflowSignalCommandDispatcher commandDispatcher, IWorkflowCallerIdentityAccessor callerIdentity)

Applies the engine’s signals: a timer, retry, external signal or child completion resumes its instance, and an internal continue starts the next workflow; another type raises NotSupportedException.

Parameters

  • commandDispatcher: Runs the resume and start commands.
  • callerIdentity: Restores the caller a continuation signal carries.

method ProcessAsync(WorkflowSignalEnvelope, CancellationToken) #

public Task ProcessAsync(WorkflowSignalEnvelope envelope, CancellationToken cancellationToken = default)

Applies a signal to its instance.

Parameters

  • envelope: The signal.
  • cancellationToken: Cancels the operation.

Returns

A task that completes when the signal is applied.