Interactive Session Management
When automating user interface, UiPath needs to run in an interactive Window Station. To learn about Windows sessions, stations and desktops, check out these Microsoft articles:
While Front Office Robots use the existing interactive session of the logged in user, in order for BackOffice Robots to run unattended, a Windows session is maintained by the UiPath robot service running in the (non interactive) Session 0. The service requires Windows credentials to open an interactive session and to monitor it, reopening it if somehow gets disconnected.
Interactive sessions can be started in two ways, according to loginToConsole flag from %ProgramData%\UiPath\UiPath.settings file on the robot machine:
- Using SasLib to connect to Windows Console session - the default interactive session of a Windows system that gets created when connecting to a computer directly. There is only one console session per system, no matter if Windows Server or Windows Workstation. This is the default UiPath connection method
- Using FreeRdp to create a virtual Remote Desktop session that UiPath manages internally. On a Windows Workstation there can be only one RDP session, but on a Windows Server there can be many sessions for different users or even for the same user. On Windows Server and for multiple robot accounts per machine, loginToConsole should be set to false becaue the console session cannot be shared simultaneously by more robots.
Here is a short guide of how robots can be started and how credentials are provided for each case:
|Run mode||Credentials source||How it works|
|UiPath Studio||N/A||Robot runs unmonitored. If session gets disconnected, an exception is raised in the workflow.|
|Orchestrator||Orchestrator asset||Service is invoked via SignalR, then it fetches credentials and project package from Orchestrator, then starts a monitored session and summons an executor robot.|
|ReST API||Post argument||Service is invoked via API, workflow path and credentials are passed in as arguments in JSON format.|
|Sys Tray||Credential Store*||Intermediate UiRobot instance passes the workflow path to the robot service who reads credentials from the store, starts and monitors an interactive session and sets the workflow in execution to a new UiRobot.|
*To record Windows credentials, click the UiPath sys tray, then gears icon, Store Credential. Username and password are saved in Credental Manager, Windows Credentials page, Generic Credentials section with UiPath:user= prefix.