Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Timeout Errors on Excel Run Script Actions

Like (0) ShareShare
ReportReport
Posted on 31 May 2023 12:01:44 by

Hello, I've been trying to use a flow that downloads 3 excel files from my email to a SharePoint, extracts a range of data from them and places it in another workbook in the SharePoint. The data is parsed from a JSON string and then written in batches to the workbook. The issue is writing from one file to the workbook works consistently while the other gives a Bad Gateway 504 time out, despite the first file containing much more data than the latter. It has worked previously. Any Ideas? 

Ace_of_spades_0-1685534350815.png

 

  • Baudelaire Profile Picture
    106 on 21 May 2025 at 16:20:16
    Timeout Errors on Excel Run Script Actions
    This is a silly limitation for an enterprise-grade platform.  I have 700 rows in an Excel file just today that failed because of this limitation.  That's peanuts in the world of finance.  A retry action screws the whole process up in my case - it can't just start back at the beginning because I am creating a table, deleting rows based on conditions, etc.  It doesn't pick up where it left off, it starts over with the same file in memory and fails because of overlapping tables.  My users are having to manually break their files into smaller versions and then manually re-assemble them all.   It's times like this that I want to scrap Power Automate and write C# code to do the work.  Power Automate often feels like a small department tool, not an enterprise ready platform.
  • Community Power Platform Member Profile Picture
    on 05 Dec 2023 at 08:50:08
    Re: Timeout Errors on Excel Run Script Actions

    image.pngimage.png

     

    My workaround solution to this is create a table to loop through batches (with firstrow & lastrow) specify. 
    I think Excel Online has a limit of 5000 rows per Power Automate action. 
    So I set to 3000 per batch. 
    You can also automate the processing of creating this batch table by calculating last row of sourcesheet => divide by 3000 

  • SLMalling Profile Picture
    7 on 06 Oct 2023 at 09:26:36
    Re: Timeout Errors on Excel Run Script Actions

    Rzaneti's reply should be marked as the answer

    I was getting a BadGateway in the Error Details

    On the Run script action where was a GatewayTimeout 

    This was caused by a lot of lines that had suddenly been added to the excel file

    The action usually took around a minute to run, but going from 300 to 500 rows in the excel file made it go beyond 120 seconds.

    Optimizing and splitting up the actions is the thing needed to for this error.

  • rzaneti Profile Picture
    4,073 Super User 2025 Season 1 on 31 May 2023 at 17:26:42
    Re: Timeout Errors on Excel Run Script Actions

    Hi @Anonymous ,

     

    I had this problem in the past. Actually, Power Automate has a limit for the "Run Script" action: your script cannot take more than 120 seconds to run. The alternative here is to break the script in smaller tasks or try to optimize your code to reduce the time for run it. 

    rzaneti_0-1685553975033.png

     

    You can check the docs. here: https://learn.microsoft.com/en-us/office/dev/scripts/testing/platform-limits

     

    Good luck with your flow and do not hesitate in reaching me if you need any additional help!

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Using Flows

#1
stampcoin Profile Picture

stampcoin 26

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 24 Super User 2025 Season 1

#3
RP-25090907-0 Profile Picture

RP-25090907-0 23

Overall leaderboard

Featured topics

Restore a deleted flow
Loading started