I read the documentation that it isn't possible to create a loop in a workflow, but I need to invoke the main method separately each time with the list item - hence need to create a loop.
One solution was to invoke the workflow again using sub-workflow.
Is there any other solution to this? Like using coordinator jobs?