cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sumeth_002
Regular Visitor

UI flows unattended issue

Annotation 2020-07-06 112743.png

hi guys , 
 i  am having the problem as you guys above picture , i cant access the unattended flow and error message show ( " There is a user session on the target machine. Cannot execute unattended UI Flow")  . but i tested that flow in attend mode its run successfully for me . 
thank you . 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Sumeth_002,

 

When you create UI flows, you run them either in attended or unattended mode. Unattended is best for applications that do not need human supervision.

When running unattended, UI flows automatically signs into the target devices that run Windows 10, Windows Server 2016, or Windows Server 2019. Once the automation completes, UI flows signs out from the device and reports its activity in Power Automate.

When running attended, UI flows will use an existing Windows user session.

When you add a UI flow to a flow, you can choose whether you want your UI flow to run attended or unattended. Here are some key differences between attended and unattended runs:

https://docs.microsoft.com/en-us/power-automate/ui-flows/run-ui-flow#unattended-mode

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

30 REPLIES 30
v-litu-msft
Community Support
Community Support

Hi @Sumeth_002,

 

When you create UI flows, you run them either in attended or unattended mode. Unattended is best for applications that do not need human supervision.

When running unattended, UI flows automatically signs into the target devices that run Windows 10, Windows Server 2016, or Windows Server 2019. Once the automation completes, UI flows signs out from the device and reports its activity in Power Automate.

When running attended, UI flows will use an existing Windows user session.

When you add a UI flow to a flow, you can choose whether you want your UI flow to run attended or unattended. Here are some key differences between attended and unattended runs:

https://docs.microsoft.com/en-us/power-automate/ui-flows/run-ui-flow#unattended-mode

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HEATFreight
Super User
Super User

Thanks for the TOTAL NON-SOLUTION 👍🤦‍😵

Gauravmahajan
Frequent Visitor

I know this is an old thread but wanted to add some clarity to the answer. Essentially these from the referenced link answer the question:

"To run unattended UI flows, the target machine needs to be available with all users signed out."

and 

"Locked Windows user sessions will prevent UI flows from running."

This guidance from Microsoft also helps troubleshoot other issues related to running unattended flows:

https://docs.microsoft.com/en-us/office/client-developer/integration/considerations-unattended-autom...

Thanks!

Thanks for the info.  I cannot afford to purchase unattended premium license.  If attended can run while a destination desktop is running with unlocked user session, can we not change the desktop setting to not close any user session?  I've been googling to find a way to keep a user session in Windows 10 going indefinitely (not log off, not sleep?) but cannot find any good one.  

dewrimburak
Helper I
Helper I

Error   ''There is a user session on the target machine. Cannot execute unattended desktop flow.''

 

Please someone answer this question nicely. Add a screenshot of what we need to do. why this error.

 

The support team is not very interested. 

@dewrimburak You are trying to use an "unattended" RPA plan to run a flow while some user account is logged in on that machine.

You can't do that. Unattended flows require that no user is logged in on the machine running the flow.

You can use "attended" RPA plan to run flows while logged in. Or you can use unattended RPA plan to run flows while no user is logged in.

When I say logged in, I'm referring to your operating system, not the Power Automate app. All user accounts in your operating system (presumably Windows 10 or Windows 11) must be logged out for your unattended RPA plan to work.

@dewrimburak Thought I did but I'll reword:

 

To run a flow in unattended mode, all users should be signed out from the Windows machine that is running the unattended flow. Even locked sessions (where the user has signed in and just locked the machine) will prevent the flow from running. They will need to completely sign out of that machine for an unattended flow to run. 

 

I don't believe I can provide a screenshot for this but hope this write up helps 🙂

Thanks!

@t5p  Yes - basically what you are talking about is an attended session. 

Yes, there are ways in which you can keep the desktop session alive but it depends a lot on the policies that the machine admin may have defined. I am not an experrt in that area but I've done that in the past through the Windows Power Options (assuming you are using a Windows machine). Here's a thread that explains how to do it through the Power options: https://answers.microsoft.com/en-us/windows/forum/all/power-options-set-power-options-to-never-turn-...

As mentioned in the thread, it may not always work though. 

 

Also, your admins can usually sign you up for a 90 day trial of unattended RPA: https://powerautomate.microsoft.com/en-us/blog/use-power-automate-self-assisted-premium-trials-to-ru...

actually i want to do it in virtual machine. there is no logout option for this. 

HEATFreight
Super User
Super User

Are you remoting into the VM? What hypervisor? You need to provide more details to get help.

You can run "attended" desktop flows in a VM if you are logged in. 

dewrimburak
Helper I
Helper I

I'm connecting to the virtual machine remotely. and I want to use it unattended.

HEATFreight
Super User
Super User

I have never done this before but I know it does not work if you are logging into the VM.

You have to launch the VM so that it's running with no user account logged in. The error is happening because you are connecting to the VM, so stop doing that and run the "unattended" flow.

I want to run the process in the virtual machine, but it doesn't work. The process did not run even though I turned off the virtual machine. and the support team is not responding about it. I need to do this for sure

HEATFreight
Super User
Super User

The virtual machine should be turned on and running.

You can not be logged in.

I don't know of a simpler way to say it. Read the documentation.

Try pressing ⊞Win+L in your VM before you run the flow. You just need the VM to be "locked".

@HEATFreight  Actually - that will not work. he needs to be logged out. Win+L will just lock the machine but he will still be signed in

 

@dewrimburak Unattended works on a VM as well. If the VM is shared by others, you will need to make sure that the VM is turned on but you and any other are completely signed out of the VM using the method described here: https://support.microsoft.com/en-us/windows/sign-out-of-windows-346925bb-024c-cd86-7a53-9066242a9ed3....

I will also recommend testing your flow in attended mode on that VM first to ensure your cloud flow is able to connect to the desktop flow. 

Thanks!

@Gauravmahajan What does this mean?

HEATFreight_0-1642605506566.png


A quick google search says: "The difference between "locking" (Lock Workstation) and "logging out/signing out" (Logout) is what happens to your applications. Locking the computer means your apps are still ON and running. Logging/signing off will CLOSE all applications before signing out of the session."

So what does the unattended desktop flow documentation mean by "locked"?

@HEATFreight You are right - that is confusing. I can say based on close to an year of working with unattended flows that the bullet is 100% incorrect. Like the bullet before it says, all users must be completely signed out. They confirm that in the write-up above those bullets too: "an unattended desktop flow can't run if active Microsoft Windows user sessions are present, even a locked one"

When Power automate is installed, it creates a couple of windows services:

Gauravmahajan_0-1642612971213.png

 

These services are responsible for launching the flows in unattended mode. Signing out of a machine does close the applications but not the background services which launch the PAD process in unattended mode 🙂

How is this a solution? You basically just copy-pasted the docs on attended vs unattended flows and that's it.

 

A year and a half later this issue is still ocurring for an unattended flow even though no users are logged into the machine. Can somebody provide an actual solution?

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,382)