Skip to main content
Solved

Looping through a List in Automation Anywhere Process Composer

  • July 14, 2025
  • 11 replies
  • 357 views

Hello Comunity ,

I am designing a business process where a main bot retrieves a list of items from a source system. I then need to iterate through this list, and for each item, I want to call a separate bot to perform a specific action.

My initial approach was to use Process Composer to orchestrate this flow. However, after the first bot returns the list, I've realized there is no direct way within Process Composer to loop through the list items and execute another bot for each item.

What is the recommended best practice in Automation Anywhere Enterprise to achieve this kind of dynamic bot execution? How can I pass a list from a parent bot and use its contents to trigger a child bot for each list item?

Best answer by Aaron.Gleason

@LAHCEN AGLAGAL All your error handling will be within your task bot. One way to handle this is to have a Boolean variable and use a Loop to contain the functionality you want to restart if it fails:

$bSuccess$ = false

Loop… While $bSuccess$ = false

Try...

   (your functions here)

$bSuccess = true    // this is set true only if it got all the way through, otherwise it’s still false

End Try

End Loop

11 replies

DS78
Most Valuable Pathfinder
Forum|alt.badge.img+6
  • Most Valuable Pathfinder
  • July 14, 2025

You can use task bot for looping in through the list and based on the list items, you can then call subtask bot depending on your requirement.

You can pass the value as an input variable to the subtask as well.


I don't see the need of Process Composer here. You can explain in more detail if I am missing something.

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • July 14, 2025

@DS78 ​@LAHCEN AGLAGAL Correct, DS! You can perform some rudimentary looping using the Go To element within Process Composer, but Process Composer’s focus is really to direct the task bots, API tasks, forms, etc., and move data from one element to another. I recorded a video on this topic that should be live shortly.


  • Author
  • Navigator | Tier 3
  • July 14, 2025

@DS78  ​@Aaron.Gleason  Thank you for the guidance.

However, I'm concerned about error handling. I need a way to manage retries. For example, if a child bot fails, I want to restart the entire parent process from the beginning.

My initial thought was to use a "GO TO" action, which I know doesn't exist in Task Bots.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • Answer
  • July 14, 2025

@LAHCEN AGLAGAL All your error handling will be within your task bot. One way to handle this is to have a Boolean variable and use a Loop to contain the functionality you want to restart if it fails:

$bSuccess$ = false

Loop… While $bSuccess$ = false

Try...

   (your functions here)

$bSuccess = true    // this is set true only if it got all the way through, otherwise it’s still false

End Try

End Loop


DS78
Most Valuable Pathfinder
Forum|alt.badge.img+6
  • Most Valuable Pathfinder
  • July 14, 2025

You can still do that by using a flag - a Boolean variable tracking the status for your bot success or failure.


  • Author
  • Navigator | Tier 3
  • July 14, 2025

@DS78 ​@Aaron.Gleason 
Thanks for your help. I'll try to come back to u


  • Cadet | Tier 2
  • July 16, 2026

From what you've described, Task Bots are a better fit for iterating through a list than Process Composer. You can retrieve the list in the parent bot, use a Loop (For each item in the list) to process each element, and pass the current item as an input variable to a child bot if needed. This also makes error handling and retries much easier to manage within the Task Bot, while Process Composer can remain focused on orchestrating the overall workflow rather than performing item-by-item iteration.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • July 16, 2026

@jasonjohns533 The answer is “yes” and “no”. Task Bots and Processes perform different functions. Think of Task Bots as the “tools” and the Process as the “instructions on how to use the tools”. Task Bots will run without Processes -- that’s standard RPA. Processes won’t do much without a Task Bot, API Task, Form, or other elements. It can only move the flow of the Process and the data associated with it.

Where Processes really hit their stride is the ability to work with data “back in time”. For example, if we start a Process with a Task Bot who sets its output value to “ABC”, then the Process feeds “ABC” into another Task Bot which outputs “DEF”, inside the Process you still have access to the original output value (ABC) and the new output value (DEF). That’s something that would be difficult to do with standard RPA.

Being able to gather data from multiple tools at multiple execution points is one of the strengths of Processes.


  • Cadet | Tier 2
  • July 18, 2026

Thinking of Task Bots as the workers and Processes as the orchestration layer makes the distinction much clearer. The ability for a Process to retain and reference outputs from multiple execution steps is especially valuable for complex workflows, approvals, and branching logic where maintaining context across the entire process is important. It also makes debugging and extending automations much easier than trying to manage everything within a single Task Bot


Matt.Stewart
Automation Anywhere Team
Forum|alt.badge.img+3
  • Automation Anywhere Team
  • July 20, 2026

Processes handle things at the work item level.  Use a loop to pass work items into a process and allow an instance of the process to create and handle each work item.

 

 


  • Cadet | Tier 2
  • July 23, 2026

It is much easier to see the difference when you think about Task Bots as the workers and Processes as the orchestration layer. For complicated workflows, approvals, and branching logic, when preserving context across the whole process is crucial, a process's capacity to store and refer to outputs from several execution phases is particularly beneficial. Additionally, it is far simpler to troubleshoot and expand automations than attempting to handle everything with a single Task Bot.