cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tawfik_Chelli
New Member

How to run a desktop flow from windows task scheduler

 

My Objective is to run the flow once when pc starts between 8 am till 10 am each day using the windows task scheduler.

flow.PNG

 

16 REPLIES 16
miketran13
Solution Specialist
Solution Specialist

Hello,

 

Unfortunately, there is no way for you to do that and I don't think Microsoft will support this in the future. Because you have to use Power Automate on Cloud as the orchestrator for triggering manually or schedule it from there. You can't do that from a task scheduler. 

 

Thanks and hope it can help you. 

Mike

---------------------------------

Did I answer your question? Please consider to Mark my post as a solution! to guide others

maciejewski
New Member

HI

Without offline scheduler/executor PAD is not usable for now.

 

miketran13
Solution Specialist
Solution Specialist

Hi,

 

Why don't you use Schedule Flows to run your Desktop flows ?

 

scheduleflows.png

 

Thanks and hope it can help you. 

Mike

---------------------------------

Did I answer your question? Please consider to Mark my post as a solution! to guide others

thanks for suggestion but we need it to can run offline - like in WinAutomation 

DamoBird365
Community Champion
Community Champion

HI @maciejewski ,

 

I've been looking into this too.  Unfortunately this is not possible at the moment and it is unclear if it ever will be.  When you run the PAD from your PC, it calls an instance to run from the Cloud.

 

The following command is called:

"C:\Program Files (x86)\Power Automate Desktop\PAD.Runtime.Robot.exe" --path "C:\Users\[**UserName**]\AppData\Local\Microsoft\Power Automate Desktop\Console\Workspace\829e4538-9631-4e12-a2c4-187299a15ae7\package" --instanceId 4ec585ad1a69462a9818e4648f32ca13 --varPreviewChars 128 --varPreviewLines 5

 

This includes the GUID for your PAD and an instanceId.  Whilst the GUID for your PAD matches with that of the cloud, I couldn't establish how the InstanceId was obtained which must be some sort of authentication to run the flow.

 

It's quite interesting because you can see all of your solutions here:

C:\Users\[**UserName**]\AppData\Local\Microsoft\Power Automate Desktop\Console\Workspace\

 

For now at least - it is not possible.

 

Damien

DamoBird365
Community Champion
Community Champion

Hi @Tawfik_Chelli , @maciejewski , @miketran13 

 

I've posted the idea here.

thanks for information Damien 

 

error in link:

The page you are trying to access was not found. Please check your URL for typos and try again.

 

for now we stick with WinAutomation

@maciejewski - sorted cheers.

This doesn't work for personal accounts.

pcand1001
Helper I
Helper I

Try API commands

fraenK
Memorable Member
Memorable Member

@DamoBird365 The "instanceId" should be the "flowsessionId" which represents the run (instance) of a flow, which you can see in the run history of a desktop flow: https://docs.microsoft.com/en-US/powerapps/developer/data-platform/reference/entities/flowsession#BK...

pcand1001
Helper I
Helper I

OK, Here is how I did it. Way too complex, requires premium but it does work. Now I can add PAD Flows to my enterprise scheduler workflows or Powershell or any other automation tool. i.e. run on schedule, run in a loop and so on.
1) Install a gateway to your machine
2) Create a flow to receive the API call and run the desktop flow
3) Copy paste the URL where you need it, in my example, I use Postman.
Copy screen, Flow, Postman.

Spoiler
PAD API Call.pngPAD Flow.png


 

I don't see a way to Schedule Flows to run Desktop flows.  Do I have to recreate a flow using Cloud Flow?  I followed https://docs.microsoft.com/en-us/power-automate/desktop-flows/run-pad-flow and have the gateway and connections configured (I think).  

 

Thank you!!!!

t5p_0-1618348989426.png

t5p_1-1618349031695.png

 

When I tried to run a PAD from power automate.  It stated I needed a Premium account

fraenK
Memorable Member
Memorable Member

You'll need at least:

"Per-user plan with attended RPA"

https://flow.microsoft.com/en-us/pricing/

 

Maybe also "Unattended RPA add-on" if you want to run the flow without a user present.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (66,196)