Commit graph

5989 commits

Author SHA1 Message Date
Sipke Schoorstra 32da99e3ec
Add docker-compose file for Datadog and OpenTelemetry setup
Introduce a new docker-compose configuration to integrate Datadog and OpenTelemetry with services like PostgreSQL, RabbitMQ, Redis, and Elsa. Updated the Datadog API key in an existing compose file for security purposes. This setup enables detailed monitoring, tracing, and metrics collection for development environments.
2025-03-16 19:49:35 +01:00
Sipke Schoorstra 83253b2fae
Add support for starting new trace contexts in workflows
Introduced `StartNewTrace` input to workflows and updated OpenTelemetry middleware to support initiating new trace contexts. This helps improve trace isolation and linking when desired, enhancing observability during workflow execution.
2025-03-15 21:14:10 +01:00
Sipke Schoorstra 5f74a83a77
Remove redundant status handling in tracing middleware
This commit eliminates unused status checks ("running" and "pending") from OpenTelemetry tracing middlewares. The changes simplify the codebase and improve maintainability by removing unnecessary logic.
2025-03-15 20:07:15 +01:00
Sipke Schoorstra 39932a6f09
Refactor OpenTelemetry tracing and improve span tagging.
Introduced new span tags for activities and workflows to enhance trace analysis. Optimized error handling in activity tracing by selecting the first applicable handler. Removed unused manual tracing configuration and commented out console exporters in server setup.
2025-03-14 23:55:02 +01:00
Sipke Schoorstra b624b2b4af
Refactor error span handling with prioritization and predicates
Introduce `Order` property and `CanHandle` method in `IErrorSpanHandler` to enable prioritized and conditional processing of error spans. Update handler implementations to utilize these properties and streamline logic. This enhances flexibility and improves the extensibility of error span handling.
2025-03-14 23:37:46 +01:00
Sipke Schoorstra e393cca031
Update error status and exception type handling
Enhanced error status to include detailed message when the workflow is faulted, providing better context in logs. Fixed the retrieval of exception type by replacing `GetType()` with `.Type` for improved accuracy in incident tagging.
2025-03-14 23:27:16 +01:00
Sipke Schoorstra fd31b5b605
Update OTEL fields and tags
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.
2025-03-14 23:17:54 +01:00
Sipke Schoorstra 88744c720d
Fix incorrect syntax for generating GUID in CountdownWorkflow
Corrected the syntax for defining the static `DefinitionId` property. This ensures the GUID is generated properly without causing runtime issues.
2025-03-13 21:34:18 +01:00
Sipke Schoorstra ef71a3e731
Remove unnecessary whitespace in CountdownWorkflow.cs
Eliminated extraneous whitespace to improve code cleanliness and consistency. This change does not affect functionality but adheres to coding style guidelines.
2025-03-13 21:24:32 +01:00
Sipke Schoorstra 3be1220c4d
Refactor CountdownWorkflow tests
Updated CountdownWorkflowTests to simplify BookmarkFilter instantiation and restored active CountdownWorkflow logic.
2025-03-13 21:20:46 +01:00
Sipke Schoorstra 923e9d335d
Refactor variable initialization for clarity and consistency
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.
2025-03-13 21:05:28 +01:00
Sipke Schoorstra d0d3ab1c1c
Merge pull request #6493 from elsa-workflows/bug/composite-activity-variables
Refactor variable merging logic in ActivityExecutionContext
2025-03-13 12:08:52 +01:00
Sipke Schoorstra ff60c4c461
Add SQL Server connection string to appsettings.json
This change introduces a connection string for SQL Server to the configuration file. It enables the application to connect to a SQL Server database for data persistence and retrieval.
2025-03-13 11:55:07 +01:00
Sipke Schoorstra e288ecb954
Add SQL Server service to Docker Compose configuration
Introduced an SQL Server service using the official 2022 image. Configured environment variables, ports, and a volume for persistent data storage. This addition supports development and testing scenarios requiring SQL Server.
2025-03-13 11:54:54 +01:00
Sipke Schoorstra e3e298984f
Refactor Variable class and add WithId method
Replaced `default` with `null` to improve readability and clarify initialization. Added a `WithId` method to allow assigning an ID to `Variable` instances for enhanced configurability. These changes improve usability and maintain consistency in the codebase.
2025-03-13 11:54:46 +01:00
Sipke Schoorstra 882ea8cf57
Refactor variable merging logic in ActivityExecutionContext
Replaced LINQ-based logic with a dictionary approach to merge variables. This ensures that variables are consistently merged by either name or ID when name is absent. It improves code clarity and handles edge cases more robustly.
2025-03-13 11:54:28 +01:00
MariusVuscanNx 24bd64b8b4
Merge pull request #6487 from elsa-workflows/feature/blue-func
Added missing functionalities from main as part of the blueberry merge
2025-03-12 14:01:59 +02:00
Marius Vasile Vușcan 1ea83aff14
Removed optional purge 2025-03-12 13:58:38 +02:00
Marius Vasile Vușcan c2161d057a
Added missing functionalities from main as part of the blueberry merge 2025-03-12 13:34:57 +02:00
Sipke Schoorstra bb4d3d146c
Update package versions in Directory.Packages.props
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.
2025-03-11 20:42:58 +01:00
Sipke Schoorstra 02db706b7d
Merge pull request #6483 from elsa-workflows/blueberry
Merge blueberry into master
2025-03-11 19:08:36 +01:00
Sipke Schoorstra 414d18ee80
Refactor YugabyteDB connection configuration.
Removed unnecessary `With()` method in `UsePostgreSql` for YugabyteDB. This simplifies the configuration and ensures consistency across database providers.
2025-03-11 14:23:18 +01:00
Marius Vasile Vușcan 3007344236
Merge branch 'refs/heads/main' into blueberry
# Conflicts:
#	Directory.Packages.props
2025-03-11 12:41:07 +02:00
Sipke Schoorstra 5be82dd9ab
Add support for Citus and YugabyteDB integration
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.
2025-03-11 11:19:59 +01:00
Marius Vasile Vușcan 2d26b21774
Fixed from the master merge 2025-03-10 15:52:10 +02:00
Marius Vasile Vușcan c4048fad4d
Merge branch 'refs/heads/main' into blueberry
# Conflicts:
#	.github/workflows/packages.yml
#	Directory.Packages.props
#	samples/aspnet/Elsa.Samples.AspNet.EntityFrameworkCore.PostgresSql/Elsa.Samples.AspNet.EntityFrameworkCore.PostgresSql.csproj
#	src/Directory.Build.props
#	src/apps/Elsa.Server.LoadBalancer/Elsa.Server.LoadBalancer.csproj
#	src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj
#	src/apps/Elsa.Studio.Web/Elsa.Studio.Web.csproj
#	src/apps/ElsaStudioWebAssembly/ElsaStudioWebAssembly.csproj
#	src/bundles/Elsa.Server.Web/Elsa.Server.Web.csproj
#	src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj
#	src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationPlan.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationPlanParams.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationWorkflowInstanceFilter.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Responses/RunRequest.cs
#	src/modules/Elsa.Common/Elsa.Common.csproj
#	src/modules/Elsa.Dapper/Elsa.Dapper.csproj
#	src/modules/Elsa.Expressions/Elsa.Expressions.csproj
#	src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs
#	src/modules/Elsa.Http/Elsa.Http.csproj
#	src/modules/Elsa.MassTransit.AzureServiceBus/Handlers/RemoveOrphanedSubscriptions.cs
#	src/modules/Elsa.MassTransit/Services/MassTransitWorkflowDispatcher.cs
#	src/modules/Elsa.ProtoActor/Mappers/WorkflowExecutionResultMapper.cs
#	src/modules/Elsa.ProtoActor/Proto/Shared.proto
#	src/modules/Elsa.ProtoActor/Proto/WorkflowInstance.Messages.proto
#	src/modules/Elsa.Quartz.EntityFrameworkCore.PostgreSql/Elsa.Quartz.EntityFrameworkCore.PostgreSql.csproj
#	src/modules/Elsa.Quartz/Elsa.Quartz.csproj
#	src/modules/Elsa.Workflows.Core/Contexts/StorageDriverContext.cs
#	src/modules/Elsa.Workflows.Runtime.ProtoActor/Extensions/ProtoOutputExtensions.cs
#	src/modules/Elsa.Workflows.Runtime/Activities/ExecuteWorkflow.cs
#	src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs
#	src/modules/Elsa.Workflows.Runtime/Handlers/ResumeExecuteWorkflowActivity.cs
#	src/modules/Elsa.Workflows.Runtime/HostedServices/WorkflowInboxCleanupHostedService.cs
#	src/modules/Elsa.Workflows.Runtime/Services/DefaultWorkflowRuntime.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/ExecuteWorkflowsTests.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/Workflows/MainWorkflow.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/Workflows/SubroutineWorkflow.cs
#	test/integration/Elsa.Workflows.IntegrationTests/Scenarios/WorkflowCancellation/ProtoActorTests.cs
2025-03-10 15:13:26 +02:00
Sipke Schoorstra 82a1ae0126
Merge pull request #6481 from KnibbsyMan/bug/editor-autocomplete-issue
Bug - Update Scripting Activities To Resolve Auto Complete Issues
2025-03-10 08:58:03 +01:00
Sipke Schoorstra 7caaad5a8f
Merge pull request #6480 from bobhauser/6479-fix-flowjoin-waitany-with-backward-connection
Fixes issue with FlowJoin(WaitAny) where activities can be executed multiple times
2025-03-10 08:56:41 +01:00
Sipke Schoorstra 8dca671ae2
Merge pull request #6478 from elsa-workflows/bug/composite-activity-serialization
Fix serialization of composite activities
2025-03-10 08:54:42 +01:00
Sipke Schoorstra 744fdf6283
Merge pull request #6476 from elsa-workflows/enh/dynamic-variables
Add support for passing initial variables
2025-03-10 08:54:31 +01:00
Sipke Schoorstra 7805f8b02f
Merge pull request #6474 from elsa-workflows/blueberry-serialization-patch
Patch ObjectConverter
2025-03-10 08:54:10 +01:00
Sipke Schoorstra 540365db70
Merge pull request #6467 from MatthijsKrempel/feature/configfix
Harmonized launchSettings to be inline with appSettings
2025-03-10 08:51:20 +01:00
Matt 13bc8eef8a Update scripting activities to set the DefaultSyntax to allow autocomplete to work correctly with new PR. 2025-03-09 19:47:46 +00:00
Bob Hauser 6a42857f22 Fixes issue with FlowJoin(WaitAny) where activities can be executed multiple times 2025-03-08 19:59:55 -05:00
Sipke Schoorstra fd9b4e4d87
Update SQL Server to 2022 and improve docker-compose setup
Upgraded SQL Server image to 2022-latest and aligned environment variables for clarity. Replaced hardcoded host directory with a named volume for SQL Server data to improve portability. Added `restart: unless-stopped` policy for better container management.
2025-03-08 22:03:19 +01:00
Sipke Schoorstra d19fc6e976
Enable optional OpenTelemetry tracing configuration.
Added a feature flag (`useOtel`) to conditionally enable OpenTelemetry tracing. This allows developers to toggle tracing for debugging or testing without affecting the default behavior.
2025-03-08 22:03:13 +01:00
Sipke Schoorstra 1d7fd81b3e
Fix serialization of composite activities
Fixes that composite activities' Root property (by means of the `JsonIgnoreCompositeRootConverterFactory`) does not get serialized, just like the `WorkflowDefinitionActivity`.

