# postman.setNextRequest() ignore other requests in collections

**URL:** <https://community.postman.com/t/postman-setnextrequest-ignore-other-requests-in-collections/5787>\
**Category:** Help Hub\
**Tags:** workflows\
**Created:** [June 6, 2019, 8:07am UTC](https://community.postman.com/t/postman-setnextrequest-ignore-other-requests-in-collections/5787 "2019-06-06T08:07:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![postman-paul540](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/postman-paul540/32/149_2.png) [@postman-paul540](https://community.postman.com/u/postman-paul540)\
**Post date:** [June 6, 2019, 8:41am UTC](https://community.postman.com/t/postman-setnextrequest-ignore-other-requests-in-collections/5787/2 "2019-06-06T08:41:02Z")

</div>

Assuming your requests are in this order in your collection 1 \> 2 \> 3 and you want to run your requests in the below order using `postman.setNextRequest()`  
1 \> 3 \> 2?

`postman.setNextRequest()` is working as expecting in your example.

If you want to call request 2, then you’d need to use `postman.setNextRequest("name-of-request-2")` in request 3, so after request 3 has been completed it’ll run request 2.

Bear in mind, that after request 2 it’ll naturally go to the next request in your collection which would be 3.  
So you’d want to use the below in request 2 to end the test run:

```auto
postman.setNextRequest(null);

```

Hopefully that made sense?

Also, if you want to run your test collection in the order 1 \> 3 \> 2, why not just move the 3rd request so it’s the 2nd request in the collection so it’ll naturally run in the order you want without using `postman.setNextRequest();`

---

_[View the full topic](https://community.postman.com/t/postman-setnextrequest-ignore-other-requests-in-collections/5787)._
