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 / Unable to execute offi...
Power Automate
Unanswered

Unable to execute office script on excel workbook which is there in sharepoint server using the power automate cloud flows.

(0) ShareShare
ReportReport
Posted on by

Hi, 
I have an Excel workbook on the SharePoint server which contains two sheets named TFE and XBL on which I need to run office scripts for automation. So I have used the power automation flow to pick up the files from the SharePoint server using the list folder - SharePoint and run the script. After building the flow completely when I tested it, it was working as expected with a minimum amount of data in the Excel workbook and when the Excel workbook has more than 400 rows of data the power automate flow fails after 2 retires. I could not identify the issue because I did not get a proper error message in the logs. Could any kindly help me with this?

 

Attaching the error message for reference:

{
    "statusCode": 504,
    "headers": {
        "Cache-Control": "no-store, no-cache",
        "Pragma": "no-cache",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "x-ms-datasourceerror": "True",
        "x-ms-request-id": "d3bc3e99-8beb-42ef-9f7c-bac039bdc218",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "x-ms-apihub-obo": "false",
        "Date": "Tue, 02 Jan 2024 10:10:18 GMT",
        "Content-Length": "531",
        "Content-Type": "application/json",
        "Expires": "-1"
    },
    "body": {
        "error": {
            "code": 504,
            "source": "flow-apim-msmanaged-na-northcentralus-01.azure-apim.net",
            "clientRequestId": "d3bc3e99-8beb-42ef-9f7c-bac039bdc218",
            "message": "BadGateway",
            "innerError": {
                "status": 504,
                "message": "Request to Graph API has timed out.\r\nclientRequestId: d3bc3e99-8beb-42ef-9f7c-bac039bdc218",
                "error": {
                    "message": "Request to Graph API has timed out."
                },
                "source": "excelonline-ncus.azconn-ncus-001.p.azurewebsites.net"
            }
        }
    }
}

Thanks in advance.

Categories:
  • rzaneti Profile Picture
    4,489 Super User 2026 Season 1 on at

    Hi @manojkumarv ,

     

    How many time does the "Run script" action take? If it is taking more than 120 seconds, it is expected to fails with a timeout error (the same that you received), as it is a limitation from the Office Scripts connection with Power Automate.

    rzaneti_0-1704222718599.png

     

    Source: https://learn.microsoft.com/en-us/office/dev/scripts/testing/platform-limits 

     

    As an alternative, you can try to break your tasks in more than one script, ensuring that each one takes less than 120 seconds to run. 

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 
    https://www.linkedin.com/in/raphael-haus-zaneti/ 

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard