How to cancel all running workflows except the newest via a business rule?

Zod
Giga Guru

Hi,

we have a process in place, that will trigger a workflow for each new user ... . This WF contains multiple steps and pauses for some weeks from time to time.

But if something happens "field value change on the table" via a business rule, the currently running workflow should be cancelled (it will restart again anyhow from new) ....

Any coding help here to be added to the business rule to cancel all open workflows ("name abc" for user "sys_id") ?

Thank you!!!

6 REPLIES 6

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Take a look here. might be what you are looking for and there is an example as well: https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_WF-cancel_GR


Zod
Giga Guru

Thanks Chuck, Thanks Göran,


I found a way to do a check more easily within the WF itself.


Anyhow - links are helpful!!