# pm.execution.setNextRequest is not a function CLI error

**URL:** <https://community.postman.com/t/pm-execution-setnextrequest-is-not-a-function-cli-error/59974>\
**Category:** Help Hub\
**Tags:** setnextrequest\
**Created:** [April 15, 2024, 1:40pm UTC](https://community.postman.com/t/pm-execution-setnextrequest-is-not-a-function-cli-error/59974 "2024-04-15T13:40:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![descent-module-part1](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@descent-module-part1](https://community.postman.com/u/descent-module-part1)\
**Post date:** [April 15, 2024, 1:40pm UTC](https://community.postman.com/t/pm-execution-setnextrequest-is-not-a-function-cli-error/59974/1 "2024-04-15T13:40:29Z")

</div>

Last week, in the monitor console logs, I started seeing the warning “Using “postman.setNextRequest” is deprecated. Use “pm.execution.setNextRequest()” instead.”

![Screen Shot 2024-04-15 at 14.29.44 PM](https://us1.discourse-cdn.com/getpostman/original/3X/a/c/ac0e59b13b425680efb4c7a57114878b9101c504.png)

When running the tests through the monitors there are no issues using pm.execution.setNextRequest however if you run it through the CLI you get a type-error.

![Screen Shot 2024-04-15 at 14.38.52 PM](https://us1.discourse-cdn.com/getpostman/original/3X/8/7/8756d8ba30867e19836ef628dfba10e658fc647b.png)

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

---

<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 15, 2024, 2:27pm UTC](https://community.postman.com/t/pm-execution-setnextrequest-is-not-a-function-cli-error/59974/2 "2024-04-15T14:27:41Z")

</div>

Hey @descent-module-part1 👋

Welcome to the Postman Community! :postman:

That function will be deprecated soon and it will be moving under the `pm.*` of APIs. You’re fine to use that in the current version of Postman.

This will be coming to the CLI very soon but for now, I would use `postman.setNextRequest()` in your Collections.

---

<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:** [May 23, 2024, 8:51am UTC](https://community.postman.com/t/pm-execution-setnextrequest-is-not-a-function-cli-error/59974/4 "2024-05-23T08:51:46Z")

</div>

The `pm.execution.setNextRequest()` function works in the latest 1.9.0 version of the Postman CLI.
