Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, 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 lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
Here’s my use case: I have collections where, depending on the configuration of the environment, I will need to execute different sequences of requests. I will be combining these collections using the NPM package postman-combine-collections and then executing them in Jenkins using the NPM package newman.
Rather than trying to flow control all of my setup/execution/tests in the pre-request and test scripts to change for each configuration (which can, and will, get terribly messy/edge-case-y quickly), I’d like to instead go simpler and create top-level folders in the collection for each configuration.
Like so:
- Collection 1
— Configuration 1
----- Setup
----- Execution
----- Teardown
— Configuration 2
----- Setup
----- Execution
----- Teardown - Collection 2
— Configuration 1
----- Setup
----- Execution
----- Teardown
— Configuration 2
----- Setup
----- Execution
----- Teardown
What I need to do, then, to execute my combined collection using ‘Configuration 1’ folders instead of ‘Configuration 2’ folders? newman run accepts a --folder <name> option but, as it describes itself:
Run requests within a particular folder/folders in a collection. Multiple folders can be specified by using
--foldermultiple times, like so:--folder f1 --folder f2.
It sounds like this will not work for my scenario, as I would have to specify every single folder name (there will be dozens of collections with 2-3 configurations each, which is why I am using postman-combine-collections instead of writing dozens of batch commands in my Jenkins job).
*Further clarification about how I’m executing things in Jenkins:
- Configure my software environment (change settings for my deployed services)
- Run my Postman collection folders for that particular configuration, which will change things like API flows (which requests ARE made/NOT made) as well as request requirements (which fields are required/not required or allowed/disallowed, which values are valid/invalid for each field)
- Repeat steps 1 & 2 for my other configurations
*If you would like to play with behaviors for this, I have made an example combined collection here: https://www.getpostman.com/collections/343ce37d6f59bcbe0d3e (instructions are in the collection’s description for getting started). Remember, the goal is to run both “config 1 (dogs)” or “config 2 (cats)” folders in all collections (imagine there are 36 collections combined here instead of two!)