# Running a collection in pre-request script

**URL:** <https://community.postman.com/t/running-a-collection-in-pre-request-script/33829>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [March 24, 2022, 2:45pm UTC](https://community.postman.com/t/running-a-collection-in-pre-request-script/33829 "2022-03-24T14:45:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandsunderraman](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@anandsunderraman](https://community.postman.com/u/anandsunderraman)\
**Post date:** [March 24, 2022, 2:45pm UTC](https://community.postman.com/t/running-a-collection-in-pre-request-script/33829/1 "2022-03-24T14:45:02Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_Running an entire collection in the pre-request script_:  
I have created a collection that has a set of requests I need to make to set an environment variable.  
I would like to invoke the entire collection if that environment variable is not set.  
Is there a way to run the full collection in the pre-request script ?

---

<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:** [April 30, 2025, 4:15pm UTC](https://community.postman.com/t/running-a-collection-in-pre-request-script/33829/2 "2025-04-30T16:15:12Z")

</div>

Closed on April 30, 2025, 4:15pm UTC


