# pm.execution.setNextRequest can not work in Newman

**URL:** <https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [August 2, 2024, 7:31am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914 "2024-08-02T07:31:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![meringliu](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@meringliu](https://community.postman.com/u/meringliu)\
**Post date:** [August 2, 2024, 7:31am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/1 "2024-08-02T07:31:15Z")

</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).

Hi all,

Recently. I am using “pm.execution.setNextRequest” through postman app(version 11.2.35), but it can not work in my Jenkins pipline(Newman run).

I can’t find ANY documentation on pm.execution.setNextRequest() does anyone know anything about this?  
Thanks a lot~

---

<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:** [August 2, 2024, 7:40am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/2 "2024-08-02T07:40:03Z")

</div>

Hey @meringliu 👋🏻

Welcome to the Postman Community :postman:

Is there a particular error message that you’re not seeing?

What version of Newman is that using? Is it the latest version?

> **[Process data and script workflows using Postman JavaScript objects | Postman...](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#scripting-workflows)**
>
> Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.

---

<div class="post-metadata">

**Author:** ![meringliu](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@meringliu](https://community.postman.com/u/meringliu)\
**Post date:** [August 2, 2024, 8:38am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/3 "2024-08-02T08:38:09Z")

</div>

Hi @danny-dainton 😀  
Thanks for your feedback~  
The error msg like " Cannot read property ‘setNextRequest’ of undefined", and I use newman as a plugin in my Jenkins CI platform. Did you mean that i need to upgrade the latest version?

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/c/fcb00611d0ec2d0d22156b50693d7c2433277730.png)

---

<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:** [August 2, 2024, 8:46am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/4 "2024-08-02T08:46:37Z")

</div>

I don’t know which version of Newman that your plugin is using.

It would need to be 6.1.0 or newer to use the `pm.execution.setNextRequest()` functionality.

---

<div class="post-metadata">

**Author:** ![meringliu](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@meringliu](https://community.postman.com/u/meringliu)\
**Post date:** [August 2, 2024, 9:20am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/5 "2024-08-02T09:20:11Z")

</div>

I have checked my version and turns out it is 5.2.0.  
After upgrade to 6.1.3 and solve the problem now~ thanks a lot~

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [August 5, 2024, 9:20am UTC](https://community.postman.com/t/pm-execution-setnextrequest-can-not-work-in-newman/64914/6 "2024-08-05T09:20:49Z")

</div>

Closed on August 5, 2024, 9:20am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
