Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Sharepoint Create File issue

Hi all,


Environment: Sharepoint 2013 On-Premises; On-Premises data gateway


I have a simple Flow that move a pdf file from a document library to another document library in the same site of a sharepoint 2013 On-Premises, using On-Premises data gateway for the connection.

The flow works well for files with size less then 3MB, but for those greater then 3MB I'm getting a 502 error "BadGateway" - "Gateway on endpoint ... is unreachable".


Anyone can help?







Flow DesignFlow Design

Flow errorFlow error




Community Support
Community Support

Hi @FedericoSalvat,


Error 502 means that the failure is temporary, have you tried to resubmit the run to see if it will work?

What’s the maximum limit of on-premises SharePoint?

The maximum limit of flow has been increased to 100 MB for a single Message/File, while if the service flow connects to only supports 3 MB, then that is the maximum limit for that service.

Here is a doc on Limits and configuration of flow:

There is a blog on how to increase the maximum upload size in SharePoint for your reference:


Best regards,


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.

Hi Mabel,


thanks for your reply.


I tried to resubmit the Flow but it fails each time with same error (only for files with size greater than 3MB).
We have 2047 MB of Maximum upload size on our on-premises SharePoint, in fact I can upload the file (in error through Flow) in the destination document library manually without error.


I wonder if there are some limitations in the application "On-premises data gateway", I'm doing some research but I've not found anything yet.


Do you have any other suggestions?



Hi @FedericoSalvat,


Thanks for updating.

I am trying to find out some related docs on limitations on on-premises gateway, I will back to you once I got any updates for you.

By the way, have you created a high availability cluster of on-premises data gateways?

Please check the following blog for a reference and take a try with it: 


Best regards,



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.

Hi @v-yamao-msft,


Thank you for your effort!


No, I have a simple on-premises data gateway.

I built a cluster reading your article by adding a new gateway (installed even in the SharePoint server) but the same error persists.


I've just opened a ticket with Microsoft Support, I will give you updates as soon as I have them.

Of course any other advice and suggestions will be greatly appreciated!


Thank you

Best regards


Microsoft finally concluded that there is a Gateway limitation for the incoming files.

They said that a fix will be implemented but they do not have an ETA for that Smiley Sad


I'm trying to find an alternative solution... any suggestions are appreciated.






Still waiting for that fix, or more information. We are hitting the same limitation pushing content from 0365 to on-premise SharePoint. Nothing over 3 MB works over the Data Management Gateway, clustered or otherwise. We have a support ticket in with MS, as well. 


If the limit of the DMG is 20 MB (or 30 MB as I've heard in other places) then I suspect we are getting 502 BAD GATEWAY due to chunking.


Hard to believe that we can only pass one floppy disk worth of data per call over the DMG. It's 2019...




We are also facing this issue. 

Please provide any alternative solution for this on-premise gateway.


Frequent Visitor

Hi all

Any luck finding an alternative or more info on the on-prem gateway limitations.

I'm facing a similar issue. Trying to pass an attachment larger than 3 MB to an internal API.  

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,469)