elsa-workflows / elsa-workflows/elsa-core

Bookmarks remain stuck in database when resuming multiple workflows in rapid succession

Open
#7,223 1 comment 1 reaction 2 assignees Claimed by @sfmskywalker View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

## Description
When attempting to resume multiple bookmarks in rapid succession, several records remain stuck in the `Bookmarks` table and are never processed, even though the API calls to `/tasks/{taskid}/complete` return a successful (200 OK) response.

## Steps to Reproduce

1. **Setup & Execution**
- Open the attached Visual Studio project.
- Configure your connection string in the `appsettings.Development.json` file of the **Server** project.
- Start the **Server** project.
- Log into Elsa Studio using default credentials and import the attached **Workflow JSON**.
- Publish the imported workflow.
- Configure your connection string in the `appsettings.json` of the **ConsoleTestApp** project.
- Build the **ConsoleTestApp** project.
- Ensure the `Bookmarks` table is currently empty.
- Open a command prompt (CMD) in the directory containing `Sample.ElsaWorkflow.ConsoleTestApp.exe`.
- Execute the following command to initialize workflows:
```bash
Sample.ElsaWorkflow.ConsoleTestApp.exe run 200
```
- Wait for completion and verify that 200 records exist in the `Bookmarks` table.
- Execute the following command to resume the workflows:
```bash
Sample.ElsaWorkflow.ConsoleTestApp.exe resume 200
```
- Wait for the resume process to finish.

2. **Observation**
- Upon completion, several records remain "hanging" in the `Bookmarks` table.
- No errors are reported in the server logs.

## Expected Behavior
All bookmarks should be successfully resumed, and the corresponding workflows should proceed to completion.

## Actual Behavior
A subset of bookmarks remains stuck in the database, leaving the workflows in a permanent `Suspended` state.

## Environment
- **Elsa Package Version**: 3.5.3 and 3.6.0-rc2
- **Operating System**: Windows 11, Windows Server 2016, Windows Server 2019.
- **Database Engine**: SQL Server 15 Express, SQL Server 14 Developer.
- **Dispatcher**: Default Workflow Dispatcher.

[test-input-parent.json](https://github.com/user-attachments/files/24968748/test-input-parent.json)
[Sample.ElsaWorkflow.zip](https://github.com/user-attachments/files/24968749/Sample.ElsaWorkflow.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.