elsa-workflows / elsa-workflows/elsa-core
[BUG] When using `HttpEndpoint` with `DispatchWorkflow` the parent workflow returns a 200 OK immediately
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
When using `HttpEndpoint` along with `DispatchWorkflow` where `WaitForCompletion = true`, the parent workflow returns a 200 OK immediately instead of waiting for the dispatched workflow to finish. Additionally, it ignores the `WriteHttpResponse` activity, which is part of the parent workflow. This issue occurs regardless of the persistence layer (MongoDB/SQLite).
## Steps to Reproduce
1. Use a parent workflow that includes an `HttpEndpoint` and dispatches a child workflow using `DispatchWorkflow` with `WaitForCompletion = true`.
2. Include a `WriteHttpResponse` activity in the parent workflow.
3. Observe that the parent workflow returns a 200 OK immediately, ignoring the `WriteHttpResponse` activity, and does not wait for the dispatched workflow to complete.
Reproduction rate: 100%, happens every time.
- **Workflow JSON**: [Attach the JSON files here]
## Expected Behavior
The parent workflow should wait for the dispatched workflow to complete and the `WriteHttpResponse` activity should send the correct response after completion.
## Actual Behavior
The parent workflow returns an empty 200 OK immediately and skips the `WriteHttpResponse` activity.
## Environment
- **Elsa Package Version**: 3.1.2 and 3.2
- **Operating System**: Testd on Azure App service Unix container and windows 11
## Log Output
SQLite Db is attached (as a json - please change to .db) along with exported flow instance jsons
[child-workflow.json](https://github.com/user-attachments/files/17131010/child-workflow.json)
[parent-workflow.json](https://github.com/user-attachments/files/17131011/parent-workflow.json)
[745a94af40dcd72e.json](https://github.com/user-attachments/files/17131012/745a94af40dcd72e.json)
[c1e1736a74cfefbf.json](https://github.com/user-attachments/files/17131013/c1e1736a74cfefbf.json)
[elsa.sqlite.json](https://github.com/user-attachments/files/17131035/elsa.sqlite.json)
Contributor guide
Assessment
This issue has not been assessed yet.