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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (2,669)