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

Approval flow throws bad gateway on resubmit.

Good morning, 

I have an interesting edge case with a flow that I haven't been able to find a solution to. My current plan is to move on and find another solution after I demo the system tomorrow. But I thought I'd reach out and see if anyone has any clue what's happening. 

I have a slightly tweaked approval workflow with Sharepoint (Template: 'When a file is added, approve file using SharePoint Content Approval'). In my case, instead of looking for files, the flow is triggered on creation of a new document set. So first of it checks for a match in the Content Type Name.


@equals(triggerBody()?['{ContentType}']?['Name'], 'Document Set Name')


After that the only other major difference is doing a `Get Folder Metadata` call to Sharepoint to get the Etag, instead of the usual call to get the info of a file. And then things continue basically as normal. 

The flow works perfectly. The first time. My boss wanted to see what happened if she submitted something, etc. So we ran through the flow. Great. 

Then she asked what happens if someone updates their document set and wanted to resubmit for approval. Obviously I'll have to build something for that (not sure what the best practice would be, but I know what I did isn't a solution). So out of curiosity she uploaded a file into the document set, just to simulate what might happen on the end user's end. And since I haven't put anything in place I thought I'd try to resubmit the flow to see what would happen.

Well, everything went fine initially. The flow ran, I got my approval request. And I now changed it to approve... And the flow then hung. Threw a 502 bad gateway on the step for changing the document set's "status." And just timed out. 

As I mentioned, no one would logically do this in an actual workflow. But I don't want to see something along these lines trip me up later. Is there a step I'm missing? Do I have to reset the status to "pending" first? Will a request to change the status always fail? Or does it have to do with versions and content approval? I thought using the Etag would sort that part out. Regardless I'm curious if anyone has experienced this before or knows why it doesn't work. Most of the search results about 502 errors discuss things like "intermittent server issues," but I know that's not it since it always works the first time, and never the subsequent ones. 



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!

Users online (4,032)