When running a collection, you can branch and loop across API requests in Postman using the
Providing the name of current run to
setNextRequest leads to Postman running the current request continuously.
Note: While looping over one request continuously, one should wrap
setNextRequest in some logic so as to ensure that the request does not run indefinitely otherwise the collection runner would need to be force closed.
Some salient points about
postman.setNextRequest()is absent in a request, the collection runner defaults to linear execution and moves to the next request
For more information about control flow, refer to building workflows.