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 Platform Community / Forums / Power Automate / Getting error Bad Gate...
Power Automate
Unanswered

Getting error Bad Gateway (sometimes) while sending email with attachments

(0) ShareShare
ReportReport
Posted on by 26

Hi,

I have a flow triggered by PowerApps, which, based on several conditions, takes the attachments from two sharepoint lists and send an email with these attachments combined (attachments are appended to array). Sometimes the flow fails - the error occurs in the part when the email needs to be sent. I get error: BadGateway

image.png

"error": {
"code": 502,
"source": "flow-apim-europe-001-westeurope-01.azure-apim.net",
"clientRequestId": "54d0c117-b7d2-4b17-98c8-a0b3c5411122",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "Request failed. Try again later.\r\nclientRequestId: 54d0c117-b7d2-4b17-98c8-a0b3c5411122",
"source": "office365-we.azconn-we-01.p.azurewebsites.net"

I know that the error is "temporary or transient", but anyways the flow cannot be simply re-submitted, therefore I would like to have a solution how to avoid it (kind of crucial process fails due to this error). I found somewhere that it could be due to attachments size? One attachment is maximum 10MB, but it could be several of them in this case. Would it help to add second step to send an email and set it to run if previous send email step failed?
Categories:
I have the same question (0)
  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at
    Re: Getting error Bad Gateway (sometimes) while sending email with attachments
    Hey,
    The V2 actions use the graph API which has a max limit of 4MB currently... this is detailed on the connector documentation.
    The V1 actions whilst deprecated don’t use the graph API and support larger attachments.... might be a temporary work around.
    You could also try adding the attachments to a zip file (.zip) using the Encodian ‘Add to Archive (ZIP)’ action but whilst you might reduce the attachment size it’s not a robust solution in isolation.
    HTH
    Jay
  • v-litu-msft Profile Picture
    on at
    Re: Getting error Bad Gateway (sometimes) while sending email with attachments

    Hi @aurelijusm,

     

    If you want to add the second step to send an email and set it to run if the previous send email step failed, you could Configure run after, set the Second send email action should run after the previous action has failed.Annotation 2019-11-20 141451.png

     

    Annotation 2019-11-20 141506.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • aurelijusm Profile Picture
    26 on at
    Re: Getting error Bad Gateway (sometimes) while sending email with attachments

    Thanks.
    How could I use the deprecated action? I only can see V2. By the way it is not a simple Send an Email, it is a Send an Email from a shared mailbox.

  • v-litu-msft Profile Picture
    on at
    Re: Getting error Bad Gateway (sometimes) while sending email with attachments

    Hi @aurelijusm,

     

    If you cannot select the deprecated action in the list of Outlook actions, you could not use it.

    Yes, you can also configure run after in the Send an Email from a shared mailbox (V2) action, no matter what actions.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • PoohBear Profile Picture
    on at
    Re: Getting error Bad Gateway (sometimes) while sending email with attachments

    This is not acceptable. I am having the same issue right now. If Microsoft is going to make changes / updates then they need to ensure the new version works just as the previous version. Can someone please tell me if this will eventually be corrected?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard