elsa-workflows / elsa-workflows/elsa-core

Duplicate Execution of Activity in Alterations

Open
#6,887 0 comments 2 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

## Description
When migrating a workflow instance to the latest version (where a sub-process has been updated), a step inside the sub-process executes twice instead of once.

No error messages appear, but this leads to duplicate task execution and workflow inconsistency.

## Steps to Reproduce
1. Create two sub-processes `SP-1` and `SP-2`.

Image

Image

2. Create a main workflow using these two sub-processes.

Image

3. Create a workflow instance of the main workflow.

Image

4. Complete both steps in `SP-1` and finish that sub-process.

Image

5. Complete the first step in `SP-2`.

Image

6. Update `SP-2` by adding a new step in parallel with `Step-2`.

Image

7. Migrate the current workflow instance to the latest version.

Image

8. Since `Step-3` is not active, try to activate that step using **Schedule Activity**.

Image

### Problem
- When the step is activated, its execution starts **twice**.

## Reproduce Rate
- **Every Time**
(This is specific to activity activation. If the same scenario is tested with sub-process activation, it works fine.)

## Expected Behavior
- Step 3 should be activated and executed only once to maintain integrity.

## Actual Behavior
- Step 3 is activated and executed **twice**.

## Environment
- **Elsa-Core**: Branch `develop/3.5.0`
- **Elsa-Studio**: Branch `develop/3.5.0`

@sfmskywalker
Could you please look into this issue?
If there are any quick workarounds or temporary fixes available, kindly suggest those as well.

Contributor guide

Open the contributing guide

Research direction

Reproduce the scenario on the develop/3.5.0 branches using the listed SP-1, SP-2, and main-workflow steps, then trace the Schedule Activity path after migration. Done means Step-3 is activated and executed exactly once, while the equivalent sub-process activation scenario continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.