SOLVED - DELETE Request not running in Collection Runner

I have 3 requests in a collection.

Here’s the Test code in “request10” and “request11”:

var response = JSON.parse(responseBody);

Object.keys(response.results).forEach(function(key){
   if(response.results[key].associations.companyIds[0] == "1111"){
        console.log(response.results[key].engagement.id); 
        postman.setEnvironmentVariable("delete_request", "https://api.hubapi.com/engagements/v1/engagements/"+ response.results[key].engagement.id +"?hapikey=1234");
        postman.setNextRequest("delete_engagement");
   }
});


if(response.hasMore) {
  // replace the URL variable used for the request with the value of pageUrl
     postman.setEnvironmentVariable("url", "https://api.hubapi.com/engagements/v1/engagements/paged?hapikey=1234&limit=250&offset="+response.offset);
    postman.setNextRequest("request11");
}else {
    console.log("no");
    postman.setNextRequest(null);
}

Here is the Test Code in “delete_engagement”

console.log("deleted");
postman.setNextRequest("request11");

request10 and request11 seem to work fine, sending the request hundreds of times till eventually, it goes through all the data until there is no more data to return. It even console logs engagement.id if it matches the first conditional. However, the delete_engagement request never runs.

I’ve tested delete_engagement, by manually entering the url with an id logged from request11 and the request was successfully sent.

what am I missing? thanks for any help.

ah! I just read that setNextRequest always run at the end no matter what. Thus setNextRequest is being set as my DELETE request but then is being set again as request in the second conditional.
Thus I need to change how I’m traversing my requests