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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Timeout Errors on Exce...
Power Automate
Unanswered

Timeout Errors on Excel Run Script Actions

(0) ShareShare
ReportReport
Posted on 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

 

Categories:
I have the same question (0)
  • rzaneti Profile Picture
    4,249 Super User 2025 Season 2 on at

    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!

  • SLMalling Profile Picture
    7 on at

    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.

  • Community Power Platform Member Profile Picture
    on at

    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 

  • Baudelaire Profile Picture
    110 on at
    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard