Commit graph

6264 commits

Author SHA1 Message Date
Sipke Schoorstra 0f4e5c6f80
Refactors ExpressionExecutionContextExtensions for improved debugging (#7070)
* Refactor `ExpressionExecutionContextExtensions` to convert static methods into extension methods and remove unused imports.

* Refactor `ExpressionExecutionContextExtensions` to convert instance methods into extension methods.
2025-11-17 21:19:32 +01:00
Sipke Schoorstra 2f135f3e61
Add service registration for BookmarkQueueWorker. 2025-11-12 22:55:22 +01:00
Sipke Schoorstra b9360d3b5f
Add missing service registration for WorkflowResumer. 2025-11-12 17:18:38 +01:00
Sipke Schoorstra d84e97945c
Add integration test for newGuid() in JavaScript evaluator.
Introduces a new unit test in `Elsa.JavaScript.IntegrationTests` to verify that the `newGuid()` function in the JavaScript evaluator correctly returns a `Guid` type.
2025-11-12 17:09:13 +01:00
RalfvandenBurg 30c1f16c15
Explicit state Bookmarkname (#6963)
* Explicit stat5e Bookmarkname

* Removed dutch comment

* compile fixes

* Update src/modules/Elsa.Http/Extensions/HttpEndpointActivityExecutionContextExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ralf <Ralf@Careconnections.nl>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-11 19:10:03 +01:00
bobhauser f37d368cc6
Simplify registration of IWorkflowResumer (#6983)
Co-authored-by: Bob Hauser <rhauser@kinaxis.com>
2025-11-11 19:07:01 +01:00
Sipke Schoorstra 485349b262
Clarify FlowJoin activity description to specify handling of active inbound paths. 2025-11-11 17:35:32 +01:00
bobhauser 5dfe13cdcb
Restore pre-3.5 Join WaitAll behavior (#7006)
Co-authored-by: Bob Hauser <rhauser@kinaxis.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2025-11-11 17:21:58 +01:00
Sipke Schoorstra a12a71f367
Renames and makes async cancel method.
Renames the `CancelAncestorActivatesAsync` method to `CancelAncestorActivitiesAsync` for clarity and makes it a proper async method, ensuring correct asynchronous execution.
This prevents potential issues when cancelling ancestor activities.
2025-11-11 16:56:38 +01:00
bobhauser 59bd21f899
Fix ObjectConverter.ConvertTo to avoid using sourceTypeConverter.IsValid (#6972)
* Fix ObjectConverter.ConvertTo to avoid using sourceTypeConverter.IsValid

* Update test/unit/Elsa.Workflows.Core.UnitTests/ObjectConversion/PersonTypeConverter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Bob Hauser <rhauser@kinaxis.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-16 13:51:37 +02:00
Sipke Schoorstra a74502d3ad
Fix trigger indexing logic and add tests for trigger persistence after workflow reload. (#6958)
* Fix outbound connection processing logic

Corrected `completedActivityExcecutedByBackwardConnection` to `completedActivityExecutedByBackwardConnection`. Improved flowgraph outbound connection handling by separating visitation and processing logic, ensuring skipped connections are propagated consistently.

* Add tests for decision implicit join workflows

Introduce new integration tests to verify workflows with implicit joins on both decision outcomes. Added corresponding workflow definitions and updated the test project to ensure compatibility. Refactored connection visit logic for better readability and maintainability.

* Refactor trigger indexing logic and add tests for trigger persistence after workflow reload.

Streamlined conditional trigger indexing in `DefaultWorkflowDefinitionStorePopulator`. Introduced a test to validate trigger persistence across reloads after publishing a new workflow version.
2025-10-10 09:21:11 +02:00
Sipke Schoorstra dc429700ab
Fixes deadlock issue with implicit joins (#6955)
* Fix outbound connection processing logic

Corrected `completedActivityExcecutedByBackwardConnection` to `completedActivityExecutedByBackwardConnection`. Improved flowgraph outbound connection handling by separating visitation and processing logic, ensuring skipped connections are propagated consistently.

* Add tests for decision implicit join workflows

Introduce new integration tests to verify workflows with implicit joins on both decision outcomes. Added corresponding workflow definitions and updated the test project to ensure compatibility. Refactored connection visit logic for better readability and maintainability.
2025-10-09 21:33:23 +02:00
Sipke Schoorstra 58cede9ca1
Merge remote-tracking branch 'origin/patch/3.5.2' into patch/3.5.2 2025-10-08 21:15:48 +02:00
Sipke Schoorstra 42753359d2 Adjust recurring task schedules and bookmark queue TTL for optimized performance. 2025-10-06 15:39:16 +02:00
Matt 32d6f903c5
Resolves Workflow Execution Bodiless Requests Issue. (#6944)
* Resolves workflow execution bodiless requests issue.

Removed content length check when processing JSON requests, relying solely on content type validation. Added a null-check for deserialized requests to handle cases where the request body is missing or invalid, providing a specific error message.

* Refactor JSON request handling in PostEndpoint

Updated to get unit tests to pass.
2025-10-03 19:44:38 +02:00
Sipke Schoorstra c6974a4e34
Improves Flowchart activity robustness (#6938)
* Bump workflow base version and branch references to `3.5.2`.

* Refactor flowchart tests and `Flowchart` activity for improved readability and consistency, alongside minor code cleanup.

* Adds comment for clarity.

Adds a comment to explain the continue statement within the flowchart execution logic.
This improves code readability and maintainability.

* Refactor flowchart test to remove unused cases, update switch behavior, and adjust expected output for improved consistency and clarity.
2025-10-01 15:01:22 +02:00
Sipke Schoorstra d18809baa1
Bump workflow base version and branch references to 3.5.2. 2025-09-30 20:12:48 +02:00
Sipke Schoorstra 003e88c4da
Update nullable argument defaults and enhance ForEach tests with additional edge cases. (#6928)
* Update nullable argument defaults and enhance ForEach tests with additional edge cases.

* Refactor input evaluation and JavaScript evaluator for clarity and consistency.

* Update src/modules/Elsa.Workflows.Core/Extensions/ActivityExecutionContextExtensions.InputEvaluation.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-27 17:50:19 +02:00
Sipke Schoorstra bc4e4d60ee
Bump ElsaExtensionsVersion to 3.5.1-preview.148. 2025-09-27 11:42:04 +02:00
Sipke Schoorstra 806bb65640
Bump Elsa Studio version to 3.5.1-preview.1231 and introduce ElsaExtensionsVersion property. Adjust package references and update Elastic.Clients.Elasticsearch version. 2025-09-27 11:10:52 +02:00
Sipke Schoorstra b2231b5c20
Update Docker image references in GitHub workflows to use unified versioning scheme (v3-5). 2025-09-27 10:43:17 +02:00
Sipke Schoorstra 56884a132a
Simplify GitHub workflow names for consistency and clarity. 2025-09-27 10:41:20 +02:00
Sipke Schoorstra 7b84bc8237
Add initial appsettings.json configuration for logging and Elsa server setup
- Introduced logging configuration with default, system, and Microsoft log levels.
- Added Elsa server URL and hosting base path settings.
2025-09-27 10:39:23 +02:00
Sipke Schoorstra bcf19ab23f
Bump Elsa Studio version to 3.5.1 and update Docker image/tag references. 2025-09-27 10:33:10 +02:00
Sipke Schoorstra 1beb5822ca
Merge remote-tracking branch 'origin/patch/3.5.1' into patch/3.5.1 2025-09-25 20:54:58 +02:00
Sipke Schoorstra 6e6a66e3f5
Add WorkflowStateCommitted notification support and update state handling logic
- 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.
2025-09-25 20:54:38 +02:00
Sipke Schoorstra 431e175d45
Refactor WaitAsync call in DispatchWorkflowsTests to remove unnecessary generic type. 2025-09-24 20:39:31 +02:00
Sipke Schoorstra bdfbd0886f
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
2025-09-24 20:06:00 +02:00
Copilot 54c8a010fe
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>
2025-09-19 21:08:54 +02:00
Sipke Schoorstra 67fb43e0ba
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`).
2025-09-19 12:07:13 +02:00
Sipke Schoorstra 42ac08c575
Ensure Docker images ship CA trust and add TLS smoke tests (#6918) 2025-09-19 11:57:30 +02:00
Sipke Schoorstra d045e495f8
Update Microsoft.AspNetCore.Authorization to use MicrosoftVersion property 2025-09-19 11:53:02 +02:00
Sipke Schoorstra 3094c0dc64
Update Polly packages
- Bump Polly and Polly.Extensions package versions to 8.6.3.
2025-09-19 11:52:44 +02:00
Sipke Schoorstra eab562e270
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`.
2025-09-19 11:11:13 +02:00
Sipke Schoorstra 18fe3e827a
Add WorkflowStateCommitted notification support and update state handling logic
- 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.
2025-09-17 21:26:24 +02:00
Sipke Schoorstra 6dfce283b2
Expand HttpClient configuration and improve SendHttpRequest activity port handling
- Updated `HttpFeature` to include `SendHttpRequest` in `HttpClient` configuration delegate support.
- Added `[Port]` attributes to `FailedToConnect` and `Timeout` properties in `SendHttpRequest` activity.
- Simplified `ValueTask` return syntax in `SendHttpRequestActivityPortResolver`.
2025-09-17 18:31:03 +02:00
Sipke Schoorstra 5fb25170cf
Handle premature request cancellation during workflow resumption
- Use `CancellationToken.None` to avoid canceling workflow execution when clients, like Blazor, terminate requests prematurely.
- Add comments for clarification on potential causes.
2025-09-17 15:25:59 +02:00
Sipke Schoorstra f2d3c540ee
Add support for asynchronous workflow resumption in Resume endpoint
- Introduced `async` parameter to enable asynchronous workflow resumption.
- Refactored `ResumeBookmarkedWorkflowAsync` to handle both synchronous and asynchronous resumption via `IWorkflowResumer` and `IBookmarkQueue`.
- Updated dependency injection to include `IWorkflowResumer`.
2025-09-17 14:26:31 +02:00
Sipke Schoorstra 07986de7a8
Refactor TypeDefinition rendering and improve VariableTypeDefinitionProvider
- Adjusted `RenderEnumMember` to include a trailing comma in rendered enums.
- Excluded compiler-generated methods in `TypeDescriber`.
- Extended `VariableTypeDefinitionProvider` to handle `ManagementOptions` and refined variable type exclusion logic.
2025-09-16 21:40:18 +02:00
Sipke Schoorstra d4a2a5f03a
Throw InputEvaluationException for input evaluation errors
Introduced `InputEvaluationException` to encapsulate errors during input evaluation in `ActivityExecutionContextExtensions`. Refactored the input evaluation logic by adding a core evaluation method to improve error handling and clarity.
2025-09-16 20:37:05 +02:00
Sipke Schoorstra b613ff6b61
Addresses workflow identity reload conflict (#6909)
* Refactor `IndexTriggersAsync` to use `WorkflowDefinition` and update null assignment for serialization logic.

* Change default parameter value from `default` to `null` in `UseFluentStorageProvider` method signature.

* Add in-memory workflows provider and materializer for integration tests

Introduced `InMemoryWorkflowsProvider` and `InMemoryWorkflowMaterializer` to support integration testing scenarios for workflow definition population. Enhanced workflow handling with fluent method `WithId` for `WorkflowBuilder`. Updated event publishing and dependency injection logic.

* Remove extraneous whitespace in DefaultWorkflowDefinitionStorePopulator.

* Refine test class documentation for `WorkflowDefinitionStorePopulation` scenario.
2025-09-15 11:56:01 +02:00
Sipke Schoorstra c019cfa3da
- Fix persistence issue by converting ChangeTrackingDictionary to a standard dictionary in BackgroundActivityInvoker.
- Adjust lock acquisition timeout in `appsettings.json` for improved distributed locking behavior.
- Remove unused Oracle setup and volume configurations from `docker-compose.yml`.
2025-09-12 19:58:19 +02:00
Sipke Schoorstra c549f49dfb
Fix race condition when sending same stimuli (#6895)
* Introduce `WorkflowResumer` service and deprecate `BookmarkResumer`.

- Adds `IWorkflowResumer` and its implementation for workflow resumption.
- Marks `BookmarkResumer` and related interfaces as obsolete.
- Refactors dependent services to use `WorkflowResumer`.
- Enhances `ResumeBookmarkRequest` to include `ActivityInstanceId`.
- Updates logging and queue handling logic to align with the new resumption approach.

* Update lock key prefix in `WorkflowResumer` for consistency with service naming.

* Add exception handling for distributed lock acquisition in `WorkflowResumer`

- Wrap distributed lock logic with `try-catch` to handle `TimeoutException`.
- Improve error message when lock acquisition fails due to timeout.
- Preserve existing workflow resumption behavior and logging.

* Update src/modules/Elsa.Workflows.Runtime/Filters/BookmarkFilter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Optimize `BookmarkFilter` hashing logic for improved performance and readability.

* Merge remote-tracking branch 'origin/enh/locked-bookmark-resumption-2' into enh/locked-bookmark-resumption-2

* Remove unused variable and redundant line breaks for cleaner code.

* Clean up logging configuration by removing unused debug log levels.

* Update src/modules/Elsa.Workflows.Runtime/Services/WorkflowResumer.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Handle collections in `BookmarkFilter` hashing to ensure determinism and improve compatibility.

* Refactor `BookmarkFilter` hashing logic for clarity and consistency.

* Improve `TimeoutException` handling with a more descriptive message in `WorkflowResumer`.

* Update src/modules/Elsa.Workflows.Runtime/Filters/BookmarkFilter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Simplify `BookmarkFilter` by utilizing `using` directives and refining type references.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-11 22:30:25 +02:00
MariusVuscanNx 6c714fe793
Merge pull request #6904 from elsa-workflows/feature/content-length
Fixed content type check from execute endpoint
2025-09-10 15:02:51 +03:00
Marius Vasile Vușcan eeec5949ef
revert 2025-09-10 15:02:33 +03:00
Marius Vasile Vușcan 4ec48e1a2c
Fixed content type check from execute endpoint 2025-09-10 15:01:29 +03:00
Marius Vasile Vușcan 001f406e5c
push 2025-09-10 14:39:36 +03:00
Marius Vasile Vușcan 5a0112fbd6
Explicitly set content lenght 2025-09-10 14:37:07 +03:00
MariusVuscanNx dd93c5947b
Merge pull request #6902 from elsa-workflows/feature/execute-insensivite
Feature/execute insensivite
2025-09-10 11:40:32 +03:00
Marius Vasile Vușcan dc6d57a1e5
Made execute endpoint model case insensitive 2025-09-10 11:39:24 +03:00