Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Document Conversion using one drive. 502 BadGateway

(1) ShareShare
ReportReport
Posted on by 6
Hi all,

I'm building a flow to transform a word document (DOCX) into a PDF. The only problem that I run into is that larger files (not even that large maybe 2-3MB) are failing, and they're always failing at the 28-29 second mark with a 502 Bad Gateway response with no details of why. I thought that maybe the problem has to do with the file being a little on the larger side, so my intuition led me to believe that maybe the flow is just timing out. To mitigate this issue I opened the settings of the action and discovered a "Timeout" property. I tried increasing it to 1 minute and 30 seconds, and it still continues to fail at the 28-29 second mark with the same error message:

 
  "error": {
    "code"502,
    "source""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "clientRequestId""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "message""BadGateway",
    "innerError": {
      "status"502,
      "message""Error from Office Service. Url=https://wordcs.osi.office365.com/document/export/pdf HttpCode=InternalServerError",
      "source""api.connectorg.svc.ms"
    }
  }
}

I'm curious if anyone else had a similar issue and if they were able to come up with a solution. Thank you!
  • Suggested answer
    Michael E. Gernaey Profile Picture
    38,541 Super User 2025 Season 1 on at
    Document Conversion using one drive. 502 BadGateway
     
    I do in fact believe your file is too large and complex. I realize per se its not "big" but this is an error where the server side is not able to process the document fully, errors out, then returns this gateway error, the real error is on the other side, that we cannot see.
     
    If you take the file and just randomly (as a test) take half of it out, then try again I bet it works. The other option is that something IN the document is too complex and causes an exception on the other side.
     
    its hard to know 1000% which is which without doing some trial and error on the document itself.
     
    Are you able to do that?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,692 Most Valuable Professional

Leaderboard