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

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

502 bad gateway when trying to execute an excel script

(0) ShareShare
ReportReport
Posted on by

Hi, I am getting a 502 bad gateway error when trying to execute a script. Tried both the Excel Run Script action as well as the Sharepoint Run Script one, same result. Here is the error:

The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScriptV2' failed with status code 'BadGateway'. Error response: { "error": { "code": 502, "source": "europe-002.azure-apim.net", "clientRequestId": "c4db4595-ddc9-4b2b-a7ac-aacdb4478beb", "message": "BadGateway", "innerError": { "status": 502, "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments. clientRequestId: c4db4595-ddc9-4b2b-a7ac-aacdb4478beb", "error": { "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments." }, "source": "excelonline-we.azconn-we-003.p.azurewebsites.net" } } }

I have the same question (1)
  • alaarej Profile Picture
    7 on at
    502 bad gateway when trying to execute an excel script
    Hi,
     
    As of today we started experiecncing this issue. This is the error we get on power automate : The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'BadGateway'. Error response: { "error": { "code": 502, "source": "canada-001.azure-apim.net", "clientRequestId": "aa7f116b-7bbc-4d5d-aac9-1761b6787213", "message": "BadGateway", "innerError": { "status": 502, "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments. clientRequestId: aa7f116b-7bbc-4d5d-aac9-1761b6787213", "error": { "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments." }, "source": "excelonline-cc.azconn-cc-001.p.azurewebsites.net" } } }.In addition to that trying to even create a new Excel Script both in Desktop and Browser app is impossible. And even trying to open any of the saved ost files local or on one drive gives the same error.
     
    Anyone else experiencing the same problem again ?
  • NiteWalker Profile Picture
    71 on at
    502 bad gateway when trying to execute an excel script
    Any solutions to this? Having same issue. Started around yesterday around noon timeframe...
     
    Thanks,
     
    Monty
  • Ablaye Profile Picture
    2 on at
    Re: 502 bad gateway when trying to execute an excel script

    Hi GeoffRen,

    Can you help me.

    I have this issue if i register an Excel run script flow :

    The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'BadGateway'. Error response: { "error": { "code": 502, "source": "france-001.azure-apim.net", "clientRequestId": "2c0e5648-139e-4407-a40d-ba7d906aab14", "message": "BadGateway", "innerError": { "status": 502, "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments. clientRequestId: 2c0e5648-139e-4407-a40d-ba7d906aab14", "error": { "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments." }, "source": "excelonline-fs.azconn-fs-001.p.azurewebsites.net" } } }.

    Thanks

  • scott_od Profile Picture
    6 on at
    Re: 502 bad gateway when trying to execute an excel script

    @GeoffRen I am also having repeated failures with trying to run my excel script from power automate, I can run it directly in excel without any issues:

    {
      "error": {
        "code"502,
        "source""flow-apim-europe-001-northeurope-01.azure-apim.net",
        "clientRequestId""d1dded62-ea25-4e9c-9ed9-9ed985b924b4",
        "message""BadGateway",
        "innerError": {
          "message""We were unable to run the script. Please try again.\nThe script couldn't create a connection with Excel. Please try again.\r\nclientRequestId: d1dded62-ea25-4e9c-9ed9-9ed985b924b4",
          "logs": []
        }
  • GeoffRen Profile Picture
    Microsoft Employee on at
    Re: 502 bad gateway when trying to execute an excel script

    It seems that your script is timing out. It's difficult to say exactly why without knowing what your script looks like and what the workbook it is running on looks like. For assistance, I'd recommend making a new post with a full repro containing a copy of your script and the workbook it is running on for more help from the wider community as well (you can tag me there too).

  • GeoffRen Profile Picture
    Microsoft Employee on at
    Re: 502 bad gateway when trying to execute an excel script

    We do not have a certificate issue or know of an outage currently. It seems that your issue is that your script file was corrupted somehow. The .osts file corresponding to your script does not seem to be valid JSON. You can try to fix that file manually, or just create a new identical script and that should fix your issue.

  • Sumit-Sandhir Profile Picture
    2 on at
    Re: 502 bad gateway when trying to execute an excel script

    @GeoffRen  I am getting the same issue as well. Looks like again there is a certificate issue on Microsoft end. Here is the error message i am getting
    The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScriptV2' failed with status code 'BadGateway'. Error response: { "error": { "code": 502, "source": "uk-001.azure-apim.net", "clientRequestId": "1891f008-1e0a-4915-a79c-ab4a5228f80d", "message": "BadGateway", "innerError": { "status": 502, "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments.\r\nclientRequestId: 1891f008-1e0a-4915-a79c-ab4a5228f80d", "error": { "message": "The server experienced an issue and couldn't complete the request. Please try again in a few moments." }, "source": "excelonline-ukw.azconn-ukw-001.p.azurewebsites.net" } } }

  • akamerer Profile Picture
    4 on at
    Re: 502 bad gateway when trying to execute an excel script

    @GeoffRen I am getting the same issue for several of my flows. Here is one of the errors:

    {
      "error": {
        "code"504,
        "source""flow-apim-msmanaged-na-northcentralus-01.azure-apim.net",
        "clientRequestId""1992aed5-ab69-4242-b1ae-f501e55884a7",
        "message""BadGateway",
        "innerError": {
          "status"504,
          "message""Your Office Script has timed out. Please try again.\r\nclientRequestId: 1992aed5-ab69-4242-b1ae-f501e55884a7",
          "error": {
            "message""Your Office Script has timed out. Please try again."
          },
          "source""excelonline-eus2.azconn-eus2-003.p.azurewebsites.net"
        }
      }
    }
  • GeoffRen Profile Picture
    Microsoft Employee on at
    Re: 502 bad gateway when trying to execute an excel script

    It looks like you are having the same issue as above. Your script seems to be in an invalid state. We usually see this happen when the script file itself was modified manually. Can you recreate the script and try again?

  • GeoffRen Profile Picture
    Microsoft Employee on at
    Re: 502 bad gateway when trying to execute an excel script

    Your script seems to be in an invalid state. We usually see this happen when the script file itself was modified manually. Can you recreate the script and try 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2