The setWorkflow can be used to disable Business Rules for Updates, Deletes and Inserts, though also so to circumvent Business Rule Before queries.
What does setWorkflow e function do?
Uses to set a global variable which you can use in throughout the life of that record. Setworkflow(false) is used to stop running any Business Rule written on that table for insert/update. Ex- You have list of incident and you want to change State = Closed.
What is the use of setWorkflow false in ServiceNow?
setWorkflow(false);
Disables the running of business rules that might normally be triggered by subsequent actions.