Modifications in Request iterations

I have 3 requests in a Collection, in the 1st iteration i want to send 3 requests but in 2nd iteration i want to post only 2 requests from the collection. This should happen automatically instead of manually clicking the Run button on second iteration.

Also i want to maintain some delay time after each request during monitor. I dont see an option of delay in Monitor and unable to iterate the collection

Can you please help me to achieve this pls

As to delay, it is a bit complex. some explain that you can perform a request to the echo service for up to 10 seconds delay (you pass an argument and the transaction will last as long, but limited to 10s. Look for “Delay Response” in https://docs.postman-echo.com/?version=latest)

I used the ability we have to specify the next step (easiest is to skip step 2) and the ‘settimeout(_function_callback, delay)’.

In the callback function you perform a set of the next step so that it will jump there only after the timeout expires.

Be responsible with the delays, these functions are AFAIK running as lambda, with the idea that they can be implemented, executed and removed in a small amount of time. If you set a timer you actually monopoly the resource for as long. If you need longer interval (>30sec), probably you should implement an API that is triggered by your monitor (that acts as a scheduler) rather than rely on the monitor to execute long lasting tasks. Just an opinion.

1 Like