cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jake_harvey
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. 

Thanks!

0 REPLIES 0

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (4,138)