Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bad Gateway error - trigger When a file is created or modified (properties only)

I am trying to trigger a flow when a file modified, however the flow fails on the trigger - can someone advise?




{ "Pragma": "no-cache", "x-ms-request-id": "19f3fef5-13e2-406a-87e3-1bf4c2c6598a", "Timing-Allow-Origin": "*", "Cache-Control": "no-cache", "Date": "Thu, 03 Aug 2017 10:40:33 GMT", "Set-Cookie": "ARRAffinity=6f8192aeb45a330cdb5f642ecc217dcd76db8eb70939a923860f458883127859;Path=/;HttpOnly;", "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0", "X-AspNet-Version": "4.0.30319", "X-Powered-By": "ASP.NET", "Content-Length": "293", "Content-Type": "application/json; charset=utf-8", "Expires": "-1" }
{ "status": 502, "message": "Unknown Error\r\nclientRequestId: 19f3fef5-13e2-406a-87e3-1bf4c2c6598a", "source": "", "errors": [ "-1", "Microsoft.SharePoint.Client.UnknownError" ] }




Community Support
Community Support

Hi cc_onetowatch,


If the error code 500 or 502 appears, the failure is temporary or transient. Click or tap Resubmit to try the flow again.

This documentation could be a reference for you:

I have tested this trigger on my side by creating a simple flow. The flow ran succeed when a file was created or modified.

Please also consider to delete the old SharePoint connection and recreate the connection to see if it will work. Please try it again on your side and feel free reply if you need more help.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not applicable

Thanks for your reply,

There is no option to resubmit and also the flow does not run every time the file is modified or created.
Not applicable

Hi @v-yamao-msft

Okay so this is not a solution but I created a new library and added a document - created the workflow which ran without errors - 


The library that I am working with has 5 managed metadata columns - couyld this be the cause of the issue and if so is there a fix/workaround??

The error(Bad gateway 500,502) might also occur when there is something missing or wrongly input into the different actions composing the flow. I for instance set a value that didn't exist in the corresponding Sharepoint list which made the flow fail with this error.


A tip: If a error occurs you can troubleshoot it inside the view looking at a more detailed error message. It's on the same page as the one where you resend the flow.

I had this same error when I tried to repoint a Flow to an identical list that I had created by saving the original list as a  template.   The problem came from the original list having metadata columns.  The BadGateway error was indicating the metadata columns were an issue in creating the item.   In the end I deleted all of those columns on the destination and recreated them, repointed them to the metadata, and then edited the flow and reselect everything.  This took hours to resolve because it was not clear from the error message what the problem was because the inner error was 500 and read like the parameters, or data, that I was trying to put in the destination metadata column was beyond what was allowed. I had to make step by step changes and though a process of elimination figured out what had to be the problem.  It was a very tedious process that took hours.

Community Champion
Community Champion

Hello, @Anonymous!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @SPMPKC‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

Thank you for being an active member of the Flow Community!

Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



I have  a flow that failed of bad gateway yesterday and today it's still trying to send a test flow. We're 20 minutes in. 

I know OneDrive and online word has been having issues since this morning but TEAMS and Onenote do not seem to be affected. Is this  all related to the issue with onedrive?


Thank you, 


Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (2,286)