Hi Ankur, the query I provided is the one I want but what would be the script? I'm not so familiar with the Flow API especially to use it on such a high amount of records.

I have this example for a single record from the Flow API documentation, but I would need to make it for the mentioned query.

(function() { 

var now_GR = new GlideRecord('incident'); 
now_GR.addQuery('number', 'INC0000050'); 
now_GR.query(); 
now_GR.next(); 

      try { 
          var inputs = {}; 
          inputs['current'] = gr; // GlideRecord of table: 
          inputs['table_name'] = 'incident'; 

          // Starts the flow asynchronously.
          var contextId = sn_fd.FlowAPI.startFlow('global.myFlow', inputs); 

      } catch (ex) { 
          var message = ex.getMessage(); 
          gs.error(message); 
      } 
})();

 
// Call the cancel() method using the context Id returned from the startFlow() method
sn_fd.FlowAPI.cancel(contextId, 'Flow took too long to execute.');