How to run robots parallel with SAP user constraint

We have onprem Orchestrator with 2 unattended licenses.

We have 2 virtual machines: M1 and M2.
We have 2 Windows users for VM logins: WinUserM1, WinUserM2
We currently have ~60 processes which all work in SAP.

Currently, to run things in parallel, we created 2 SAP users, one for each machine: SAPM1, SAPM2. The SAP user to be used for a process is set in the config file for each process.

We have “short running” proccesses in folder1 using Machine1, WinUserM1 and SAP user SAPM1.
We have “long running” proccesses in folder2 using Machine2, WinUserM2 and SAP user SAPM2.

That way we can easily guarantee that the SAP user logins do not overlap across parallel process executions.

As we plan to reorganize the folders within the orchestrator to better reflect the company structure and create more WinUsers (with less access each), we fear to lose overview over triggers in orchestrator. If we have the folders SubOrg1, SubOrg2, SubOrg3 and multiple processes in each, how do we avoid that processes use the same SAP user login at the same time on two machines (one process would fail, as SAP users only allow 1 session).

What is generally “best practice” with our setup? I read about “high density robots” which would be super nice to save resources, but how could we avoid that two processes try to login to SAP with the same user? Creating separate SAP users for each process is not feasible because of cost.

@markusg

One thing you can try is add two assets sap1 and sap2…

now when bot starts check if sap1 or sap2 is true…if true then user id’s are being sued…if not true then set true from the bot and retrieve the corresponding login information and use…once the process completes in end process state set the asset to false again

cheers

Hi @Anil_G

thanks for the input. Yes I also thought about a “lock mechanism” to lock the SAP user for other processes. I guess this could also be done with a separate queue as mentioned in Is it able to 'Lock' an asset? - #4 by Reshmamore.

However, this would result in a failed process if the SAP user is currently locked. How could this failed process now retry its execution in e.g. 1hr? We currently use time triggers for each process

@markusg

As you have only two processes and two sap logins no bot would fail…they would choose either one of the logins…

And any process that triggers after two processes are running would wait for the bots to complete and only then it would starts

Please let me know if that is not the case with you or if I am wrong

Even in that case we can use start job api triggers to start the job and they would go to pending state and would start once machine is available

Or create a one time trigger as needed to run after 1 hour again using api

Cheers

@Anil_G

Thats true if a process could use either SAPuser1 or SAPuser2.
However, some processes have a dependency to use a specific SAP user (because of certain access rights within SAP).
So if process7 and process8 both need SAPuser1 and run parallel on both machines, one would still fail…

@markusg

Then consider using start job trigger and start the job on same machine as the other bot is running so that it would stay in pending till that bot completes and would start immediately after the job completes

<OrchestratorURL>/swagger/index.html#/Jobs/Jobs_StartJobs

Or a process schedule trigger which will create a trigger and we can control cron expression to run only once may be after 1 hour or so

<OrchestratorURL>/swagger/index.html#/ProcessSchedules/ProcessSchedules_Post

cheers

@Anil_G

We will first check if we could make the processes use any SAP user to follow the “lock mechanism” idea as this seems to be the most clean approach.
Thanks for your ideas!

1 Like

Following the “queue lock” method, one option would be to wait until the credential becomes available (with maybe some kind of error mechanism to avoid waiting forever).

@efelantti

Do you know how to realise this “trigger dependency” within orchstrator? I would like to stick to the UiPath principles and not add too much logic of trigger handling into the process itself.

@markusg

You mean you want to dlete the triggers?

Cheers

If you go for the solution that the process would wait for available credentials via queue, I would just write the logic in the processes.

@efelantti

No I want to stick with the timed triggers, but add a dependency to it (run each monday at 08:00 and wait until SAPuser1 is free) for example.

@markusg

:slight_smile: directly with trigfers its not possible

May be schedule trigger for wvery hour and check if the process is completed or not again…which is tedeous

Cheers

Use a time trigger to start the process. Inside the process you could use “Wait Queue Item” activity Activities - Wait Queue Item - https://docs.uipath.com/ to wait until the credential is available.