elsa-workflows / elsa-workflows/elsa-core
Workflow runs again from the beginning after a MigrateVersion alteration
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
In Elsa 3 after i run an alternation with migrate and call DispatchAsync with IAlteredWorkflowDispatcher, the workflow runs through the already completed activities again.
## Steps to Reproduce
1. Progress with a workflow until a point.
2. Change something in it.
3. Publish the changes.
4. Call migrate alteration with it for the new version:
```
var alterations = new List
{
new Migrate
{
TargetVersion = targetVersion
}
};
var runner = Scope.Resolve();
var results = await runner.RunAsync(workflowInstanceId, alterations);
var dispatcher = Scope.Resolve();
await dispatcher.DispatchAsync(results);
```
## Expected Behavior
It should continue from the activity where the workflow was paused before the alteration.
## Actual Behavior
It's running through all the already completed activities again, until the point where the workflow was originally.
## Environment
- **Elsa Package Version**: 3.4.0-rc1
- **Operating System**: Windows 11
Contributor guide
Research direction
Start by reproducing the issue with the listed Elsa 3.4.0-rc1 steps, then inspect the IAlterationRunner and IAlteredWorkflowDispatcher paths involved in Migrate and DispatchAsync. Compare the workflow state before and after migration; done means a migrated workflow resumes at its paused activity without rerunning completed activities.
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