Sometimes, we need to stop all current assignments so that the records can be routed through a new workflow revision. A few articles on the web provide the instructions, but they look complex to me. The easiest approach I found is to create an automation script as in the following example, and then execute it via the OSLC API.

from psdi.server.MXServer import getMXServer as MXS

wfInstanceSet = MXS().getMboSet("WFINSTANCE", MXS().getSystemUserInfo())
wfInstanceSet.setWhere("ownertable = 'PO' AND active = 1")
wfInstanceSet.reset()

wfi = wfInstanceSet.moveFirst()

while wfi:
    wfi.stopWorkflow("Bulk closed by autoscript")
    
    wfi = wfInstanceSet.moveNext()

wfInstanceSet.save()
wfInstanceSet.close()