web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / VDI unattended issue -...
Power Automate
Unanswered

VDI unattended issue - Timeout when unattended, error when attended

(0) ShareShare
ReportReport
Posted on by 6

Hello,

I am working on a flow that I want to run on a VDI and I am experiencing a couple of related issues. I want the flow to run if a user is signed in or signed out to the machine. When I am signed out of the VDI, the unattended flow does not throw the error message for "User session present on the machine" or the other expected errors but will timeout after the set time (Set to 15 minutes). The error message the attended attempt throws when the unattended run fails (user is still signed out) is "No unlocked user sessions found on the target machine".

When the VDI restarts, it automatically signs in but the attended run fails because the session is locked. 

 

The machine in Power Automate cloud is set to reuse sessions. The VDI is setup to be persistent so any help to get the unattended flow to run would be greatly appreciated. Thank you.

image.png
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I am not sure why you set a timeout on the unattended run to 15 minutes. If it runs fine, you should just let it run to the end. The unattended runs use a service account to run the flows and it's not the same as the user account that you would use for attended runs. Also, when the unattended run terminates due to a timeout, the session will still be closed, so, if it successfully started (indicating the user is not logged in at the time), the attended flow will still fail.

     

    I would suggest putting your flows into Scope blocks, as that allows better handling. At this point you're just handing the error on the Set variable action. But the Set variable action will not even run if the first desktop flow fails. If you put it into a Scope, you can make the next action run on any error inside the scope. See this article for using scopes to handle errors in PA: https://dev.to/wyattdave/exception-handling-in-power-automate-4c4h

     

    I think what you need is simply to run the unattended flow without the timeout and only run it in attended mode if unattended mode fails (indicating there is a user session active), if you really need it to be able to run both when a session is active AND when it's not.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • TreeCutterDev Profile Picture
    6 on at

    Thank you for your reply,
    For a little more context, the reason there is a timeout for unattended was that the desktop flow only takes about 5 minutes to execute unless it fails to deploy. The unattended flow does not deploy at all to the VDI but does not error out unless I set the timeout. The attended flow only runs if the set variable action preceeding it is skipped. The set variable determines the message body of an email in a later step. This initial flow was mostly a proof of concept to troubleshoot why the VDI was not running unattended. Periodically, the vdi would throw an error saying too many sessions are present even though the machine in Power Automate Cloud is setup to reuse sessions. 

    What settings do I need to set on the VDI or permissions to set on the service account to allow the VDI to run unattended flows?

     

  • TreeCutterDev Profile Picture
    6 on at

    Does the service account have the capability to turn on/wake a non-persistant VDI?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard