# How to stop Collection Runner on error?

**URL:** <https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647>\
**Category:** Help Hub\
**Tags:** scripts, collection-runner\
**Created:** [May 14, 2020, 8:40am UTC](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647 "2020-05-14T08:40:44Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [May 18, 2020, 9:23am UTC](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647/5 "2020-05-18T09:23:41Z")

</div>

Hey @michael.brooks

I believe there was an edit, that you don’t have the full view of so that’s why it might have looked confusing to you. 😃 I wrote the wrong syntax and Kevin quite rightly, changed this for me 🏆

The reason I normally ask for an example, either through a series of images or a sample of the code that has been written is to help bring the problem to life. Other users cannot see what you have in front of you. 😃

Sometimes just added a text based question/problem can lead to confusion and a series of follow up questions that _could_ take longer to get you a solution.

The `postman.setNextRequest()` function is only available to control the workflow from the `Tests` tab of the Request and is actioned _after_ that Request has been sent.

If your first request has failed for some reason, that’s the place to tell the runner to either continue or stop the collection run. This can also be done in a central place, like at the collection or folder level if you didn’t want to add the same code to each request.

You cannot currently stop a request from running from the `Pre-request Script`, you could add assertions to meet certain pre conditions that would be seen as failures but you would be able to `stop` the request from executing.

I would love to see more about what you’re doing, to be able to advise you on a different and more context based solution.

---

_[View the full topic](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647)._
