โ† API Testing with Postman learning path
API Testing with Postman ยท Module 6 of 10

Chaining requests and workflows

Build end-to-end API flows.

๐Ÿ“– Key ideas

  1. Chain requests by passing values: login โ†’ token โ†’ create order โ†’ get order.
  2. Save IDs from responses into variables.
  3. Collection Runner runs requests in order.
  4. pm.execution.setNextRequest controls flow.
  5. Clean up test data after flows.
๐Ÿ’ก Real-life example: Chaining is a relay race: each request passes the baton (token or ID) to the next.
Request chainingUsing one response in the next request
Collection RunnerRuns a collection in sequence
setNextRequestChanges which request runs next
CleanupRemoving data created by tests