rq.info object provides metadata about the current script execution context. It contains information about the request being executed, the current iteration (when running collections), and the event type.
Properties
rq.info.requestId
Type: string
The unique identifier of the request being executed.
Example:
rq.info.requestName
Type: string
The name of the request being executed.
Example:
rq.info.eventName
Type: "prerequest" | "postresponse"
The type of script event currently executing. Returns "prerequest" for pre-request scripts and "postresponse" for post-response scripts.
Example:
rq.info.iteration
Type: number
The current iteration index when running a collection with the Collection Runner. The index is 0-based, meaning the first iteration is 0, the second is 1, and so on.
For single request executions (not part of a collection run), this value is 0.
Example:
rq.info.iterationCount
Type: number
The total number of iterations configured for the collection run. For single request executions, this value is 1.
Example:
Use Cases
Track Progress in Collection Runs
Conditional Logic Based on Iteration
Different Behavior for First and Last Iterations
Log Request Context
Notes
- The
iterationproperty is 0-based (starts from 0, not 1) - For single request executions,
iterationis0anditerationCountis1 - The
rq.infoobject is read-only and cannot be modified - All properties are available in both pre-request and post-response scripts

