Skip to main content

Notifications

Community site session details

Community site session details

Session Id : VtXiMcwyWC93iAt7kFir02
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

 

  • 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
    3,948 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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow
Loading started