The Populate a Microsoft Word template action gives you almost nothing to work with when it fails. You get a status code, sometimes one line of text, and a flow run that's gone red, with no explanation of why the template action isn't working. Underneath sits a file store, a rendering engine, a licensing model, and a conditional access policy, and a failure in any one of them produces roughly the same unhelpful result. Working out which system broke usually comes down to matching the symptom against a known cause.
The Bad Gateway failure
A 502 Bad Gateway is the error most people search for. Microsoft documents one clear cause for it. If the document takes longer than two minutes to convert, the request times out and the flow fails with a Bad Gateway. That two minute ceiling belongs to the underlying conversion service. Raising the flow's own timeout setting does nothing to fix it, because Power Automate has no control over that particular limit.
Practitioners report a second pattern behind the same error, unconfirmed by Microsoft. Handing a table with more than a hundred rows to the PDF conversion step, or a smaller table with thousands of rows across several columns, tends to push the run past that same two minute limit. Power Automate also rewrites some of the underlying connector's own 500 errors into a 502 Bad Gateway before showing you anything, which is reported by practitioners rather than documented by Microsoft, and it's part of why the message on screen tells you so little about what actually broke.
The fix that has held up in the community is blunt. Cut the table down. Break a long document into smaller sections, reduce the row count going into any table, and simplify the columns where possible. There's no official retry guidance for this specific timeout. The practical answer is keeping the document inside the two minute ceiling before conversion starts, since retrying the same oversized document produces the same result.
Failures caused by the template file
A lot of failures trace back to the .docx file itself, often before the flow even runs. Microsoft's connector documentation names exactly which content controls it supports: Plain Text, Combo Box, Drop-Down List, Image and Repeating Section, five types only. Rich Text controls aren't supported. Neither are Building Block Gallery, Date Picker, Check Box or legacy form controls, and a nested image control inside another control doesn't work even though a standalone Image control does. Build a template with an unsupported type and the action either can't read the schema or returns "The selected file doesn't contain template elements" when you try to pull in dynamic inputs.
Content control names have to be unique inside the template, and Microsoft documents this directly. Duplicate names cause mapping errors, and duplicate titles make both controls populate with the same value, which looks fine until someone notices two identical fields. Hyperlinks in the document body are a separate problem, reported by practitioners rather than documented by Microsoft. A hyperlink sitting in the running text can crash the parser outright and take template recognition down with it. Sensitivity settings on the document cause a related failure Microsoft hasn't documented either. Anything beyond the most open sensitivity setting can stop the action recognising the file as a template at all.
Where you build and edit the template matters too. The Developer tab lets you insert and configure content controls, and Word Online doesn't have it. Microsoft's documentation is explicit that templates have to be created in the Word desktop client, and creation on Word for Mac isn't supported either. That missing tab is also why editing a generated document in Word Online is discouraged, since managing a content control's binding properly requires it. One cause shows up constantly in forum threads but has never been confirmed by Microsoft. AutoCorrect can silently change a content control's title while you're typing it into the Properties dialog, so the saved title no longer matches what you typed, and the array key the flow sends no longer lines up with anything.
Storage, size and timeout limits
Where the template lives rules out a surprising number of setups. Microsoft's documentation is specific about this. The file has to sit in OneDrive for Business, a SharePoint Online site, or an Office 365 Group. SharePoint On-Premises isn't supported as a storage location, full stop. Dataverse doesn't appear on that supported list either, which trips up model-driven app builders who naturally want to keep documents there. A template stuck in Dataverse has to move to OneDrive or SharePoint Online first. A related failure, reported by administrators rather than documented by Microsoft, comes from mismatched accounts. If the template sits in the OneDrive of a service account but the flow runs under a different signed-in user without access to it, the action returns "File Not Found" even though the document is exactly where it should be.
Size is the other gate. Microsoft publishes documented limits for the Populate a Microsoft Word template action, and the input template can't exceed 10MB. Going over it returns the message "The input size is too large. Please make sure the size is less than 10MB", which fires before the flow does any real work. The two minute conversion window is a different kind of limit, checked only once Word starts actually rendering the document, which is why a file that clears the size check can still fail during conversion.
Failures caused by the data you pass in
Repeating sections cause more failures than any other single feature, and the rules around them are strict. Microsoft's documentation is direct about this. A repeating section has to be bound to an array of objects, and the keys in each object must match the nested content control titles exactly. The action fails outright if you send anything other than an array of objects, such as a single object, a string, or a plain number. Each nested control also needs its own unique title, or Word assigns a random one that won't match anything the flow sends. The mechanics of getting this binding right are explained in a full piece on repeating and conditional Word template problems, since they're common enough to need their own space.
Nulls behave in a way that catches people out badly. Passing a null array into a repeating section removes the topmost record from the output file, and passing null a second time removes another record after that, reported by practitioners rather than documented by Microsoft. It has quietly deleted rows nobody meant to touch. To clear a repeating section's content without deleting rows one by one, the community workaround is passing a whitespace string into each column, avoiding a null value entirely.
Two smaller data problems round this out. A line break in a plain text field only renders as a new paragraph if the "Allow carriage returns (multiple paragraphs)" setting is switched on for that content control, so a value with embedded new lines silently collapses onto one line if that setting was left off. Microsoft also documents that Unicode text renders correctly as long as it displays correctly in Word's own export, though less common glyphs, PUA characters, or fonts like Yu Mincho, can come out wrong or missing unless the font is embedded in the template first.
Licensing, throttling and documents that come out wrong
The Word Online (Business) connector is classified by Microsoft as a premium connector, so the action needs a Power Automate Premium licence or a Power Apps Premium licence behind it. Save a flow with it and no premium licence, and the message reported in Microsoft Q&A is direct: "Flow could not be activated because you need a Power Automate Premium license or other license that includes premium connectors to save this flow with connection". A Process licence assigned to the flow itself exempts individual users from needing a premium licence of their own.
The cause almost nobody suspects sits in conditional access. Microsoft documents it plainly. If the tenant has a Multi-Factor Authentication conditional access policy enabled, the action cannot be used at all, and no workaround is documented. The policy has to be disabled or reconfigured before the action runs, which means the actual fault can be sitting in the security team's settings, nowhere near the flow.
Throttling is its own documented limit: 100 API calls per 60 seconds, per connection. Cross it and the response comes back as HTTP 429, "Too Many Requests", with a Retry-After header stating how long to wait. Microsoft recommends building exponential backoff into the retry logic.
Sensitivity labels and encryption cause a cluster of failures around one theme, a file too protected for the action to touch. Microsoft documents that the Convert Word Document to PDF action won't process a file labelled Confidential or Highly Confidential. Practitioners report a cluster of related problems that Microsoft does not document in the same place. Sensitivity label encryption and password protection are reported not to coexist on the same document, with a password-protected file unable to have a label applied or read by SharePoint or OneDrive. IRM-protected documents are reported to be editable by only one person at a time once downloaded, with no browser editing.
Some flows succeed and still produce a broken document. The run turns green, a file lands exactly where it should, and the content inside it is wrong regardless. Content controls in the output are locked, greyed out, and skip the spell checker in Word desktop, which Microsoft documents as expected behaviour. The fix is double-clicking the locked control, deleting the existing text, and typing the replacement straight in. An Image content control forces its picture to the control's exact dimensions, ignoring the photo's own aspect ratio, so an undersized control stretches or crops it. Microsoft also notes a freshly generated document can be briefly unavailable right after creation, and recommends a delay of around a minute before a follow-up action opens it. Separately, without confirmation from Microsoft, practitioners report flows that succeed while leaving some placeholders unreplaced.
Microsoft's own troubleshooting guidance covers the basics: confirm every content control is a supported type and every name is unique, and store the template in OneDrive for Business or SharePoint Online rather than on-premises SharePoint. Practitioners add several more worth running through, including saving the file with a .docx extension because .dotx is reported not to be recognised, stripping hyperlinks from the document text, turn off sensitivity restrictions, confirm the signed-in account has access to the template, and test a repeating section with hardcoded values to rule the array schema in or out.
Given how many of these causes produce the same generic error, work through them in order of how often each turns out to be the cause. Check content control types and names first, then storage location and size, then the repeating section's array shape, then the licence and conditional access policy. Only after that does the two minute timeout deserve treatment as a document complexity problem.