Newman Run only specific iteration

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.

I have a number of iterations ( say 10 ) … is it possible to run only iteration number 5 if need be?
if there is no direct way is there a workaround ?

You can set an environment variable for your maxIterationCount.

You could add a no-op request at the beginning of your collection (like hitting the postman delay endpoint) and in the tests section add the following code:

if(pm.info.iteration >= pm.environment.get('maxIterationCount'){
  postman.setNextRequest(null);
}

pm.info.iteration is a 0 based counter of how many times the collection has been iterated.

When you’re running newman, all you’d have to do is set an environment variable override to the max number of iterations:

newman run (standard arguments) --env-var "maxIterationCount=5"