Composite activities added to a workflow should not include their children when being serialized.
2025-03-08 21:50:43 +01:00
Sipke Schoorstra b7cd6e00a8
Add enh/* branch pattern to workflow triggers
This update ensures that the workflow is triggered for branches following the `enh/*` naming convention. It aligns with existing patterns like `feat/*` and `perf/*`, improving consistency in branch handling.
2025-03-08 16:18:50 +01:00
Sipke Schoorstra 66123a7dc8
Add support for passing initial variables
Introduce the ability to pass variables into workflow invocations. Updates include adding variables to workflow execution options, requests, and scheduling logic. This enhancement allows dynamic variable management during workflow execution and instance creation.
2025-03-08 11:47:58 +01:00
Sipke Schoorstra cebf60de35
Add SetDynamicVariable method to support dynamic variable creation
This new method enables adding dynamic variables to the appropriate variable container if no predefined variable exists. It ensures flexibility in handling variables within the activity execution context while maintaining logical consistency. Minor formatting adjustments were also applied to improve code readability.
2025-03-08 11:08:21 +01:00
Sipke Schoorstra 8817bdc303
Update System.Linq.Dynamic.Core to version 1.6.0-preview-03
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.
2025-03-08 10:34:32 +01:00
Sipke Schoorstra 9b5b6cd947
Patch ObjectConverter
Patched `ObjectConverter` from the main branch, fixing a serialization bug with the workflow instance variable storage driver.
2025-03-07 20:29:29 +01:00
Sipke Schoorstra a9eb326c5e
Update bulk delete endpoints and request model
Refactor the bulk delete endpoint to include a new primary route while deprecating the old one. Expand the request model to support workflow definition filters and adjust response instantiation for clarity. Update obsolete API route prefix guidance for consistency across modules.
2025-03-07 10:04:41 +01:00
Raymond den Haan 5a3be276e0 Update HTTP resiliency configuration
Removed outer timeout since it was not working in the current set-up
Reduced maximum retry attempts to reduce the maximum amount of time spent on the request
2025-03-06 12:04:02 +01:00
raymonddenhaan aabe6772f5
Merge pull request #6470 from elsa-workflows/config/update_retry_config
Update retry configuration to retry up to 4 minutes
2025-03-05 14:53:09 +01:00
Raymond den Haan eb89f78632 Update retry configuration to retry up to 4 minutes 2025-03-05 14:52:30 +01:00
Matthijs Krempel 730a77a71a Harmonized launchSettings to be inline with appSettings 2025-03-04 11:48:06 +01:00
Sipke Schoorstra 44b61aa24e
Add HttpContextAccessor to service registration
HttpContextAccessor is now included in the service container to enable dependency injection for accessing HTTP context. This improves support for features that require context details during runtime.
2025-03-03 19:13:51 +01:00
raymonddenhaan 40a12a623a
Merge pull request #6466 from elsa-workflows/blueberry-all-http-status
Simplify HttpRequestException handling in retry logic.
2025-03-03 16:51:56 +01:00
Sipke Schoorstra f71fbd23c7
Simplify HttpRequestException handling in retry logic.
Replaced specific transient status code check for HttpRequestException with a more generalized handling approach. This ensures all HTTP exceptions are retried, improving robustness and simplifying the logic.
2025-03-03 16:47:06 +01:00