elsa-core/src/modules/Elsa.Workflows.Runtime/Services
Sipke Schoorstra 2dcd852833
Enhances workflow runtime resilience and signaling (#6643)
* Refactor BookmarkQueueSignaler to use Channel for signaling.

Replaced TaskCompletionSource with a bounded Channel to improve concurrency control and simplify the code. This change ensures better handling of multiple producers while maintaining a single reader model.

* Refactor BookmarkQueueWorker to improve resilience and clarity

Replaced Debouncer with Throttler for rate limiting and added error handling to log exceptions and ensure the worker loop continues safely while allowing proper shutdown on cancellation.

* Handle missing workflow instance during bookmark resumption

Add exception handling for `WorkflowInstanceNotFoundException` to handle cases where the workflow instance does not exist. Log a debug message and return `ResumeBookmarkResult.NotFound()` when such instances are encountered. This ensures better error management and logging for bookmark resumption.

* Refactor default initializations and rename completion methods.

Replaced `default!` with `null!` for input properties to improve clarity and consistency. Renamed methods to better reflect their purpose, changing `CheckIfCompletedAsync` to `AttemptToCompleteAsync`. These changes enhance code readability and maintainability.

* Refactor to use specific exceptions for workflow errors

Replaced generic `InvalidOperationException` with `WorkflowInstanceNotFoundException` and `WorkflowGraphNotFoundException` for improved error context. This enhances clarity and enables more precise error handling.

* Change default value of WorkflowInstanceId to null

Updated the property `WorkflowInstanceId` to use `null!` instead of `default!` to better align with nullable reference type semantics. This ensures clarity and consistency in the codebase regarding expected default values.

* Add handling for WorkflowInstanceSaved in SignalBookmarkQueueWorker

Updated the SignalBookmarkQueueWorker to implement INotificationHandler for WorkflowInstanceSaved. This ensures that workflow instance save events now trigger the bookmark queue worker, improving event handling consistency.

* Update comment to clarify bookmark and workflow instance check

Expanded the comment to explain that the queue item is stored not only when a bookmark is missing but also when the associated workflow instance is not yet in the database. This improves clarity for future maintainers regarding queuing conditions.
2025-05-13 13:51:47 +02:00
..
ActivityExecutionService.cs Refactor Fault Propagation and Simplify Bookmark Management (#6545) 2025-04-10 15:01:49 +02:00
BackgroundActivityInvoker.cs Fixed Log Persistence Mode Evaluation For Activity Execution (#6595) 2025-04-17 18:03:06 +02:00
BackgroundStimulusDispatcher.cs Fix race condition in Distributed Workflow Runtime during same-workflow event publishing (#6538) 2025-03-31 18:11:27 +02:00
BackgroundTaskDispatcher.cs
BackgroundWorkflowCancellationDispatcher.cs
BackgroundWorkflowDispatcher.cs Add support for starting new trace contexts in workflows 2025-03-15 21:14:10 +01:00
BookmarkBoundWorkflowService.cs
BookmarkPersister.cs Refactor Fault Propagation and Simplify Bookmark Management (#6545) 2025-04-10 15:01:49 +02:00
BookmarkQueueProcessor.cs Fix race condition and add rate limiting to bookmark queue processing (#6187) 2024-12-07 17:34:10 +01:00
BookmarkQueueSignaler.cs Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
BookmarkQueueWorker.cs Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
BookmarkResumer.cs Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
BookmarkUpdater.cs Refactor workflow state persistence for improved consistency. 2025-01-27 20:07:23 +01:00
DefaultActivityExecutionManager.cs
DefaultActivityExecutionMapper.cs Merge remote-tracking branch 'origin/rc/3.4.0' into develop/3.5.0 2025-04-28 19:06:20 +02:00
DefaultBookmarkManager.cs Fix all broken summary xml docs (#6123) 2024-11-18 13:41:27 +01:00
DefaultBookmarkQueuePurger.cs Based on default scheduling, DefaultBookmarkQueuePurger logs two low value information entries every 10 seconds. 2025-02-26 15:10:41 -05:00
DefaultCommitStateHandler.cs Refactor commit state handling with a strategy-based approach 2025-01-30 11:59:47 +01:00
DefaultRegistriesPopulator.cs Add multitenancy support for background tasks (#6059) 2024-10-28 19:38:24 +01:00
DefaultWorkflowActivationStrategyEvaluator.cs Add workflow activation and startup services. (#6076) 2024-10-30 22:51:14 +01:00
DefaultWorkflowDefinitionStorePopulator.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
DefaultWorkflowRegistry.cs
DefaultWorkflowRestarter.cs Add workflow restart functionality for handling interruptions 2025-02-22 15:10:52 +01:00
DefaultWorkflowStarter.cs Merge branch 'main' into enh/workflowinstance-name 2025-03-14 23:03:33 +01:00
EventPublisher.cs Fix race condition in Distributed Workflow Runtime during same-workflow event publishing (#6538) 2025-03-31 18:11:27 +02:00
HeartbeatGenerator.cs Add migration files for database schema V3.4 2025-02-22 20:48:56 +01:00
LocalBackgroundActivityScheduler.cs Introduce job unscheduling functionality 2024-12-05 19:25:16 +01:00
LocalWorkflowClient.cs Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
LocalWorkflowRuntime.cs Refactor initialization of ObsoleteWorkflowRuntime. 2025-01-28 13:53:22 +01:00
LocalWorkflowRuntime.Obsolete.cs Refactor initialization of ObsoleteWorkflowRuntime. 2025-01-28 13:53:22 +01:00
ObsoleteWorkflowRuntime.cs Fixed from the master merge 2025-03-10 15:52:10 +02:00
StimulusProxyWorkflowInbox.cs Fixed from the master merge 2025-03-10 15:52:10 +02:00
StimulusSender.cs Add CorrelationId to NewBookmarkQueueItem 2025-02-15 12:43:58 +02:00
StoreActivityExecutionLogSink.cs Refactor activity context management and state handling. 2025-01-28 20:24:53 +01:00
StoreBookmarkQueue.cs Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
StoreWorkflowExecutionLogSink.cs Refactor workflow state persistence for improved consistency. 2025-01-27 20:07:23 +01:00
SynchronousTaskDispatcher.cs
TaskReporter.cs Refactor code for improved clarity and modern syntax 2025-02-15 00:12:52 +01:00
TriggerBoundWorkflowService.cs
TriggerIndexer.cs Refactor trigger indexing and update base version to 3.5.0. (#6516) 2025-03-20 12:04:51 +01:00
TriggerInvoker.cs Add support for passing initial variables 2025-03-08 11:47:58 +01:00
ValidatingWorkflowDispatcher.cs
WorkflowCanceler.cs Add workflow cancellation notifications (#6075) 2024-10-30 19:46:36 +01:00
WorkflowCancellationService.cs Add workflow cancellation notifications (#6075) 2024-10-30 19:46:36 +01:00
WorkflowDefinitionRefresher.cs Remove unnecessary namespace declarations and using statements 2024-07-24 22:51:06 +02:00
WorkflowDefinitionsReloader.cs Remove unnecessary namespace declarations and using statements 2024-07-24 22:51:06 +02:00
WorkflowExecutionLogRecordExtractor.cs Remove obsolete properties and refactor activity evaluation (#6603) 2025-04-18 16:21:25 +02:00
WorkflowHeartbeatGeneratorFactory.cs Rename variable for clarity in heartbeat generator logic. 2025-02-22 21:27:15 +01:00
WorkflowHost.cs Add support for activity output testing (#6529) 2025-03-31 18:10:59 +02:00
WorkflowHostFactory.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
WorkflowInvoker.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
WorkflowMatcher.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00