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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow fails in unattend...
Power Automate
Answered

Flow fails in unattended flow

(0) ShareShare
ReportReport
Posted on by 81

My flow runs perfectly in attended mode but fails in unattended mode depending on how many actions I have added.

The flow will work in unattended mode but will fail on the second action if I surpass a certain number of actions within the flow.

SphesihleSibiya_0-1693400243921.png

This is the screenshot of my flow. It will run properly in this state but will fail at the second action if i enable the rest of the actions.

 

This is the error I get (on the second action of the flow) :
"

Failed to run flow

Problem while executing action 'Click'. Double click failed (error while clicking)

Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Double click failed (error while clicking) ---> System.Exception: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
at WindowsInput.WindowsInputMessageDispatcher.DispatchInput(INPUT[] inputs)
at WindowsInput.MouseSimulator.MoveMouseToPositionOnVirtualDesktop(Double absoluteX, Double absoluteY)
at Microsoft.Flow.RPA.Desktop.UIAutomation.DesktopCore.InputSimulator.MouseSimulatorProxyBase.MoveMouseToPosition(Point point)
at Microsoft.Flow.RPA.Desktop.UIAutomation.Plugin.UI.UISpecialElements.UIRoot.ClickOnDesktopIcons(String selector, MouseClickTypeEnum clickType)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.AutomationRuntimes.UIAutomationRuntimeBase.UseDesktop(String selector, Int32 clickType, Boolean leftClickOnQuickLaunchBarShouldCreateNewApp, UIATypeEnum UIAType, RectangleEdgePointEnum rectangleEdgePoint, Int32 offsetX, Int32 offsetY)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.UseDesktop(UIRuntimeElement element, Int32 clickType, Boolean leftClickOnQuickLaunchBarShouldCreateNewApp, RectangleEdgePointEnum rectangleEdgePoint, Int32 offsetX, Int32 offsetY)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.ClickElementInWindow(UIRuntimeElement element, Int32 offsetX, Int32 offsetY, Int32 clickType, Int32 elementRectangleSubsector)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.UIAutomationRuntimeRouter.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
--- End of remote exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RemoteAutomationRuntimeProxy.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.<Execute>b__21_0(IAutomationRuntime r, UIRuntimeElement e)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformAutomation(Action`2 action, UIControl control, Boolean logAction)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

"


 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    It's not the Run flow action that fails, but a Click a UI element in Window action that fails in the flow that you're running. Why exactly are you calling child flows from within an existing desktop flow? You could call them one by one from your cloud flow. That would work better in unattended mode.

    -------------------------------------------------------------------------
    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.

  • SphesihleSibiya Profile Picture
    81 on at

    Hi Agnius,

     

    My first idea was to call all the flows individually but this doesn't work well when you have more than one instance of the cloud flow running. The desktop flows have to run in a specific sequence. In my case, if cloud flow 1 and 2 run simultaneously, cloud flow 1 will run a desktop flow and cloud flow 2 will put a desktop flow in the queue before the rest of the desktop flows in cloud flow 1 are run. This will then mess with the sequence which the desktop flows need to run in on my virtual machine

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Okay, I know what you mean. I have a client where we built a custom queue management solution based on SQL server for this exact purpose. It's quite easy to implement, now that we've got a template for it, but it's quite a feat to build it from scratch, so I won't really go about explaining how to do it.

     

    You could, however, use the Work Queues functionality, where you can set priorities to your flows in appropriate order and then update them, making the furthest desktop flow in your sequence always have the highest priority to run. This could work in your case.

     

    The way I see it is that your child flows fail because of UI based issues. I'm not 100% certain about whether it is related to the fact you call child desktop flows from a single parent desktop flow, but I assume it is. But you might also want to implement a Take screenshot action on error when running unattended flows. This is very useful in debugging flows. It might also be related to the different screen resolution that the flow is run in unattended. Your app window might look different when it runs unattended. See this article for a reference on that: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/set-screen-resolution-unattended-mode

    -------------------------------------------------------------------------
    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.

  • Verified answer
    SphesihleSibiya Profile Picture
    81 on at

    @AgniusI found and fixed the issue.

     

    The problem was that my flow takes a long time to parse before executing the actions. This was causing the virtual machine to sleep due to the emulated user being idle. The sleep timer in my organization is set to 5 minutes.

     

    I was able to get around this issue by creating a cmd script to keep my machine from locking itself.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard