# Collections parallel execution

**URL:** <https://community.postman.com/t/collections-parallel-execution/13496>\
**Category:** Help Hub\
**Tags:** newman-project, collections, parallel\
**Created:** [June 18, 2020, 1:13pm UTC](https://community.postman.com/t/collections-parallel-execution/13496 "2020-06-18T13:13:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ds\_sd](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@ds\_sd](https://community.postman.com/u/ds_sd)\
**Post date:** [June 18, 2020, 1:13pm UTC](https://community.postman.com/t/collections-parallel-execution/13496/1 "2020-06-18T13:13:40Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

What is the simplest way to execute different collections in parallel with newman? On local machine. Right now we do it on Jenkins but I want to try on my computer before push.

I have different collection under different folders(but the same root folder) and I’m run them with this command in .bat script **for /r %%f in (./\*) do newman run %%f -e Environment.json --bail**  
but it’s ‘single thread’.  
So , how to run all those collections in parallel? I want to cut execution time.

---

<div class="post-metadata">

**Author:** ![jetison](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jetison/32/12_2.png) [@jetison](https://community.postman.com/u/jetison)\
**Post date:** [June 18, 2020, 3:23pm UTC](https://community.postman.com/t/collections-parallel-execution/13496/2 "2020-06-18T15:23:07Z")

</div>

This script in the Newman repo runs parallel collections using async: [https://github.com/postmanlabs/newman/blob/develop/examples/parallel-collection-runs.js](https://github.com/postmanlabs/newman/blob/develop/examples/parallel-collection-runs.js)

And here’s an article about load testing with more words about that: [https://medium.com/better-practices/dont-get-techcrunched-performance-testing-for-your-http-apis-3196e40f6b70#7e8e](https://medium.com/better-practices/dont-get-techcrunched-performance-testing-for-your-http-apis-3196e40f6b70#7e8e)

---

<div class="post-metadata">

**Author:** ![aurelien.lair](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@aurelien.lair](https://community.postman.com/u/aurelien.lair)\
**Post date:** [December 10, 2020, 4:01pm UTC](https://community.postman.com/t/collections-parallel-execution/13496/3 "2020-12-10T16:01:12Z")

</div>

Hi Joyce,

I’ve followed a similar thing by doing [this](https://gist.github.com/matt-ball/29bacdee7c90b66c7e11770fec415b42) your colleague @matt did however I have an issue with the environment variables. Basically I want to run the same collection in parallel but with a different value as environment variable. I therefore did that

```
newman.run({
      collection: require('./config/postman/collection.json'),
      environment: [activity],
      folder: collectionFolderName,
      reporters: 'cli',
      timeoutRequest: constants.TIMEOUT_REQUEST,
      iterationCount: constants.NUMBER_OF_CARTS,
      bail: true,
  })  

```

and they are supposed to call URL with a different value such as  
`{{api_base_url}}/activities/{{activityUuid}}`  
how ever it seems that the run are using the same value. It is possible that environment variables are shared between runs? If yes could you tell me how can I set dynamically a value such as a part of the URL path without altering others runs?

Thank you in advance  
Aurélien

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/matt/32/2562_2.png) [@matt](https://community.postman.com/u/matt)\
**Post date:** [December 10, 2020, 5:31pm UTC](https://community.postman.com/t/collections-parallel-execution/13496/4 "2020-12-10T17:31:47Z")

</div>

@aurelien.lair it looks like you might only be sharing an excerpt of your script as it matches neither the example @jetison provided or the gist out on my GitHub. If you’re specifying different environment files/objects, it should definitely not be using the same one - the snippet you included looks like just a singular Newman run however.

---

<div class="post-metadata">

**Author:** ![aurelien.lair](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@aurelien.lair](https://community.postman.com/u/aurelien.lair)\
**Post date:** [December 10, 2020, 6:33pm UTC](https://community.postman.com/t/collections-parallel-execution/13496/5 "2020-12-10T18:33:21Z")

</div>

Hi Matt,  
thanks for answering me. What I am doing is to loop on an array of objects and to prepare a set of commands to run. The collection is the same but I’d like to change the environment variable within each command so that each command has its own URL like

`{{api_base_url}}/activities/{{activityUuid}}`

By doing this it seems that the environment variable is not different hence the URL is the same…

```
constants.CARTS.map(cart => {
    activity = require('./out/activities/' + cart.id + '.json'); 
    
    newman.run({
      collection: require('./config/postman/collection.json'),
      environment: [activity],
      folder: cart.collectionFolderName,
      reporters: 'cli',
      timeoutRequest: constants.TIMEOUT_REQUEST,
      iterationCount: constants.NUMBER_OF_CARTS,
      bail: true,
   })
});

async.parallel(commands);
```

---

<div class="post-metadata">

**Author:** ![SRIDZQ44](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@SRIDZQ44](https://community.postman.com/u/SRIDZQ44)\
**Post date:** [December 28, 2022, 10:43am UTC](https://community.postman.com/t/collections-parallel-execution/13496/6 "2022-12-28T10:43:58Z")

</div>

I want to split request within collection and run is it possible, say I Have 50 test request in a collection can i split 25\*2 in two parallel runs

---

<div class="post-metadata">

**Author:** ![ivotijan](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@ivotijan](https://community.postman.com/u/ivotijan)\
**Post date:** [September 6, 2023, 9:04am UTC](https://community.postman.com/t/collections-parallel-execution/13496/7 "2023-09-06T09:04:02Z")

</div>

That, exactly. I don’t want to run multiple collections in parallel. I want to run a single collection’s requests in parallel. Can Newman do that?
