0

I'm trying to find out the way to Identify, if there is any existing Microsoft flow is running on the current Item.

Scenario :

1) User 1 Manually trigger the workflow on the Item and Workflow is in progress.

2) User 2 again Manually trigger the workflow on the same Item. Now, here I want to check if there is there any previous instance of the Microsoft flow running. If Yes, then Terminate that old workflow instance and continue with the current flow logic.

So far I have not found any way. I can see the history of workflow instances in the Microsoft Flow site but, not sure how we can leverage that data in this current scenario. Please let me know if there is any way/work-around to achieve this.

Thanks in Advance.

1

Although i haven't tried this but i have something in my mind that may help you.

What you can do is create a column with name Flag. Whenever a flow gets triggered on item ,set a condition such that the flag gets set to value False.

If the flow gets completed set the column value to True.

Now the condition when you trigger flow for any item in share point list must check what the value is for the flag field. If it is false , do not trigger the flow .

If it is true , go ahead and trigger the flow.

This is the what i know can be done. The functionality that you are asking for is currently unsupported by Microsoft.

1

You won't be able to use a Flow to query or terminate another Flow

You'll instead need to drive your Flow by using informative custom columns in your affected list or library - for example, "Workflow Status" - and build conditions in your Flow that inspect these values to determine whether to proceed or not.

For example, we could setup a list with a custom workflow status column, which defaults to "Pending". When the Flow is triggered against an item:

  1. It checks if this custom column is equal to "Pending"
  2. If it is Pending, then we update that same status column to "In progress"
  3. Perform our standard business logic.
  4. Now, if another instance of your Flow starts up shortly after, that new Flow's condition check will fail, as the column is no longer "Pending". That second Flow should then be configured to stop running. This guarantees that only your first instance will still be running.
  5. Eventually the original Flow completes (at which point you might update status to "Complete", or even reset to "Pending"). The original Flow would have been allowed to perform all its business logic without being impacted by subsequent Flows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.