elsa-core/test/component/Elsa.Workflows.ComponentTests/Scenarios
Sipke Schoorstra 0a2e99ad42
Expose consumers API and recursive export option (#7309)
* Initial plan

* Add consumers API endpoint and enhance export with IncludeConsumingWorkflows option

- New endpoint: GET /workflow-definitions/{definitionId}/consumers
- Export request model: added IncludeConsumingWorkflows boolean property
- Export endpoint: recursive consumer discovery and inclusion in exports

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Address greptile-apps feedback: fix double-fetch, remove redundant HashSet, add version comment, remove unused params

- Extract WriteZipResponseAsync helper to avoid double-fetching definitions from DB
- Remove redundant existingDefinitionIds HashSet in IncludeConsumersAsync
- Add XML doc comment documenting that consumers are resolved at VersionOptions.Latest
- Remove unused constructor parameters (workflowDefinitionService, variableDefinitionMapper)

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Address greptile-apps round 2: 404 for unknown definitions, deterministic ZIP response, parallel BFS

- Consumers endpoint now returns 404 when the definition ID doesn't exist
- Single-workflow export always returns ZIP when includeConsumingWorkflows=true
- BFS traversal processes each frontier level concurrently via Task.WhenAll

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Implement workflow reference graph feature

- Added `IWorkflowReferenceGraphBuilder` interface for building complete graphs of workflow references.
- Created `WorkflowReferenceGraph` and `WorkflowReferenceEdge` models.
- Implemented `WorkflowReferenceGraphBuilder` service for recursive graph building.
- Replaced previous workflow reference query logic with the new graph-based approach in consumers.

* Refactor workflow consumers to utilize recursive graph-based approach for retrieving consumer definitions.

* Enhance workflow export by adding support for including consuming workflows and update nullable default values across endpoints and models.

* Add WorkflowReferenceGraphOptions for depth and definition limit configuration

- Introduced `WorkflowReferenceGraphOptions` to configure max depth and definition limits for reference graph building.
- Updated `WorkflowManagementFeature` to support configuring these options.
- Enhanced `WorkflowReferenceGraphBuilder` to respect configuration limits during graph construction process.

* Refactor `WorkflowReferenceGraphBuilder` to utilize target-typed new expressions for cleaner code.

* Add Workflow Reference Graph tests and scenarios

Introduced JSON files for parent-child-grandchild workflow hierarchy tests and implemented unit tests for `WorkflowReferenceGraphBuilder`. Also added component tests for workflow export and consumers endpoint validation. Updated project configuration for workflow JSON to always copy to output directory.

* Include DefinitionId in exported workflow definition filenames for uniqueness.

* Remove unused models and constants from `WorkflowReferenceGraphTests`.

* Refactor `WorkflowReferenceGraphBuilderTests`: streamline test setup with `SetupGraph`, replace repeated assertions with helper methods.

* Deterministic ZIP export and 404 test coverage for consumers endpoint (#7312)

* Initial plan

* Fix deterministic ZIP export and add 404 test for consumers endpoint

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>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2026-02-20 17:40:47 +01:00
..
Activities Refactor Finish activity tests and workflows. Migrate integration tests to component tests, introduce new workflows for advanced scenarios, and enhance runner utilities to simplify execution logic. 2025-12-20 15:53:57 +01:00
BasicWorkflows Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
CachingAndWorkflowDefinitionActivity Fix semaphore release logic in scheduled task execution (#7045) 2025-11-09 14:14:25 +01:00
ClusteredHosting Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
ConcurrentTriggerIndexing Fix Race Condition Causing Duplicate Trigger Registration in Multi-Engine Environments + Add Concurrency Tests to Prevent Regression (#7131) 2025-12-05 09:17:14 +01:00
DistributedLockResilience Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Extensions Removed unnecessary tests, small refactors for readability +organization 2025-12-03 11:48:53 +01:00
HostMethodActivities Adds activity host registration support (#7172) 2025-12-27 20:52:52 +01:00
HttpWorkflows Fix route data handling (#6176) 2024-12-04 11:31:03 +01:00
InputOutput Add synthetic properties to JS engine for exclusion (#6178) 2024-12-05 09:30:31 +01:00
JavaScriptVariables Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
LogPersistenceModes Skip flaky test in InputOutputLoggingTests. 2025-05-20 11:41:00 +02:00
Multitenancy Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
RestApis Merge 3.5.1 into 3.6.0 (#6907) 2025-09-13 13:05:52 +02:00
Variables Add extensive unit and component tests for scheduling activities (#7036) 2025-11-07 21:54:50 +01:00
VariablesArray Added IEnumerableTypeConverter (#7020) 2025-11-12 11:07:33 +01:00
WorkflowActivities Implement null TenantId for tenant-agnostic entities (#7226) 2026-02-02 10:59:01 +01:00
WorkflowCompletion Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
WorkflowDefinitionExport Expose consumers API and recursive export option (#7309) 2026-02-20 17:40:47 +01:00
WorkflowDefinitionRefresh Add distributed workflow runtime implementation. 2025-06-03 09:58:20 +02:00
WorkflowDefinitionReload Fix trigger indexing logic and add tests for trigger persistence after workflow reload. (#6958) 2025-10-10 09:21:11 +02:00
WorkflowInstanceDeletion Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
WorkflowJsonStructures Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
WorkflowReferenceGraph Expose consumers API and recursive export option (#7309) 2026-02-20 17:40:47 +01:00