# Multi instance on call Activity component

**URL:** <https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231>\
**Category:** Camunda 7 Topics\
**Created:** [March 3, 2025, 10:09am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231 "2025-03-03T10:09:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidjain](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sidjain](https://forum.camunda.io/u/sidjain)\
**Post date:** [March 3, 2025, 10:09am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/1 "2025-03-03T10:09:48Z")

</div>

Hi,  
I am designing a process that includes a `callActivity` component with a loop, where the loop is sequential. Upon completion of each execution of the inner activity, a variable is added to the same process.

Now, I want to make that variable accessible to the outer process. Additionally, through an execution listener at the end of the `callActivity`, I want to sum up the results of all iterations into another variable.

When I am adding the out parameter to the call activity with looping, it is not visible in the execution listener as well in the db table.

The same is working fine if looping is not there.

Please let me know how I can achieve this.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [March 3, 2025, 10:16am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/2 "2025-03-03T10:16:26Z")

</div>

Have you defined the output variables for the Call Activity?

---

<div class="post-metadata">

**Author:** ![sidjain](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sidjain](https://forum.camunda.io/u/sidjain)\
**Post date:** [March 3, 2025, 10:59am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/3 "2025-03-03T10:59:28Z")

</div>

Yes, I have defined the output variable. and the reference is also available under the child process.

---

<div class="post-metadata">

**Author:** ![sidjain](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sidjain](https://forum.camunda.io/u/sidjain)\
**Post date:** [March 6, 2025, 4:46am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/4 "2025-03-06T04:46:26Z")

</div>

Is there any property available to get all the data from loop. In Activiti, there is one property we can use to collect all the results from the loop iterations.

processDataList

But the problem here is it collects all the local variables of the iteration execution entity. So, i am not sure how to set all variables from child process to the loop iteration execution entity.  
Because of this, I am getting a list of empty maps.

I am not sure how we can use this concept to achieve our goal.

---

<div class="post-metadata">

**Author:** ![herrier](https://forum.camunda.io/user_avatar/forum.camunda.io/herrier/32/29369_2.png) [@herrier](https://forum.camunda.io/u/herrier)\
**Post date:** [March 6, 2025, 11:30am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/5 "2025-03-06T11:30:32Z")

</div>

Could you share the process, or a cut down version of it?

---

<div class="post-metadata">

**Author:** ![DaveyStones](https://forum.camunda.io/letter_avatar_proxy/v4/letter/d/e19b73/32.png) [@DaveyStones](https://forum.camunda.io/u/DaveyStones)\
**Post date:** [March 13, 2025, 8:47pm UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/6 "2025-03-13T20:47:35Z")

</div>

In the subprocess that you’re calling via the Call Activity, you can keep a list of whatever you want in the process variable context that you can populate on each iteration and overwrite it at the end of the subprocess with the updated list. That way, you can return that variable as an output from the call task and it will have all of your aggregated data in it. (Could also be done with other collections, eg. maps.)

---

<div class="post-metadata">

**Author:** ![sidjain](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sidjain](https://forum.camunda.io/u/sidjain)\
**Post date:** [March 20, 2025, 5:44am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/7 "2025-03-20T05:44:22Z")

</div>

Hi,

What I understood from your answer, is to add a loop on subprocess instead on the call Activity.  
Am I right?  
As per my requirement, I want to add a loop on call Activity and completion of each iteration of the call activity, I need a particular variable to be added in the list from child process to the parent process.

Here problem is that, out parameters and looping on call activity are not working with each other.

---

<div class="post-metadata">

**Author:** ![herrier](https://forum.camunda.io/user_avatar/forum.camunda.io/herrier/32/29369_2.png) [@herrier](https://forum.camunda.io/u/herrier)\
**Post date:** [March 20, 2025, 10:30am UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/8 "2025-03-20T10:30:36Z")

</div>

Just thinking - is this question and solution the same?

> [@Aggregate and pass child processes camunda variable to parent process](https://forum.camunda.io/t/aggregate-and-pass-child-processes-camunda-variable-to-parent-process/60236):
>
> Hi, From Parent process I am triggering multiple child processes using callActivity. Each child process sets a variable called “serviceKey” with a String value. Now how can I get a variable in Parent process called “serviceKeyList” with List\<String\> as the value? After callActivity parallel child processes are all done, using asyncAfter and End Execution Listener I can trigger an execution listener in the Parent process. Is there any Java code example where I can iterate over all child proc…

---

<div class="post-metadata">

**Author:** ![DaveyStones](https://forum.camunda.io/letter_avatar_proxy/v4/letter/d/e19b73/32.png) [@DaveyStones](https://forum.camunda.io/u/DaveyStones)\
**Post date:** [March 25, 2025, 3:02pm UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/9 "2025-03-25T15:02:58Z")

</div>

No, the call activity calls another process, which I was referring to as the subprocess. The multi-instance loop on the call activity is the correct way to loop.

Basically what I mean is that you set up the multi-instance loop on your call activity. You also have an output which would be the name of your list from the process being called (ie. subprocess) by your call activity.

Within the called process (ie. subprocess), you would ideally have a service task that did some work, or perhaps you do all your work in the business process, but could then have a service task or script task that would read whatever variables you need to build your list item, read the list from the variable map, build that iteration’s object and add to the list, then complete the task with a map containing just your updated list with the same variable name. It will overwrite what is in your local variable map for that process iteration, containing what was in the variable when read in plus the added item.

Apparently for multi-instance loops on call activities, it will keep up with your variables from each instance, or at least the ones specified in the **Out Mappings** section.

For example, in this image of the configuration of a Call Activity, the loop is being set to iterate over `autoRemandClaimsToProcess`. All in mappings from the caller are propagated to the called activity (this may be part of how the out mappings are persisted for each loop iteration?) and the out mappings are `remandClaims` and `remandDecisionReviews`. In the called process, there is a service task that updates the `remandClaims` and `remandDecisionReviews` task with those items that were produced for each iteration, and that compiled list is available to the caller once all loop iterations are complete.

 ![image](https://forum.camunda.io/uploads/default/original/3X/2/5/254797782511d83768e9279c914ec53ae0f9e795.png)

Hope that helps.  
- Dave

---

<div class="post-metadata">

**Author:** ![DaveyStones](https://forum.camunda.io/letter_avatar_proxy/v4/letter/d/e19b73/32.png) [@DaveyStones](https://forum.camunda.io/u/DaveyStones)\
**Post date:** [March 25, 2025, 3:07pm UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/10 "2025-03-25T15:07:09Z")

</div>

Also wanted to show the **Out Mappings** details. Pretty straightforward. Just reading the variables as they are named in the child process ( **Source** ) and naming them the same in the parent ( **Target** ).

 ![image](https://forum.camunda.io/uploads/default/original/3X/2/0/20f07f59d156f7b9529e8f84062cdb7a919a408f.png)

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [June 23, 2025, 3:08pm UTC](https://forum.camunda.io/t/multi-instance-on-call-activity-component/60231/11 "2025-06-23T15:08:04Z")

</div>

Closed on June 23, 2025, 3:08pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
