elsa-workflows / elsa-workflows/elsa-core
[BUG] Problem with WriteHttpResponse Activity on External Workflow Start
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
In my scenario, there are two workflows, A and B. A has a cron job that starts B every x minutes. B has no interruptions and is supposed to run continuously every x minutes. Now, my problem is that when the workflow is triggered by A, the WriteHttpResponse activity does not terminate but goes into a suspended state. If I manually start B, this problem does not occur, so I suspect an issue in the interaction between the cron job and the WriteHttpResponse activity.
## Steps to Reproduce
The problem can be simplified from two workflows to one. If we create a workflow C that is supposed to be started by a cron job every x minutes and it contains a WriteHttpResponse somewhere, it gets stuck at the WriteHttpResponse, and the workflow remains in a suspended state without progressing. Also, it's worth mentioning that if we don't use a cron activity to start the workflow, i.e., if we execute it manually, the problem does not occur.
What I have tested so far:
Manually starting the workflow: works
Starting the workflow via cron: suspended
Starting the workflow via event: suspended
### Attachments
Workflow without cron/ event:

Execution:

Workflow with cron:

Execution:

Workflow with event:

Execution:

## Expected Behavior
I expect the workflow to finish, just as it does without the cron/event.
## Actual Behavior
The workflow gets into a suspended state and does not continue.
## Related Issues
Issues that I found also have a problem with the WriteHttpResponse:
- https://github.com/elsa-workflows/elsa-core/issues/5267
The issue I mentioned earlier:
- https://github.com/elsa-workflows/elsa-core/issues/4895
Contributor guide
Assessment
This issue has not been assessed yet.