setNextRequest behavior

postman version:7.16.1

I am relatively new to postman scripting and am struggling with correct usage of setnextRequest… guidance is much appreciated. I have read the docs and several posts about it.

I have request A and request B. A is a “POST”, B is a GET".

The PreRequest script for B looks like this:
if {
postman.setNextRequest(‘Request A’)

I start collection runner and execute “Request B” only.

expected behavior:
Request B execution followed by Request A execution.

actual behavior:
B executes but fails with a 401 status. This 401 was expected.
A never executes


Why does A not execute? Is setNextRequest effective only if the currently executing request(B in my case) is successful?

I think I got it sorted out. In collection runner I had to select both method A and B for this work and move B ahead of A in the execution list. Otherwise, setNextRequest will not launch A after B.