Document understanding - For each in parallel query

Dears,

I need your help and experience to use the best solution architecture to achieve my following goal:

I am receiving queue items in a particular queue with this specific content

    "SpecificContent": {
        "CR_URL": "{{ CR_URL }}",
        "TAX_URL": " {{ TAX_URL}} ",
        "Establishment_Card_URL": " {{ Establishment_Card_URL}} ",
        "Trade_License_URL": " {{ Trade_License_URL}} ",
        "Bank_URL": " {{ Bank_URL}} ",
    }

What the performer robot should do is download the files of all the previous links and perform a DU process in each in Parallel.
Why in parallel? Because we need the execution to be as fast as possible, and in case the bot needs a human in the loop for more than one document, then the actions should also be created in parallel so the human will enter in one time and do the tasks.
After processing all the documents, the same performer process will merge the extracted fields from all the documents and post them to an SAP endpoint

So I am going to use for each in parallel activity in that performer process and inside its block I will use the DU activities, however it get to my mind hat if one document need human in the loop and in that loop instance for that document the bot created a task for human and move the job to suspended mode, then what will happen to the other loop instances for the parallel for each? They will be suspended as well, no? then I lost the main benefit of using the parallel loop.

And if I use run job activity inside the for each in parallel, so the parent process will not execute DU it will only trigger a child process that I will create for DU only then in this case the parent process will create a separate DU job for each document and if one of them needs human in the loop then the other will continue processing without any interruption, however the parent job will stay running and waiting for all the children to finish to continue (so it will stay occupying an untended robot license and VM), then if I have high volume of transactions then the parent process will be triggered for more than one job and if all of them have at least one children job suspended then all assigned licenses for this process will be occupied and the new transaction will be pending till the human will enter the action center and clear the tasks (which is not accepted from UX level)

Do you have any other suggestions or ideas to solve this issue?

Regards,
Bakr

@Mohammed_Bakr

first thing wait for resume activity cannot be used in process.xaml or inner xamls..only entry point xaml supports

ideal UiPath way is to trigger one process of du for each file but if you dont want to do that

ideally in your situation you need to follow the below

  1. Create first performer which will process the files and if human validation is needed then create validation task and save the outputs into a global lsit of tasks and in the end process use parallal for each and use wait for resume task inside it..which will wait for all task and resume if any one is cleared
  2. In the same loop use add queue item and add the items which are completed into a different queue where the second peformer will perform the sap part as needed

cheers