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

Community site session details

Session Id : h8YHh/+fNsaHe9MN6nVcMj
Power Automate - Power Automate Desktop
Unanswered

Wait for a time when computer hibernate hangs the workflow

Like (0) ShareShare
ReportReport
Posted on 23 Jun 2021 22:24:54 by

Hi, 

 

I don't usually post because my problems found solutions other posted. So I faced this problem and I couldn't find a ready made solution. After a day of work found a solution and decided to contribute. 

Problem:

I have a power automate desktop workflow that need to run continuously to regular intervals with a wait time between processes. Using trigger with an external workflow is not an option. The workflow works on a personal notebook, so i must be able to sleep/hibernate my notebook and the workflow should continue to run gracefully.

 

Solutions tried and failed:

- using native pad 'Wait an interval'. When the computer hibernate the workflow hangs and stop working and the only way to regain control of the workflow is kill every process of PAD.

- using a wait inside powershell script launched from PAD. It has the same problem than the first method. 

- using a powershell script to set an endtime and compare if current Time is greater than endtime. The problem is the same. I don't know if it has to be that i needed to add a wait-event with timeout 0, to avoid trigger processor consumption in the loop, but at the end, when the computer hibernates the workflows hangs.

All of the above solutions worked fine as long as i don't hibernate my notebook, but failed when i do.

 

Solution

Execute a powershell script from the pad to:

- Suscribe to power management events

- wait for events with timeout equal to desired interval between executions.

 

 

 

 

Register-WmiEvent -Class win32_PowerManagementEvent -SourceIdentifier power
Wait-event -Timeout %ValorIntervalo%

 

 

 

 

In this way the script ends following two conditions: 

- When timeout occurrs

- When a power event happens.

These seems to work fine and avoid the workflow hanged problem. Side effect: It will execute the workflow everytime I dehibernate my computer. That is not a problem for me.

 

May be my problem is too particular (and hence I didn't find a ready made solution). I hope it is useful to someone, anyway.

 

Best regards,

 

Edgardo

I have the same question (0)
  • aminab-msft Profile Picture
    Microsoft Employee on 24 Jun 2021 at 13:38:04
    Re: Wait for a time when computer hibernate hangs the workflow

    thank you so much @EdgardoMenta  for enabling the community with your experience. 

     

    Happy Automation,

    Amina

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete