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 / Wait - Process, Servic...
Power Automate
Unanswered

Wait - Process, Service, Window to close?

(0) ShareShare
ReportReport
Posted on by 22

Hi

I run a Python script by the Action 'Run Application' and the script produces an excel file. The excel file can take seconds or minutes to complete depending on the amount of data the script has to compare. The time it takes for the sript to run changes daily.

The Flow would be more elegant if it continued immediately after the script finished/excel file was complete rather than using a Wait Action based on the longest period the script look to finish. I have tried Wait for Process to stop, Wait for service to stop and Wait for window to close but none appear to work. Perhaps I'm using a incorrect title, handle or UI element

Can anyone help?

GJH_0-1666313022065.png

 

      

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Are you saying even the "Wait for file" is not working as expected?

  • garthh Profile Picture
    138 on at
    VJR, the script opens the spreadsheet and continues to write to it so the Wait for file doesn’t wait for the script to complete as the file is there. The need is to stop the Flow moving to the next step. At present the file/spreadsheet only has some of the data because the Flow has moved to the next Action. When running the script outside the Flow all works properly
     
    Garth
  • Jamar_Forsythe Profile Picture
    Microsoft Employee on at

    PAD has actions to run Python, have you tried that?
    You can read the script from a get file details and use that variable or you can paste the code directly into PAD Python action.
    Scripting - Power Automate | Microsoft Learn

  • garthh Profile Picture
    138 on at

    Jamar, thank you 

    Perhaps beyond my level at present but will look

  • VJR Profile Picture
    7,635 on at

    @garthh 

    Here is one option..

    Have the script write some comment to a text file after the script is completed....something like 

    <PROCESS COMPLETED>. You might also want to add the datetimestamp depending on the frequency of you process.

     

    Then after "Run Application" have PAD actions to check whether this text is present or not in that file. This should be in a loop checking after every few seconds (eg; 30).

     

    At the beginning have the script write <PROCESS STARTED> so that the next time will be taken care of.

     

     

     

  • garthh Profile Picture
    138 on at

    VJY, thank you - I’ll try

  • garthh Profile Picture
    138 on at

    VJR, the script was written by the developers so I prefer not to edit it. The script opens a window when it’s running and I tried the ‘Wait for window to close’ again and it appears to work. More testing with different size files needed to confirm. Thanks again

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 261 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 185

#3
Haque Profile Picture

Haque 168

Last 30 days Overall leaderboard