0
votes

we have a requirement to delete items from a SP list if they were not modified for 15 minutes.
I configured a simple workflow in SP Designer and assigned it to a change action that pauses for 15 minutes and then deletes the item.
Now, if the item changed while the original workflow is paused, a new workflow will be started (I presume) with a new counter.
But how to terminate the original workflow so that it wouldn't delete the item earlier?
We are on SP2013 on Office365.

Thanks,

2

2 Answers

0
votes

I think you can solve it other way.

Use SP 2013 workflow platform, and set the trigger to item creation.

  1. create a date/time variable and set to current date or modified field value
  2. pause wf for 15 minutes
  3. if currentItem:Modified less then or equal your variable stored time
    • if yes: delete item
  4. in transition to stage section use the 3. step again and if yes: select end the workflow, if no: go to stage one
0
votes

Only way I can think of is to make the workflow run a Powershell script that has the rights to stop workflows. But keeping track of the workflow instance id and the item is going to be a hazzle.

How about simply putting a check at the end of the workflow that checks if the last modified field is older than 15 minutes. If it is older then delete the item, if it is not then terminate that workflow without action.