One of my biggest limitations with the background process is that when you run one from Orchestrator, it must run in Session 0, which can be very limiting when it comes to permissions and there are other issues which arise.
Could you theoretically create a foreground process which logs into the user session and runs multiple background processes in parallel, therefore bypassing the issues of session 0 and running the processes as the actual user?
— Edit —
It seems to be possible but there are a number of issues with the practicality -
The foreground process is taking the UI runtime slot so there is no immediate benefit. You could still benefit by:
Using a UI bot to run multiple background processes at once. Problems:
a. No control to pause/stop the background processes from Orchestrator
b. Difficult to manage which background processes are being run without editing the UI process
c. Potential security concern if built incorrectly - potential to execute code from Orchestrator
Using a UI bot to start a long background process and end the UI process while the background process continues to run, freeing up the UI runtime.
Yes, you can create a foreground process that logs into the user session and runs multiple background processes in parallel to bypass Session 0 limitations and execute processes as the actual user.
Running a foreground process that logs into a user session and executes background processes can raise security concerns. If the foreground process is not properly secured, it may allow unauthorized access to the user’s session. Additionally, the foreground process would need to interact with the user’s desktop, which may not always be desirable or secure.
Yes, it is theoretically possible to create a foreground process in UiPath that logs into the user session and runs multiple background processes in parallel. This would bypass the issues of Session 0 and allow the processes to run as the actual user.
To do this, you would need to create a foreground process that performs the following steps
Logs in to the user session using the Log On to Computer activity.
Starts the background processes using the Start Process activity.
Monitors the status of the background processes using the Get Process Status activity.
Kills the background processes if they fail using the Kill Process activity.
Logs out of the user session using the Log Off from Computer activity.
You can use the Loop activity to repeat steps 2-4 for each background process that you want to run.
Here is a diagram of a sample foreground process that logs into the user session and runs multiple background processes in parallel:
[Start]
Log On to Computer
Loop
Start Process
Get Process Status
If process failed
Kill Process
End If
End Loop
Log Off from Computer
[End]
You can also use the Invoke Process activity to start a background process from a foreground process. This can be useful if you need to pass parameters to the background process or if you need to capture the output of the background process.
Here is a diagram of a sample foreground process that uses the Invoke Process activity to start a background process:
[Start]
Log On to Computer
Invoke Process
Process name: BackgroundProcess.exe
Arguments: parameter1, parameter2
Capture output: Yes
End Invoke Process
Log Off from Computer
[End]
Once you have created your foreground process, you can deploy it to Orchestrator and run it as an unattended robot.
Well more than securely it’s about the performance of the bot which will be really good when this scenario is handled with unattended bot @matt.theisen