# Delay and retry between the execution of 2 requests

**URL:** <https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649>\
**Category:** Help Hub\
**Tags:** setnextrequest, request, delay\
**Created:** [September 30, 2022, 11:41am UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649 "2022-09-30T11:41:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oneappuser](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oneappuser](https://community.postman.com/u/oneappuser)\
**Post date:** [September 30, 2022, 11:41am UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/1 "2022-09-30T11:41:41Z")

</div>

Hi,

I want to put some delay and retry between the execution of 2 requests until i get the completed status of an order in the 1st request(Get\_Product\_Order).

Here using below code, i am getting the timeout for 3secs but setNextRequest is not getting executed.

```auto
if (status !== "completed")
{
    setTimeout(() =>{postman.setNextRequest("Get_Product_Order");}, 3000);
   
}
else
{
   postman.setNextRequest("SIM_Connectivity"); 
}

```

---

<div class="post-metadata">

**Author:** ![sbettwieser](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sbettwieser/32/13299_2.png) [@sbettwieser](https://community.postman.com/u/sbettwieser)\
**Post date:** [October 4, 2022, 7:06pm UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/2 "2022-10-04T19:06:09Z")

</div>

Are you are using the “Send” button from the request or are you using a Runner? If it’s the first, setNextRequest() will do nothing. See [here](https://learning.postman.com/docs/running-collections/building-workflows/#tips-for-building-request-workflows) more more info.

---

<div class="post-metadata">

**Author:** ![oneappuser](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oneappuser](https://community.postman.com/u/oneappuser)\
**Post date:** [October 6, 2022, 7:27am UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/3 "2022-10-06T07:27:36Z")

</div>

You are correct… i was trying with the send button. Now its working fine with the runner. Thanks a lot for your help.

One thing I am facing issue further: in the setNextRequest() i am using a csv file for different data set. But everytime its taking the 1st row data. May be i am not that pro in the looping . It would be great if you can suggest anything on this.

---

<div class="post-metadata">

**Author:** ![sbettwieser](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sbettwieser/32/13299_2.png) [@sbettwieser](https://community.postman.com/u/sbettwieser)\
**Post date:** [October 6, 2022, 5:48pm UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/4 "2022-10-06T17:48:31Z")

</div>

Unfortunately, I don’t have any insight into this myself. It would depend on how you’re getting the CSV data. If it’s as a data file in a Runner, then the row used is the current iteration; it doesn’t change with new requests.

---

<div class="post-metadata">

**Author:** ![oneappuser](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oneappuser](https://community.postman.com/u/oneappuser)\
**Post date:** [October 11, 2022, 11:00am UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/5 "2022-10-11T11:00:38Z")

</div>

Thanks for your reply… Need to find out some way. Thanks for your time to resolve the 1st issue.

---

<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:** [September 30, 2023, 8:28am UTC](https://community.postman.com/t/delay-and-retry-between-the-execution-of-2-requests/39649/6 "2023-09-30T08:28:53Z")

</div>

Closed on September 30, 2023, 8:28am UTC


