- Introduced `HealActivity` alteration type for resolving faulted activity states.
- Added `HealActivityHandler` to manage execution of `HealActivity`.
- Enhanced `WorkflowExecutionContextExtensions` with `FindActivityExecutionContexts` method for locating activity execution contexts based on provided handles.
- Updated `AlterationHandlerContext` to enable custom commit actions during `Succeed` calls.
- Registered `HealActivity` and its handler in alteration services.
- Upgraded `ElsaStudioVersion` to `3.5.0-preview.1092`.
Standardize package version references by renaming `Microsoft` to `MicrosoftVersion` and introducing `ResilienceVersion`. Adjust all relevant package declarations to use the updated property names.
* Update package versions in Directory.Packages.props
Upgraded multiple package dependencies to latest versions, ensuring compatibility, security, and access to the newest features.
* Refactor mediator pipeline to support tenant context propagation
- Introduced `TenantPropagatingMiddleware` to handle tenant context propagation during command execution.
- Added `SetupMediatorPipelines` hosted service for configuring mediator pipelines.
- Enhanced `CommandPipeline` and builder to allow middleware insertion, removal, and reordering.
- Updated `CommandContext` and related components to support headers for tenant context handling.
- Improved logging and refactored `BackgroundWorkflowDispatcher` to include tenant headers during command dispatch.
* Fix typos in XML documentation and improve middleware extension clarity
- Corrected duplicated slashes in XML doc comments in `ICommandSender.cs`.
- Refined phrasing in `MiddlewareExtensions.cs` to clarify method parameters and improve readability.
* Update src/common/Elsa.Mediator/Middleware/Command/Components/CommandLoggingMiddleware.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor query composition to ensure consistent ordering and pagination logic.
Reordered method calls for `OrderBy` and `Paginate` across multiple stores to enhance readability and maintain consistent execution. Simplified redundant query operations for improved clarity and performance.
* Updates Elsa Studio version to 3.4.0
Updates the Elsa Studio version to the stable release.
Removes the preview tag from the version number.
* Move `ElsaStudioVersion` property to `Directory.Packages.props` for centralized management.
* Update package versions
Updated multiple package versions to their latest release, including `Polly`, `Elastic.Clients.Elasticsearch`, `System.Text.Json`, and others.
* Remove duplicate package entry
* Fix case mismatch in package name for SQL Server migration dependency.
* Add `Proto.Cluster.AzureContainerApps` package version to dependencies
* Update Directory.Packages.props
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Eliminated the `Elsa.Labels`, `Elsa.Environments`, and `Elsa.OpenTelemetry` modules along with their handlers, contracts, models, and related functionality. This cleanup improves maintainability and aligns the codebase with recent architectural changes.
- Removed `ElsaStudioVersion` from `Directory.Build.props`.
- Added `PackageVersions` group in `Directory.Packages.props` with `ElsaStudioVersion` and new `Moq` package version.
- Updated input retrieval method in `ConfigureLiquidEngine.cs` to use `ActivityInput`.
- Clarified import for `InvokingActivityCallback` in `ScheduledChildCallbackBehavior.cs`.
- Changed target framework to `net9.0` in `Elsa.Http.UnitTests.csproj` and updated package references for flexibility.
* Update default initializations and input parameters to `null`
Replaced `default!` with explicit `null` for input parameters and properties throughout various classes. Adjusted constructors' default values for consistency and readability. This change ensures better clarity and alignment with nullable reference types.
* Add Polly-based resilience integration for retry tracking
Introduce Polly diagnostics to log retry events in the execution context. Updated resilience strategy interfaces and implementations to support Polly's context and retry event tracking.
* Refactor resilience and retry handling, add flaky endpoint.
Removed custom Polly-based diagnostic listeners and observers in favor of a transient status code utility class. Introduced a mock "flaky" endpoint for testing failure scenarios and updated configuration for resilience strategies. Minor namespace fixes
* Add retry attempt recording to resilience feature
Introduce `IRetryAttemptRecorder` and its implementations to enable recording of retry attempts during activity execution. Updated `ResilientActivityInvoker` to persist retry attempts and modified `ResilienceFeature` to support configurable retry attempt recorders.
* Add retry attempt tracking and retrieval functionality
Introduced mechanisms to track and fetch retry attempts, including new interfaces, reader implementations, API endpoints, and related models. These enhancements improve resilience tracking and data access for activity execution across workflows.
* Add GetOutcome method to RetryAttempt model
Introduce a GetOutcome method to encapsulate logic for determining the retry attempt's outcome. It prioritizes the Result, falls back to the Exception message, or defaults to "Unknown" if neither is available. This improves clarity and reusability of the outcome evaluation.
* Add scoped registration for _retryAttemptReader
This change ensures that _retryAttemptReader is registered in the DI container as a scoped service.
* Refactor retry mechanism to support detailed retry metadata
Introduced a `CollectRetryDetails` method to `IResilientActivity` for enhanced retry data collection. Updated `RetryAttemptRecord` to include a `Details` dictionary for capturing metadata, replacing previous `Result` and `Exception` fields. These changes simplify the retry recording process and improve extensibility for tracking retry details across activities.
* Add support for capturing background activity properties
Introduced functionality to capture and persist background activity properties during workflow execution. This includes defining a key for properties, capturing them in middleware, and storing them in the workflow execution context. These changes ensure properties are handled consistently alongside other activity data.
* Add support for storing and propagating activity execution properties
Introduced a `Properties` dictionary to track additional metadata in activity execution records and stats, enabling richer diagnostics and tracing. Refactored resilience logic to improve retry handling and propagate retry-related flags in workflows. Enhanced database queries to map serialized properties for execution summaries.
* Add retry propagation for background activity execution
Introduced a mechanism to propagate the retry-attempted flag across activity execution contexts. Added a new notification `BackgroundActivityExecutionCompleted` and updated related middleware to send this notification. Enhanced resilience features to handle and propagate retry state effectively.
* Refactor default parameters and values to use 'null'.
Replaced 'default' with 'null' for optional parameters and values in `AddExecutionLogEntry`, improving clarity and ensuring semantic consistency with nullable types. No functional changes were introduced.
* Refactor flaky endpoint and enhance resilience support.
Replaced the "Flaky" endpoint with a more robust "SimulateResponseEndpoint" under a new module. Introduced a status code lookup utility and improved resilience strategies with configurable backoff types. Updated serialization to support enum conversions and enhanced caching behavior for response simulation.
* Update activity execution models with nullable properties
Replaced `default!` initializations with `null!` to ensure correct handling of nullable string properties in `ActivityExecutionRecord`. Added a new `Properties` dictionary to `ActivityExecutionRecordSummary` to store additional activity execution data. This enhances model flexibility and data extensibility.
* Add support for recording resilience strategy in context
Introduced a new method to store resilience strategy details in the activity execution context for enhanced diagnostics. Updated `ResilientActivityInvoker` to serialize and set the resilience strategy using this method, leveraging `JsonSerializer`.
* Remove redundant PropertyNamingPolicy assignment
The PropertyNamingPolicy was set to the default value (CamelCase), making the assignment unnecessary. This change simplifies the code while maintaining existing functionality.
* Set JSON property naming policy to camelCase
Updated JSON serialization settings to use camelCase naming for property names. This improves consistency with standard JSON naming conventions and ensures compatibility with camelCase-based APIs.
* Remove unused Endpoints folder reference from project file
The Endpoints folder reference in the project file was unnecessary and has been removed. This cleanup helps maintain a tidy and accurate project structure.
* Remove unused RetryAttemptFilter and add Polly packages
Removed the obsolete RetryAttemptFilter class as it was no longer in use. Added Polly and Polly.Extensions packages to the project to support resilience and fault-handling strategies. This update aligns with keeping dependencies relevant and reducing unused artifacts.
* Add resilience integration test for FlowSendHttpRequest (#6692)
* Refactor and fix resilience test cases for clarity and accuracy
Simplified imports, adjusted code structure, and corrected attempt indexing logic in resilience tests. These changes improve readability, maintainability, and ensure accurate validation of retry attempts in test scenarios.
Replaced hardcoded ElsaStudio version values with a centralized `ElsaStudioVersion` property. This ensures easier version management and reduces duplication across the project.
Updates several package versions to their latest available releases.
This ensures that the project benefits from the latest features,
bug fixes, and security updates provided by the respective libraries.
Changed the ElsaStudioVersion to a new preview version and referenced it consistently in package definitions. This ensures centralized management of the version and supports the updated preview release.
* Switch Flowchart to partial class and implement token-based logic
Refactored Flowchart to use a partial class structure for better modularity. Introduced a token-based execution option alongside the existing counter-based logic, enabling flexible activity scheduling strategies within the flowchart.
* Add token-based execution logic to Flowchart activities
Introduced token-based workflow execution for Flowcharts, enabling more granular control over activity scheduling. Refactored Start activity resolution and optimized connection handling within FlowGraph. Added extensions for improved activity query and execution management.
* Refactor token-based flowchart logic and add loopback detection
Replaced the legacy token-based flowchart logic with a cleaner, modular implementation. Introduced `LoopbackDetector` for identifying back-edges in workflows, enabling explicit handling of loopback connections for improved execution flow. Minor adjustments were also made for code consistency and clarity.
* Introduce token-centric execution model for Flowchart activity
Replaced the execution-count heuristic in Flowchart with a robust token-centric model, improving handling of loops, joins, and forks. Added join semantics via `JoinKind` and `IJoinHintProvider` to enable flexible configuration. Updated documentation and dependencies to reflect the new model.
* Refactor activity property handling and enhance JSON serialization.
Standardize key names in activity property management for consistency and improve error handling in `GetJoinKind` methods. Add support for enum serialization with `JsonStringEnumConverter` in JSON utilities.
* Refactor flowchart token handling for clarity and efficiency
Revised the flowchart token management logic to improve readability and maintainability. Simplified token creation, consumption, and scheduling while removing redundant code. Updated token structure and streamlined the flow execution process to handle dynamic and static connections effectively.
* Refactor Flowchart activity scheduling logic
Consolidated child activity scheduling into a single method, reducing duplication across token-based and counter-based workflows. Removed unused fields, redundant imports, and legacy logic to improve maintainability and clarity of the codebase.
* Update .gitignore to track Azurite data folder
Added `docker/azurite-data` to the ignore list to exclude local Azurite data files from being included in the repository. Ensures proper handling of temporary files related to Azure storage emulation.
* Refactor flowchart logic and extract activity context utilities
Reorganized flowchart logic by introducing reusable extension methods for activity context operations. Moved "HasPendingWork" and "HasFaultedChildren" methods into extensions to improve readability and maintainability. Updated related flowchart logic to utilize these methods for cleaner and more modular code.
* Refactor join logic and clean up Flowchart activities
Removed obsolete `JoinKind` enum and `IJoinHintProvider` interface, replacing them with the new `JoinMode` concept. Simplified flowchart logic by consolidating flow graph handling and refining activity execution extensions. Updated `FlowJoin` to recommend property-based configuration over explicit usage.
* Avoid invalid test execution when token flow is enabled.
The added check prevents the test from running when `Flowchart.UseTokenFlow` is enabled, as this scenario is incompatible. This ensures test reliability and avoids unnecessary execution.
* Refactor token-based logic in Flowchart activity.
Simplified token handling and introduced clearer logic for WaitAny and WaitAll joins. Improved efficiency by reducing redundant checks and streamlining activity scheduling. This ensures better maintainability and functionality in complex workflows.
* Refactor Token logic into its own model class
Moved the Token logic out of the Flowchart partial class to a standalone `Token` model for better modularity and clarity. Adjusted token consumption behavior to mutate the token in place rather than replacing it.
* Fix ancestor cancellation logic in Flowchart activities
Pass the correct activity to CancelInboundAncestorsAsync to ensure accurate ancestor determination and cancellation. Added validation to confirm the activity context is a flowchart to prevent invalid operations. These changes improve the reliability of flow control in workflows.
* Refactor Token model to add scheduling functionality
Replaced the `consumed` parameter with a `Scheduled` property and added a `Schedule` method for mark scheduling. This enhances the token model's flexibility, improving flowchart activity management.
* WIP on (no branch)
* Remove unused WaitAny guard logic from Flowchart activity.
The WaitAny guard logic and associated key have been commented out and effectively disabled. This cleanup simplifies the code, removing unnecessary operations that were no longer in use. The change ensures better maintainability and focuses on the core functionality.
* Add `MergeMode` enum and refactor flowchart merging logic
Introduced a `MergeMode` enum to define strategies for handling multiple inbound execution paths. Updated flowchart logic to replace the previous `FlowJoinMode` with `MergeMode`, and refactored related extensions to accommodate the new enum. This enhances clarity and flexibility in workflow merging behaviors.
* Mark `FlowJoin` obsolete and enhance merge mode handling
Added the `[Obsolete]` attribute to the `FlowJoin` activity and deprecated properties to encourage using `MergeMode`. Replaced synchronous `GetMergeMode` with an asynchronous `GetMergeModeAsync` to handle legacy `FlowJoin` mappings dynamically. Other minor changes include simplifying variable initialization in `WorkflowExecutionContext`.
* Mark FlowJoin activity as obsolete
The FlowJoin activity is now marked obsolete since all activities support the MergeMode property, eliminating the need for explicit join steps. This change includes an annotation update to clearly communicate its deprecated status.
* Refactor `OnActivityCanceledAsync` method location
Moved the `OnActivityCanceledAsync` method from the `Flowchart.Counters` file to the main `Flowchart` file for improved organization and readability. This ensures the method aligns better with its primary logic and related functionality.
* Refactor flowchart logic to improve cancellation handling
Refactored `OnActivityCanceledAsync` to handle token-based flow and legacy flow separately for better clarity and maintainability. Moved `CompleteIfNoPendingWorkAsync` to a single shared location and updated pending work checks to include unconsumed tokens and faulted activities. Simplified redundant logic and ensured consistency across methods.
* Remove consumed tokens after activity completion
This update ensures that consumed tokens pointing to the completed activity are purged from the token list. This helps maintain a clean state and prevents unnecessary token accumulation during workflow processing.
* Add support for blocking tokens in flowchart activities.
Introduced a `Blocked` property to the `Token` model to prevent scheduling activities prematurely in certain merge modes. Updated token processing logic to handle blocked tokens effectively and ensure proper scheduling or consumption. Simplified token management by removing redundant methods and cleaning up consumed tokens appropriately.
* Refactor Flowchart activity cancellation logic.
Streamlined cancellation logic by separating token and counter flow handling into dedicated methods. Removed redundant properties and logic, improving readability and maintainability. Simplified `OnChildCompletedAsync` and related methods for consistency.
* Refactor token-centric flowchart execution model.
Updated the flowchart ADR to clarify the token-centric approach, including `MergeMode` rules and scheduling logic. Enhanced the model to handle loops, forks, and resumable activities more robustly while improving state management and supporting cancellation. Updated sequence diagram for clarity.
* Remove JoinMode-related methods from ActivityExtensions
The GetJoinMode and SetJoinMode methods were removed as they are no longer needed. This cleanup reduces unused code and improves maintainability of the ActivityExtensions class.
* Remove unused JoinMode enum
The JoinMode enum was determined to be unnecessary and has been deleted to clean up the codebase. This helps reduce redundancy and improve maintainability.
* Remove unused LoopbackDetector class from Flowchart module
The LoopbackDetector class was removed because it is no longer used in the codebase. Its functionality appears to be obsolete or unnecessary for the current requirements of the Flowchart module.
* Update `UseTokenFlow` to be configurable
Made `UseTokenFlow` a static field to allow external configuration. This enables users to switch between the token flow and the old counter-based model as needed. Updated documentation accordingly.
Updated package references to their latest versions in `Directory.Packages.props`, ensuring compatibility and access to the latest features. Enabled `MongoDB.Driver.Core.Extensions.DiagnosticSources` in `Elsa.MongoDb.csproj` and cleaned up unused ElsaStudio version property in `Directory.Build.props`.
Upgraded Elsa Studio and related packages from preview.991 to rc2 in both `Directory.Build.props` and `Directory.Packages.props`. This ensures usage of the latest release candidate version across the project.
Upgraded Elsa.Studio and related packages to the latest preview version (3.4.0-preview.991) from 3.4.0-preview.918. This ensures compatibility with the latest updates and fixes in the Elsa.Studio ecosystem.
Upgraded Elsa Studio packages to version 3.5.0-preview.925 and updated page titles to reflect the new version. Added `Microsoft.AspNetCore.Components` dependency to `ElsaStudioWebAssembly.csproj` for improved component support. These changes ensure consistency and enhance application functionality.
Upgraded Elsa.Studio-related package versions from 3.4.0-preview.918 to 3.5.0-preview.922. This ensures the project uses the latest features and fixes available in the updated preview release.
Upgraded Elsa-related packages to version 3.4.0-preview.918 to include the latest features and improvements. Added the `Microsoft.AspNetCore.Components` package to align with other ASP.NET updates in the project.
* Enable DbContext pooling and refactor DI scopes
Added support for using DbContext pooling with a configurable option. Refactored to use scoped service providers for better isolation and lifecycle management. Updated persistence feature base to integrate sensitive data logging and warning configurations.
* Update package management and Elsa Studio version references
Centralized package versioning remains enabled, while unused package references and conditional groups for specific .NET targets are removed for simplification. Elsa Studio version is upgraded from 3.3.0-rc4 to 3.4.0-rc1.
* Simplify DbContextOptions setup logic
Removed conditional compilation and unused code to streamline the DbContextOptions configuration. This improves maintainability and ensures consistent behavior across frameworks. Sensitive data logging is no longer explicitly enabled here.
Added and updated multiple package references, including OpenTelemetry, Datadog.Trace.Bundle, and various Microsoft.Extensions libraries. This ensures compatibility with the latest dependencies and introduces enhanced features for resilience and tracing.
Upgraded multiple NuGet package dependencies to their latest versions to ensure compatibility, security, and improved functionality. These updates span across various libraries and frameworks used in the project.
Introduced Docker Compose configurations for Citus and YugabyteDB clusters and updated connection strings in `appsettings.json`. Modified `Program.cs` to enable Entity Framework Core support for both databases and updated the `SqlDatabaseProvider` enum accordingly. Adjusted the Docker Compose setup and bumped `Yarp.ReverseProxy` package version.
Bump the System.Linq.Dynamic.Core package to the latest preview version. This ensures compatibility with the latest features and fixes provided in the updated package. No other changes were made.
This commit removes the "Agents" configuration section, related API keys, services, and persistence logic across the codebase. Unused agent-related NuGet packages and code references were also eliminated to simplify the project and focus on core functionality.
Added the OpenTelemetry.Console Exporter (v1.11.1) to the project dependencies. This enables console-based telemetry exporting for improved observability and debugging.
Dropped support for .NET 6.0 and .NET 7.0 by removing multi-targeting configurations. Updated dependencies to use versions compatible with .NET 8.0, ensuring consistency across all projects. This simplifies maintenance and aligns with the latest .NET standards.
Introduced OpenTelemetry tracing with AlwaysOnSampler and console exporter, integrated into the Elsa framework. Added error handling capabilities via custom `IErrorSpanHandler` implementations. Updated project dependencies to include OpenTelemetry-related packages.
Upgraded the Oracle.EntityFrameworkCore package from version 8.23.70 to 9.23.60. This update ensures compatibility with newer features and resolves any potential issues fixed in the latest release. No changes were made to other package versions.
Updated various NuGet package dependencies to their latest available versions for improved stability, performance, and compatibility. The changes span multiple libraries, including Azure, FastEndpoints, and Microsoft.EntityFrameworkCore packages. This ensures the project remains up-to-date with the latest enhancements and bug fixes.
Replaced InputProxy with alternative implementations, adding flexibility to handle inputs. Introduced a JsonElementConverter to deepen JavaScript and JSON element integration. Enhanced testing and object conversion logic, improving type handling and support for complex JSON scenarios.
Added support for configuring Hangfire job storage per database provider, including PostgreSql, SQLite, and SQL Server. Introduced new methods for flexible Hangfire setup, while marking older APIs and storage configuration extensions as obsolete. Refactored related configurations for streamlined and centralized job scheduling logic.
Updated `UseElsaMySql` method to use default `null` values instead of `default` and added a conditional compilation directive for `.NET 9.0`. Also introduced new package versions for targeting `.NET 8.0` and `.NET 9.0` to ensure compatibility and maintainability.
Reformatted the `Directory.Packages.props` file to improve readability and ensure consistent indentation. This change has no impact on functionality but enhances maintainability and code clarity.
Dropped .NET 6 support and upgraded projects to .NET 8 and .NET 9 frameworks. Updated several package dependencies to their latest stable or preview versions to ensure compatibility and leverage improvements.