My assumption is that this will be resolved in the future, but for the time being, when using a Hosted Machine for Power Automate Desktop, you must create a local account if you want to run flows unattended. However, hosted machines don't (currently) allow you to log into a local account, as they are linked with your Office365 account.
Assuming you have already created a hosted machine, step one is to create the local account you'd like to use when running desktop flows. To do this, connect to your hosted machine in your browser.
Then, in the taskbar search box, type 'Other users' and select the System settings link.
Next, click Add account
When prompted for an email to sign in, click I don't have this person's sign-in information.
Then select Add a user without a Microsoft account.
Then you can fill out the new local account information. Make sure to store this username and password in a secure password vault, as you'll need it in Power Automate.
You now have a local account, but we're still not done yet! Let's also make a note of the machine's name. Click on the System navigation button on the left pane.
The system name I will use for this example is SMPL-eric-ABC123. This means that the domain-qualified username of my local account (which I named flowbot) is SMPL-eric-ABC123\flowbot. This is the username you will use to pass credentials into your Power Automate Desktop connection when you create it in Power Automate.
Next, add the new local user account to the Remote Desktop Users group to permit it to remote into the machine unattended.
Click Start and search for Computer Management
Then add the local user account to the Remote Desktop Users group.
Click Add... then enter the local user account name, click Check Names then click OK.
Almost there! Now comes the tricky part. We now have to create a Power Automate Desktop flow that will navigate the local user account through the EULA and setup prompts the first time it logs in. To do this, we will open the preinstalled Power Automate Desktop executable on the Hosted Machine desktop.
Create a new flow.
Give it a name.
And now we will simulate keystrokes to navigate the initial login setup. Under Mouse and keyboard select Send keys.
Then send {Tab}{Tab}{Tab}{Tab}{Return}.
If you're confused about what we're doing, we are essentially skipping through user setup and EULA screens that will appear for your local user the first time they log in (like the one below). It's hard to visualize this as we cannot see the process, but if it helps you can add screenshot steps during the flow and save them to the Public Images folder.
Next, under Flow control, we will add a 3-second Wait.
Lastly, we will add a single Return keystroke, similar to the first flow step. You should be left with a flow like this:
Now, Save the desktop flow and navigate to Power Automate. Make sure you are in the same environment in which you created the Hosted Machine. Create a manually-triggered cloud flow.
Select an action to Run a flow built with Power Automate for desktop.
Select Connect with a username and password.
Select your Hosted Machine.
Then enter your local account's domain-qualified username and the password.
If you run into issues here, double-check your username and password, make sure you used the correct slash ( \ ) in the username, and double-check the system name of the Hosted Machine.
Next, select the flow we just created.
And select Unattended.
Name, save, and run this cloud flow. After the cloud flow runs successfully you should have a fully-operational local account to run unattended desktop flows!
If you run into issues not covered in this post, comment below for help!