0
0
Postmantesting~5 mins

Delay between requests in Postman

Choose your learning style9 modes available
Introduction

Sometimes you need to wait a bit between sending requests to avoid overloading the server or to simulate real user behavior.

When testing APIs that limit how fast you can send requests.
When you want to simulate a user waiting before making the next action.
When the server needs time to process data before the next request.
When debugging to see how the system behaves over time with delays.
Syntax
Postman
// Use setTimeout in the 'Tests' tab to delay the next request
setTimeout(() => {
    postman.setNextRequest('Next Request Name');
}, delayInMilliseconds);

Replace 'Next Request Name' with the exact name of the next request in your collection.

delayInMilliseconds is the number of milliseconds to wait before sending the next request.

Examples
This waits 2 seconds before moving to the 'Get User Data' request.
Postman
// Wait 2 seconds before next request
setTimeout(() => {
    postman.setNextRequest('Get User Data');
}, 2000);
This waits 5 seconds before moving to the 'Update Profile' request.
Postman
// Wait 5 seconds before next request
setTimeout(() => {
    postman.setNextRequest('Update Profile');
}, 5000);
Sample Program

This script waits 3 seconds after the first request finishes, then moves to 'Second Request'. The console logs show the delay and transition.

Postman
// In the 'Tests' tab of the first request
console.log('Starting delay before next request');
setTimeout(() => {
    postman.setNextRequest('Second Request');
    console.log('Moving to Second Request after delay');
}, 3000);
OutputSuccess
Important Notes

Postman runs scripts quickly, so setTimeout is needed to create a real delay.

Make sure the next request name matches exactly, including spaces and case.

Delays help avoid hitting rate limits or simulate real user pacing.

Summary

Use setTimeout with postman.setNextRequest to delay between requests.

Delay time is in milliseconds (1000 ms = 1 second).

Delays help test realistic scenarios and avoid server overload.