elsa-workflows / elsa-workflows/elsa-core

[BUG] Calling child workflow inside a loop is not working as expected

Open
#4,890 17 comments 0 reactions 1 assignee Claimed by @sfmskywalker 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

I want to call the childworkflow from a Parentworkflow. Parentworkflow will have a list of items and for each item in the list, I want to call a childworkflow. I tried **Foreach** and **While** but after executing the child workflow for the first loop, it Resets the items list. (It starts the ParentWorkflow again which is not expected. I expected that loop will continue without again starting parent workflow).

Observations: Without childworkflow inside the loop, The loop works fine.

Sample source code is provided in the attachment.
[Parent_ChildWorkflow.zip](https://github.com/elsa-workflows/elsa-core/files/14175673/Parent_ChildWorkflow.zip)

![image](https://github.com/elsa-workflows/elsa-core/assets/101645293/16efc3f1-8236-4fea-8657-a20e42b7dd9c)

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.