* 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 `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.
* Refactor workflow execution endpoints and introduce helper utility
Replaced `EndpointBase` class with lighter `WorkflowExecutionHelper` for handling workflow execution logic. Simplified Get & Post endpoints and added comprehensive component tests for enhanced validation.
* Update GetTests to expect NotFound instead of BadRequest
* Refactor logging system and replace JsonDestructuringConsoleFormatter.
Removed `JsonDestructuringConsoleFormatter` in favor of native JSON console formatting. Introduced `LogArgumentHelper` to process log arguments efficiently and added comprehensive unit tests. Updated `ConsoleLogSinkOptions` to use extensible `JsonFormatterOptions`.
* Refactor `LogArgumentHelper` methods for clarity and remove redundant string handling logic.
* Update src/modules/Elsa.Logging.Core/Helpers/LogArgumentHelper.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/modules/Elsa.Logging.Core/Helpers/LogArgumentHelper.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/modules/Elsa.Logging.Core/Helpers/LogArgumentHelper.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor `LogArgumentHelper` to improve type handling and dictionary conversion
Introduced a temporary list in `ConvertDictionaryToPairs` for better handling of dictionary entries. Updated property-to-pair conversion to cast results as objects, ensuring type consistency.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial implementation of log activity + base sink
* Refactor logging implementation: replace `Elsa.ProcessLogging` with a new modular `Elsa.Logging` framework, introducing support for configurable log sinks, enhanced logging extensibility, and updated dependencies in consuming projects.
* Enhance logging framework: introduce custom `NullableBoolConverter` and update JSON serialization/deserialization logic for log sink handling.
* Update description for `Log` activity input: clarify target sinks configuration
* Set default value of `SinkNames` input in `Log` activity to non-nullable collection
* Set `DisplayName` for `Sinks` input in `Log` activity
* Refactor logging framework: update `ILogSink` and `ILogSinkRouter` to support arguments and attributes, enhance `Log` activity to use updated interfaces, and add default category handling.
* Refactor logging framework: simplify argument handling in `ILogSink` and `ILogSinkRouter`, update `Log` activity inputs, and improve message formatting in `MelLogSink`.
* Update logging framework to simplify log sink creation, enhance category filtering, and refactor `ILogSink`/`ILogSinkRouter` interface methods.
* Introduce modular logging framework enhancements: add `Console` and `Serilog` logging features, refactor `ILogSink` framework, and update projects to align with a modular architecture.
* Refactor logging framework: introduce `AddCategoryFilters` extension, replace `DefaultCategory` handling with enhanced category filters, and update sink creation logic for consistency.
* Refactor logging framework: rename `SinkOptions` to `LogSinkOptions`, standardize naming across log sink types, and update configuration and sink factory logic for consistency.
* Enhance logging framework: add `ConfigureDefaults` methods, update `ILogSinkCatalog` to use `IServiceScopeFactory`, and improve logging configuration handling and defaults setup.
* Introduce asynchronous log entry processing: add `ILogEntryQueue`, `LogEntryBackgroundWorker`, and related models to enable queue-based logging and background processing. Update `Log` activity to enqueue log entries for processing.
* Add unit and integration tests for `Elsa.Logging.Core` library, refactor logger setup in `Elsa.Server.Web`, enhance logging configuration, and standardize `Directory.Packages.props` file.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add documentation comments to logging framework classes, interfaces, methods, and factories to enhance code readability and maintainability. Remove unused `CustomPurpleConsoleFormatter` class and `logs` folder from server project.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Make `LogEntryInstruction` and `LogEntryQueue` classes public and simplify return statement in `LogSinkCatalog.ListAsync` method.
* Standardize terminology in `ILogSink` interface and `LoggerSink` implementation: rename `properties` to `attributes`. Update project files and solution structure to reflect integration test additions.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update documentation comments in `LoggingFeature` and `LogEntryInstruction` to clarify functionality and improve precision.
* Add README for `Elsa.Logging` module with configuration examples, usage details, and extension guidance.
* Add `Dictionary` UI hint to `InputUIHints` and update `Attributes` in `Log` activity to use it.
* Update `Log` activity default category to "Process", add integration tests for logging, and enhance null safety in `ConfigurationLogSinkProvider`.
* Remove `UseLoggingFramework` middleware from `Program.cs` to streamline workflow initialization.
* Refactor `LoggerSink` to simplify logging logic and remove unused `FormatMessage` method. Enhance `Log` activity argument handling by introducing JSON parsing for string inputs.
* Refactor logging tests to improve consistency and update variable initialization in `WorkflowExecutionContext` for cleaner syntax.
* Replace mocked logger dependencies in tests with `TestLogger` and `TestLoggerFactory` for improved readability and maintainability.
* Add `JsonDestructuringConsoleFormatter` for structured JSON logging and update logging configuration to support new formatter.
* Refactor JSON converters: replace `NullableBoolConverter` with `NullableBooleanConverter` and `BooleanConverter` for improved readability and consistency.
* Add error handling and logging to `LogEntryBackgroundWorker`
Introduce exception handling with logging in `LogEntryBackgroundWorker` to capture and log errors during log entry processing. Added `ILogger` dependency for structured error reporting.
---------
Co-authored-by: lucas.hipolito <lukhipolito@yahoo.com.br>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial implementation of log activity + base sink
* Refactor logging implementation: replace `Elsa.ProcessLogging` with a new modular `Elsa.Logging` framework, introducing support for configurable log sinks, enhanced logging extensibility, and updated dependencies in consuming projects.
* Enhance logging framework: introduce custom `NullableBoolConverter` and update JSON serialization/deserialization logic for log sink handling.
* Update description for `Log` activity input: clarify target sinks configuration
* Set default value of `SinkNames` input in `Log` activity to non-nullable collection
* Set `DisplayName` for `Sinks` input in `Log` activity
* Refactor logging framework: update `ILogSink` and `ILogSinkRouter` to support arguments and attributes, enhance `Log` activity to use updated interfaces, and add default category handling.
* Refactor logging framework: simplify argument handling in `ILogSink` and `ILogSinkRouter`, update `Log` activity inputs, and improve message formatting in `MelLogSink`.
* Update logging framework to simplify log sink creation, enhance category filtering, and refactor `ILogSink`/`ILogSinkRouter` interface methods.
* Introduce modular logging framework enhancements: add `Console` and `Serilog` logging features, refactor `ILogSink` framework, and update projects to align with a modular architecture.
* Refactor logging framework: introduce `AddCategoryFilters` extension, replace `DefaultCategory` handling with enhanced category filters, and update sink creation logic for consistency.
* Refactor logging framework: rename `SinkOptions` to `LogSinkOptions`, standardize naming across log sink types, and update configuration and sink factory logic for consistency.
* Enhance logging framework: add `ConfigureDefaults` methods, update `ILogSinkCatalog` to use `IServiceScopeFactory`, and improve logging configuration handling and defaults setup.
* Introduce asynchronous log entry processing: add `ILogEntryQueue`, `LogEntryBackgroundWorker`, and related models to enable queue-based logging and background processing. Update `Log` activity to enqueue log entries for processing.
* Add unit and integration tests for `Elsa.Logging.Core` library, refactor logger setup in `Elsa.Server.Web`, enhance logging configuration, and standardize `Directory.Packages.props` file.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add documentation comments to logging framework classes, interfaces, methods, and factories to enhance code readability and maintainability. Remove unused `CustomPurpleConsoleFormatter` class and `logs` folder from server project.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Make `LogEntryInstruction` and `LogEntryQueue` classes public and simplify return statement in `LogSinkCatalog.ListAsync` method.
* Standardize terminology in `ILogSink` interface and `LoggerSink` implementation: rename `properties` to `attributes`. Update project files and solution structure to reflect integration test additions.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update documentation comments in `LoggingFeature` and `LogEntryInstruction` to clarify functionality and improve precision.
* Add README for `Elsa.Logging` module with configuration examples, usage details, and extension guidance.
* Add `Dictionary` UI hint to `InputUIHints` and update `Attributes` in `Log` activity to use it.
* Update `Log` activity default category to "Process", add integration tests for logging, and enhance null safety in `ConfigurationLogSinkProvider`.
* Remove `UseLoggingFramework` middleware from `Program.cs` to streamline workflow initialization.
---------
Co-authored-by: lucas.hipolito <lukhipolito@yahoo.com.br>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Exclude blacklisted types (`string`, `object`, `Array`, `DateTime`) from workflow variable registration logic.
* Add integration tests for JavaScript evaluation and update type blacklist in `ConfigureEngineWithVariableTypes`
* Disable central package transitive pinning and update Elsa Studio version to `3.5.0`.
* Update Microsoft version to 9.0.8 in Directory.Packages.props
* Enable central package transitive pinning in `Directory.Packages.props`.
* Refactor `ObjectConverter` to improve readability and add backward-compatible default value handling in non-strict mode.
* Add `StrictMode` option to `ObjectConverterOptions` and update related tests
Introduced a `StrictMode` option to `ObjectConverterOptions` to control strict type conversion behavior. Updated the `ObjectConverter` logic to utilize this new option and refactored unit tests to include `ObjectConverterOptions` where necessary, ensuring comprehensive test coverage for strict and non-strict mode scenarios.
* Fix ObjectConverter default value handling and update unit tests
Standardize usage of `targetType` for default values in `ObjectConverter`. Refactor and consolidate unit tests to improve coverage and clarity, addressing various conversion and exception scenarios.
* 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.
Updated default property values across activities to use `null!` instead of `default!`, ensuring clearer nullability intent. Also adjusted constructor parameter defaults to `null` for consistency.
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.
* 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.
Set ObjectConverter.StrictMode to true in the test constructor to enforce stricter conversion rules during tests. This ensures better reliability and consistency in test coverage.
* Updated output handling of asynchronously run workflows to be the same as when run synchronously
* updated tests
* Refactor activity execution mapping and output persistence
Introduced `GetPersistableOutputAsync` in `IActivityExecutionMapper` to streamline output persistence logic. Refactored the handling of activity persistence properties, replacing repetitive code with reusable methods. Removed unused dependencies and redundant methods, optimizing code readability and maintainability.
* Remove docker-compose-datadog.yml from solution file.
The docker-compose-datadog.yml file is no longer included in the solution structure. This change cleans up unused references to ensure the solution remains consistent and up-to-date.
* Refactor workflow extensions and add new utilities
Split and reorganize workflow-related extension methods into `RunActivityExtensions` and `RunWorkflowExtensions` for better modularity. Removed deprecated methods from `ServiceProviderExtensions`. Updated tests and usages to reflect these changes.
---------
Co-authored-by: Bob Hauser <rhauser@kinaxis.com>
* 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.
* Add support for activity output testing
Removed obsolete test workflows and updated the If activity tests to align with simplified testing practices. Introduced `GetActivityOutput` extension for retrieving activity outputs from workflow results. Refactored related APIs to simplify execution flow and unified cancellation token handling in service methods.
* Remove unused Parlot.Fluent namespace in IfTests.cs
This commit removes an unused "using" directive for the Parlot.Fluent namespace in the IfTests.cs file. Cleaning up unused references helps maintain code clarity and reduces potential confusion.
* Handle conversion of enumerables to arrays in ObjectConverter
Added functionality to convert enumerables to arrays when the target type is an array. The implementation ensures each item is properly cast to the target array's element type and then added to the resulting array.
* Add unit test for converting object array to double array
This commit introduces a new test ensuring the proper conversion of an object array of doubles to a double array. It verifies both the validity of the conversion and that the result is not null.
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.
Introduced the ability to set and persist custom names for workflow instances. Updated relevant classes, services, and tests to ensure proper handling of the `Name` property.
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.
Extended test data in `LoopingWorkflow` to include a third item, "Item 3". Updated assertions in `Tests.cs` to validate the new expected output for the additional item.
Refactored ObjectConverter to handle JSON array conversions more robustly, including support for arrays of complex types. Added a `Person` class for unit testing and updated tests to validate the new functionality. Included necessary project reference updates to ensure proper functionality.
Updated all instances of explicitly typed `string` and `JsonElement` to `var` in `JsonElementConverterTests.cs` to improve code readability and maintain consistency with modern C# coding practices. This change does not affect functionality but aligns with better style conventions.
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.
Refactored TypeJsonConverter to distinguish and properly handle serialization of arrays and generic collections. Updated integration tests to include cases for round-tripping primitive arrays and collections for improved coverage.
Introduce a new integration test to verify workflow serialization functionality, ensuring that newly created workflow definitions can be serialized and deserialized correctly. Adjust default nullability for certain fields in `WorkflowDefinition` to improve consistency and prevent null reference issues. Minor argument update in `New` method of `WorkflowDefinitionPublisher`.
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.
This was broken by both #5871 and #5682:
1. When a List<Guid> was serialized, it was recognized as a primitive collection and thus plainly written to the JSON without any type information: ["d4d8404c-4357-47ff-a343-649a116539f5"]
2. When this JSON was deserialized, due to lack of type info, it was deserialized as List<object>, containing strings. This is already not good.
3. When this List<object> gets serialized again (e.g. due to multiple workflow suspends causing WorkflowState serialization), this time it fails the primitive collection recognition, because object is not a primitive type. It now gets serialized as {"_items": ["d4d8404c-4357-47ff-a343-649a116539f5"], "_type": "Object[]"}
4. When that JSON gets deserialized, it tries to ReadType() but ReadType() fails to parse Object[] since it lacks the logic from TypeJsonConverter to throw away the [] before looking up Object in the WellKnownTypeRegistry, so it returns null as a type. Without a type but being faced with a json object { ... } it now deserializes into an ExpandoObject
5. Any further serialization / deserializations will now cause the expando object to get nested deeper and deeper every time.