elsa-workflows / elsa-workflows/elsa-core

V3 - Retry problem with nested activities

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

Description

Hi
I am implementing a retry that supports an ActivityInstanceId
I give an example of the code
```
public async Task> Retry(string instanceId, string activityInstanceId)
{
var allResults = new List();
var workflowInstances = (await _workflowInstanceStore.FindManyAsync(new WorkflowInstanceFilter { Id = instanceId }, CancellationToken.None)).ToList();
foreach (var workflowInstance in workflowInstances)
{
var alterationPlan = new ScheduleActivity { ActivityInstanceId = activityInstanceId };
var results = await _alterationRunner.RunAsync(instanceId, new List() { alterationPlan },
CancellationToken.None);
allResults.Add(results);
await _workflowDispatcher.DispatchAsync(new DispatchWorkflowInstanceRequest(workflowInstance.Id), CancellationToken.None);
}
return allResults;
}
```
And initially it is working well, it is retrying the activities with their specific context without problem.
The problem comes to me when the instance I am trying to retry is a nested activity

Example

Root FlowChart -> Container activity -> Parallel ForEach(only 1 item to iterate) -> Then my custom activity <--- This fault

The behavior of the Alteration is causing a triple execution of the same activity when invoking the retry of the instance

The lack of this stable functionality is posing a serious problem for us when it comes to using Elsa 3 in production. Error control is very important and they are workflows with enough logic that prevents us from "starting the entire flow again"

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.