* Add coverage enforcement for test projects
* Expand GitHub Actions triggers to include additional branch patterns
* Update `coverlet.msbuild` configuration and centralize dependency version management
- Removed inline version specification for `coverlet.msbuild` in `test/Directory.Build.props`.
- Centralized `coverlet.msbuild` version definition in `Directory.Packages.props` for consistency and maintainability.
* Remove `Elsa.Common.Core` unit test project and related test files
* Add Directory.Build.props for test project organization and update property configurations
- Introduced `Directory.Build.props` files for `test/unit` and `test/integration` to define project-specific properties.
- Updated `test/Directory.Build.props` to include new coverage formats and an exclusion for `Elsa.Testing.Shared`.
- Adjusted solution file to link new `Directory.Build.props` files.
- Configured threshold properties for `unit`, `integration`, and `component` test directories.
* Disable coverage collection for performance tests in project file
* Expand GitHub Actions workflow triggers and add PR-specific condition for test job
* Restore EF Core persistence layer
Originally, we had moved EF Core to the extensions repo, but in practice this turned out to be rather impractical when debugging elsa-core, given that we would lose all of the state (workflow definitions, instances, etc.) across application restarts.
* Integrate PostgreSQL support into EF Core persistence and enhance BlobStorage workflows provider setup.
- Introduced `WorkflowStateCommitted` notification to encapsulate workflow execution context, state, and instance details.
- Updated `DefaultCommitStateHandler` to publish `WorkflowStateCommitted` via `IMediator`.
- Adjusted `DispatchWorkflowExtensions` to use `WorkflowStateCommitted` for workflow completion.
Updates KubernetesClient and Microsoft packages (#6917)
* Remove Proto.Cluster.Kubernetes dependency due to vulnerability
- Temporarily removed `Proto.Cluster.Kubernetes` package and provider integration because of a vulnerability in its dependency (https://avd.aquasec.com/nvd/2025/cve-2025-9708).
- Adjusted related cluster provider and remote configuration logic.
- Updated `PortAttribute` default parameter for clarity.
* Revert "Remove Proto.Cluster.Kubernetes dependency due to vulnerability"
This reverts commit 0720d970968e4f7338825407258b34ddffb1d2a4.
* Add KubernetesClient package and update MicrosoftVersion to 9.0.9
- Added `KubernetesClient` package to the project dependencies.
- Updated `MicrosoftVersion` to `9.0.9` in `Directory.Packages.props`.
Update Polly packages
- Bump Polly and Polly.Extensions package versions to 8.6.3.
Update `Microsoft.AspNetCore.Authorization` to use `MicrosoftVersion` property
Ensure Docker images ship CA trust and add TLS smoke tests (#6918)
Remove TlsSmoke project and related solution references
- Deleted `TlsSmoke` project files (`Program.cs` and `TlsSmoke.csproj`).
- Removed `TlsSmoke` project reference from the solution file (`Elsa.sln`).
Add comprehensive Copilot coding agent instructions for repository onboarding (#6920)
* Initial plan
* Add comprehensive .github/copilot-instructions.md with validated build instructions
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Add ForEach tests, introduce asynchronous workflow runner and enhance workflow events. (#6926)
* Introduce asynchronous workflow runner and enhance workflow events.
- Added `AsyncWorkflowRunner` to enable asynchronous workflow execution and result tracking.
- Introduced new event arguments, such as `ActivityExecutedEventArgs` and `WorkflowStateCommittedEventArgs`.
- Expanded `WorkflowEvents` class to include `ActivityExecuted`, `ActivityExecutedLogUpdated`, and `WorkflowStateCommitted` events.
- Refactored event arguments into the `Elsa.Testing.Shared.EventArgs` namespace.
- Enhanced tests with `AsyncWorkflowRunner` and new event-driven workflow scenarios.
* Refactor event argument classes to unify namespace and simplify inheritance
* Add shared component DotSettings file to support namespace exclusions
Refactor `WaitAsync` call in `DispatchWorkflowsTests` to remove unnecessary generic type.
* Introduce `IWorkflowResumer` and `ActivityInputEvaluatorContext`, refactor endpoint handling, extend logging, and improve bookmark queue processing.
* Remove deprecated WorkflowContexts module and optimize project.
Deleted the Elsa.Studio.WorkflowContexts module and references from solution files. Corrected minor errors in remaining code and updated project configurations to align with the new structure.```
* Update GitHub workflows to track `develop/3.6.0` branch instead of `patch/3.5.1`.
* Fix inconsistent formatting in `InputDescriptor` constructor and properties.
* Add XML documentation for `DictionaryValueEvaluator` in `UIHints/Dictionary` module
* Refactor `DictionaryValueEvaluator` to improve readability and simplify dictionary evaluation logic.
Introduced `DistributedWorkflowRuntime` to support distributed workflow execution with locking mechanisms. Added new module `Elsa.Workflows.Runtime.Distributed` with key services, features, and client implementations for handling distributed bookmarks and workflow clients. Updated integration and component tests to use the new distributed runtime where relevant.
This commit completely removes the Elsa.Expressions.Dsl module, including all associated features, services, models, and dependencies. The DSL functionality, including its custom activities and integration options, has been fully eliminated from the project.
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.
This update ensures consistency and improves clarity in specifying nullable types and default values. Replaced `default!` with `null` in various activity classes and properties to better align with modern C# nullable reference type practices.
The `WorkflowAsActivityInternal_ShouldHonorSettings_WhenExecuting` test is marked with `[Fact(Skip)]` due to intermittent failures. The issue appears unclear, despite the functionality working as expected in practice.
The test `WorkflowAsActivityInternal_ShouldHonorSettings_WhenExecuting` was marked with `[Fact(Skip...)]` because it fails inconsistently when run via CLI, despite working reliably in the IDE. This change avoids false negatives during automated testing.
* Implement internal state activity persistence and logging mechanisms
Updated property handling to support nullable dictionaries and improved persistable states. Adjusted serialization logic to handle optional fields more robustly, ensuring better compatibility with log persistence mappings and internal state evaluations.
* Replace default! with null! for string properties
Updated string properties in various records to use null! instead of default! for consistency and clarity. Additionally, adjusted methods to check collection existence before serialization and streamlined object initializations with simplified syntax where possible.
* Fix nullable types in DeserializeActivityState method
Updated the method's return type and JSON deserialization to properly handle nullable values. This ensures better alignment with the method's behavior and avoids potential null reference issues.
* Fix null reference issues in InputOutputLoggingTests
Replaced forced null dereferences with safe navigation checks to prevent potential null reference exceptions. This ensures more robust and error-free test execution for activity state validations.
* Add strict type checking for variable parsing
Introduced a `StrictMode` flag for variables, enforcing stricter type validation during parsing and conversions. Updated related methods and tests to reflect the stricter parsing behavior, ensuring consistent type compatibility and error handling.
* Refactor StrictMode handling and improve ObjectConverter logic
Moved StrictMode flag from Variable to ObjectConverter for better cohesion and updated related references. Additionally, removed unused parameters and simplified ObjectConverterOptions to streamline configuration and maintain consistency across the codebase.
* Refactor type conversion logic and update logging defaults
Improve type conversion reliability by introducing `TryConvertValue` and refining exception handling. Update JSON scenarios to use "Inherit" as the default for log persistence modes, ensuring consistency across configurations.
* Refactor exception handling in ObjectConverter.
Introduce a helper method `ReturnOrThrow` to streamline and centralize exception handling logic. This change also adds support for non-strict mode, allowing value fallback instead of throwing exceptions when enabled.
* Add numeric type checks and improve type conversion handling
Introduce `IsNumericType` extension method to identify numeric types. Enhance type conversion logic in `ObjectConverter` to handle numeric, boolean, and string types more accurately. Update variable deserialization workflows to handle conversion failures gracefully.
* Set a default comment for ObjectConverter.StrictMode assignment
Added a comment clarifying that StrictMode is set to its default value. This improves code readability and helps maintainers understand the intent.
* Fix formatting inconsistencies and improve code clarity
Removed redundant whitespace and adjusted formatting to align with coding standards. These changes enhance the readability and maintainability of the code without altering functionality.
* Fix typo in Program.cs variable comment
Corrected a minor issue in the comment for `identityTokenSection` to remove the unnecessary "Modify" text. This change improves code readability and removes potential confusion for developers.
* Simplify imports in ModifyVariableHandler.cs
Removed unused `Microsoft.Extensions.Options` and `Elsa.Workflows.Options` imports to clean up dependencies and improve maintainability. This change reduces clutter without affecting the existing functionality.
Eliminated extraneous whitespace to improve code cleanliness and consistency. This change does not affect functionality but adheres to coding style guidelines.
Updated variable constructors across the codebase to use explicit names and initial values where applicable. Deprecated old constructor overloads and added new methods and overloads for better flexibility and readability. Minor cleanup includes replacing `default` keywords with `null` and streamlining code syntax.
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.
Deleted the entire Azure Service Bus module, including activities, configurations, tests, and supporting code. This removal eliminates features like message handling workflows, queue/topic providers, and unit testing utilities for Azure Service Bus.
Removed unused workflow event handlers and simplified signal usage. Marked the flaky `DispatchAndWaitWorkflow_ShouldWaitForChildWorkflowToComplete` test for review and fixing. This improves maintainability and prepares for future test stability work.
The test 'DispatchAndWaitWorkflow_ShouldWaitForChildWorkflowToComplete' was marked as flaky and skipped to prevent instability in the suite. It should be revisited and fixed to ensure reliable execution.
Upgraded RabbitMQ from version 3-management to 4-management across tests and the Docker setup. This ensures compatibility with the latest features and improvements in RabbitMQ while maintaining consistency across environments.
Reorganized ProtoActor configuration to be conditionally applied based on runtime settings. Updated test workflows to simplify signal handling and improved test structure by introducing scoped dependencies and removing unused event subscriptions.
* Add synthetic properties to JS engine for exclusion
This fixes an issue where inputs would be declared as new variables, causing a "miss" when trying to read the input.
* Add InputOutput workflows and tests for data exchange
Introduce new Consumer and Provider JSON workflows to facilitate testing of input and output functionalities, ensuring seamless data exchange between processes. Implement corresponding tests to verify the correct reception and transmission of input data within the Provider workflow back to the Consumer, validating the setup with an assertion for expected output. Update the project configuration to include these workflows in the build output.
* Fix `variables` handling override values set via `Set{VariableName}()` syntax
* Make `TenantsFeature` a dependency of `Multitenancy` to ensure streamlined initialization
From this point on, all application instances are multi-tenant with a single, default tenant. This streamlines the startup tasks that are designed around multitenancy.
* Add JS variable handling tests
* Ensure ExpandoObjects are correctly processed and synchronized between contexts and engines
Introduced a new helper method to process ExpandoObject conversions to JavaScript objects. Updated various handlers and functions to ensure ExpandoObjects are correctly processed and synchronized between contexts and engines. Added a new workflow test to validate the updated processing logic.
* Add ExecuteWorkflow activity and enable multitenancy
Introduced the ExecuteWorkflow activity to create and execute workflow instances, and updated runtime settings to use ProtoActor for distributed caching transport. Enabled multitenancy for the Elsa Server Web application.
* Namespace renames (#6135)
* Create ExecuteWorkflows tests and workflows
Add unit tests for executing workflows, including MainWorkflow and SubroutineWorkflow. Also, rename ExecutedWorkflowResult to ExecuteWorkflowResult in the runtime module for consistency.
* Add output definitions to WorkflowBuilder
Refactored the `WithInput` method for clarity and added multiple `WithOutput` methods to support different ways of defining workflow outputs. These changes enhance the flexibility and readability of the workflow configuration process by providing a consistent API for input and output definitions.
* Refactor namespaces in component tests
Updated namespaces from Helpers to specific contexts like Fixtures, Abstractions, Consumers, Decorators, etc., to improve code organization and readability. This change affects multiple files across different test scenarios and modules.
* Disable RabbitMQ and multitenancy, rename test class
Commented out RabbitMQ usage in WorkflowServer.cs to focus on other transports. Changed multitenancy flag to false in Program.cs. Renamed DispatchWorkflowsTests to ExecuteWorkflowsTests for clarity.
* Add proper summary tags back
* Apply suggestions from code review
Co-authored-by: Robin Sue <robinsue@live.de>
* 69 more files fixed
---------
Co-authored-by: Robin Sue <robinsue@live.de>
Added a cleanup step in the ReloadWorkflowTests to delete the workflow definition and its versions after the test runs. This ensures that the tests do not leave residual data, maintaining a clean state for subsequent tests.
Eliminated the IWorkflowDefinitionCacheManager dependency from the ReloadWorkflowTests constructor and fields. This cleanup helps streamline the code and maintainability by removing an unnecessary service.
The IWorkflowDefinitionCacheManager has been added to the test class. This ensures proper cache management during workflow definition reload tests. Additionally, a cleanup step to delete the workflow definition and its versions has been included.
Commented out Scope disposal to prevent test runner hangs in component tests. Adjusted Cluster class to use property initializers instead of constructor. Updated workflow server connection strings and added detailed SQL Server configuration in Program.cs.
Changed static signals to instance variables in test classes for better encapsulation. Increased default timeout in `SignalManager` to 60 seconds. Removed unused cancellation token logic in `ActivityExecutionContext`.
Commented out unused service scopes to streamline the DeleteWorkflow tests in Elsa.Workflows. This change includes disabling associated calls and registry checks for scopes 2 and 3, focusing solely on scope1 operations.
* Implement log persistence strategy management
Added interfaces, services, and strategies for log persistence. Introduced new endpoint to list available log persistence strategies. Updated configurations and dependency injections accordingly.
* Refactor log record methods to asynchronous
Updated methods for extracting and persisting log records to be asynchronous, enhancing performance and scalability. This change includes modifying interfaces and implementations for better async support in workflow execution logging.
* Remove commented code
* Support nullable values in ActivityState dictionaries
Update ActivityState to support nullable values by changing type to 'IDictionary<string, object?>'. Enhanced DefaultActivityExecutionMapper to handle multiple persistence strategies for logging inputs and outputs.
* Rename ShouldPersistAsync to GetPersistenceModeAsync
Refactor method names for log persistence strategies to improve readability and consistency. Added summary comments for clarification and removed redundant configurations from appsettings.json. Added implicit uses and updated namespaces for better maintainability.
* Refactor activity payload and output retrieval logic
Extract payload and output retrieval into `GetPayload` and `GetOutputs` methods respectively. This modularizes the code for better readability and maintainability, and allows for potential reusability of these methods in other parts of the codebase.
* Add new project reference and update PostgreSQL provider usage
Added a project reference to Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql in the test project file. Also modified the WorkflowServer setup to specify the assembly in the PostgreSQL provider configuration.
* Add agent persistence to WorkflowServer
Integrated agent support and persistence using PostgreSQL in WorkflowServer. This includes adding necessary project references and configuring agents in the workflow server setup.
Updated workflow creation and dispatching methods to streamline bulk dispatch tests. Modified signal triggering in `TriggerSignal` activity and upgraded `ElsaStudioVersion` for compatibility improvements. Removed unused imports for cleaner code structure.
* Remove outdated sample workflows and activities
Deleted CompositeExample, SampleWorkflow, and SlowActivity classes as they are no longer needed. These deletions help clean up the codebase and maintain relevance in the code structure.
* Handle null WorkflowBuilderType in ClrWorkflowMaterializer
Introduce a fallback NotFoundWorkflowbuilder class when WorkflowBuilderType is null. This ensures the MaterializeAsync method functions even if the provided context lacks a specific workflow builder type.
* Add merging of itemDictionary to input
This change ensures that the itemDictionary's contents are also merged into the input dictionary, preventing possible data loss. It builds on existing logic by adding an additional merge operation to incorporate all necessary data.
* Add new workflows to BulkDispatchWorkflows and modify tests
Introduce `FruitWorkflow` and `MixFruitsWorkflow` for bulk dispatch scenarios. Refactor `BulkDispatchWorkflowsTests` to include new tests and rename signals for clarity. Optimize `BulkDispatchWorkflows` activity by removing redundant dictionary merge.
Deleted obsolete migration files from SQL Server, MySQL, and SQLite projects. This cleanup removes unused schema definitions and indexes, ensuring the repository remains up to date and free of unnecessary files.
* Add tenant awareness to bookmark handling and route resolution
Added tenant ID support across various components, including bookmark updates, route resolution, and middleware processing. This ensures that bookmark and route operations can now appropriately handle tenant-specific data, improving the system's multitenancy capabilities.
* Add Multitenant HTTP Routing feature to Tenants module
Introduced a new MultitenantHttpRoutingFeature class to the Elsa.Tenants.AspNetCore module, enhancing the tenant resolution capabilities. Moved RoutePrefixTenantResolver from Elsa.Http to Elsa.Tenants.AspNetCore and updated relevant project references and namespaces accordingly. This refactor improves modularity and separation of concerns between HTTP and tenancy features.
* Refactor route handling and tenant configuration
Removed redundant `RouteTableExtensions` and replaced with new route providers and updaters, enhancing flexibility and modularity. Introduced tenant-specific HTTP endpoint configurations for better customization and configuration management.
* Rename HttpEndpointBookmarkStimulus to HttpEndpointBookmarkPayload
Refactor various classes and methods to reflect the renaming from `HttpEndpointBookmarkStimulus` to `HttpEndpointBookmarkPayload`. Add and configure new extension methods for tenant route handling, update the route provider to support multi-tenancy, and adjust the tenants provider to bind configuration properly.
* Add HeaderTenantResolver and refactor Http namespace.
Introduce HeaderTenantResolver to resolve tenants via HTTP headers. Refactor multiple classes and interfaces to move from the Elsa.Http.Models namespace directly into Elsa.Http for clarity and consistency.
* Add Host-based tenant resolution
Implemented a HostTenantResolver to resolve tenants based on the request's host and updated tenant configurations with host information. Modified the tenant resolver pipeline and added the new host resolver to the service registrations.
* Add tenant-aware caching and accessor support
Enhanced caching by incorporating tenant identifiers into cache keys for more granular cache management. Introduced ITenantAccessor dependencies in various services to retrieve the current tenant information. This ensures that cache entries are correctly isolated per tenant.
* Reorder tenant resolvers for pipeline setup.
Reordered the tenant resolvers in the pipeline to prioritize HostTenantResolver before RoutePrefixTenantResolver. This ensures that tenant resolution is correctly aligned with host-based resolving before checking the route prefix.
* Remove unused imports
This commit eliminates redundant `using` directives across multiple files to streamline the codebase. This cleanup helps improve code readability and maintainability by removing unnecessary dependencies.
* Remove obsolete tenant-related classes and add ASP.NET Core middleware
Refactored tenant resolution by removing obsolete interfaces and classes, such as `IAmbientTenantAccessor` and `ITenantResolutionStrategy`. Introduced new ASP.NET Core middleware for tenant resolution, encapsulated in the new `Elsa.Tenants.AspNetCore` project. Updated related usage in various parts of the application to align with these changes.
* Remove HttpContextTenantResolver.
Removed HttpContextTenantResolver from the multitenancy pipeline and related service registrations. This simplifies the tenant resolution by relying on remaining resolvers like ClaimsTenantResolver and RoutePrefixTenantResolver.
* Add Elsa solution definition file
This commit introduces the main solution file, Elsa.slnx, defining the folder structure, projects, and configuration for the Elsa repository. This includes folders for Docker, documentation, pipelines, samples, scripts, source code, and tests.
* Refactor DefaultAccessTokenIssuer for clarity and efficiency
Refactored the DefaultAccessTokenIssuer class by simplifying its constructor and utilizing scoped variables for token options. Improved token creation logic by adding a dedicated method to configure token options, enhancing code readability and maintainability.
* Remove Elsa.slnx solution file
No dotnet build support yet.
* Refactor tenant resolver service registrations
Updated the service registrations to use interfaces for DefaultTenantResolver and DefaultTenantResolverPipelineInvoker. This improves the code's flexibility, making it easier to replace or extend these implementations in the future.
* Add multitenancy support and tenant scope management
Introduced ITenantScopeFactory and related implementations for tenant scope management across the application. Enhanced the HTTP workflows middleware to handle tenants and updated relevant configurations and extension methods to support tenant resolution.
* Remove unnecessary folder inclusion
The <Folder> tag for "Modules\Modules\" was redundant and has been removed to clean up the project file. This change will not affect the existing functionality or project structure.
* Rename Create to CreateScope and improve authorization.
Updated the method name from Create to CreateScope for better clarity in the TenantScopeFactory. Fixed a logical error in the authorization process, ensuring proper status code setting for unauthorized requests, and refactored token expiration calculation for clarity.
* Add tenant agnostic filters and remove tenant setup
This commit introduces tenant agnostic filters in AutoUpdateTests to ensure workflows can trigger regardless of tenant. Additionally, it removes tenant configuration from WorkflowServer setup as it is no longer required for the current tests.