The request failed. Error code: '502'. Error Message: 'BadGateway'

Power Automate Approval Flow

Posted by Trond Aarskog on December 08, 2021

Building an approval process with Power Automate is straight forward and very easy to set up. Just configure it and you are good to go.

Behind the scenes Microsoft will, on the first run, install the required solutions onto your Power Platform Environment. For guidance take a look at Get started with approvals and Build approvals feature using Power Automate.

The above documentation is not clear on an important step that I believe occurs if you are creating an approval flow in an Environment with an existing Dynamics 365 CE setup (or probably if you have configured security roles).

On my first run I got The request failed. Error code: '502'. Error Message: 'BadGateway'.

Power Automate Approvals Provisioning Overview and Troubleshooting is a bit vague in the section Permissions and Roles, and fails to mention the most important thing to verify. You need to give the Approval Administrator role Read access to System Job.

I have not verified how wide the access needs to be so I suggest you start with setting Read to User.