Re: Power Automate Desktop won't run correctly when not active
The way RDP works is that whenever you close the session (even if you do not sign out), the screen on the machine turns black. This is because RDP uses the hardware of the agent machine (the one you login from) for generating the screen view. As such, attended flows will hang/fail if any user interface interaction is needed, as the user interface will simply not be visible.
As suggested by others, in order for this to work, you need to use the Process license in unattended mode.
Alternatively, you could use the Premium license, but need to make sure to login to the machine via a different remote access software, such as TeamViewer or AnyDesk. This will force the target machine (the VM) to use its own hardware to initialize the session, and as such, the session will not turn black as soon as you close it.
However, for attended mode to work on the VM, you still need to make sure an active user session is on it when the flow runs, and the machine is not locked. You either need to sign in before starting the flow, and then close the remote session, or need to keep the machine signed in at all times, and make changes to the registry to prevent it from sleeping and locking.
Please note that using the Premium license for unattended automation is against the terms of use for Power Automate. If you want to build an unattended RPA solution, you need to use the Process license.