Postman Flows: 5 Example Flows

In my earlier blog posts, I’ve taken a high level look at Postman’s beta feature Flows, and delved a bit deeper into what each of the blocks that make up a Flow actually does.

However, I think when we’re learning, itโ€™s good to have examples we can refer to – that’s always the shortcut I use to get inspired anyway! So here are some working examples I created to help get those creative juices flowing. Note these are all basic Flows that may form part of a larger Flow should you wish to do something more advanced.

All of my Flows use the Restful Booker API, written and maintained by the amazing Mark Winteringham. Click on the links below to access a video and short tutorial on each Flow.

Flow #1: Passing Variables Between Requests

In this instance, we create a new booking, and pass the created booking ID to a request to GET the information about that ID. This is done via the the “assign values to variables” link within a request without the need to use the now deprecated Assign Variables/Create Variables blocks.

NOTE – pay attention to those yellow warning triangles in the send request – the block will not recognise the response body data unless they have been defined in an example first.

Video showing use of “Assign values to variables” link to define and pass variables – remember to create an example first!

Flow #2: Looping data

*Updated May 2022* If you want to loop through a response and apply a rule to it then you can find an example picture below. Here I take the ID’s from a GET all request, loop through them using a FOR EACH loop and for each of the ID’s in the request I output to a terminal if the booking id is greater than 100.

For Each Loop Highlighted in Green

Another way to do this is via the Create Data/Loop Over List Flow, also shown in the picture above. Using these blocks, I also execute a further request using the ID from the loop e.g. to GET information on the booking. I then output the test run results to a Test Summary block.

The steps are as follows:-

  • Ensure you have an example saved in your collection for the requests you wish to use in the Flow
  • Add a Send Request block
  • Add a Create Data block, using the data input to select a value (in this case /data/body/ which is a list of booking ID’s)
  • add a Loop Data Until block, which tells the Flow you want to do something with the data you’ve created
  • Add further blocks to do that thing e.g. Send Request (adding the variable of bookingid you’ve generated above) or conditional logic
  • (optional) to convert the data back to its original state, add an End Loop Block
  • Add Terminal/Test Summary Blocks to output the data so you can ensure it works – it will dynamically update with new information each time the data passes through the loop

    Joyce Lin has also done a video here showing another fantastic use of loops.
Video showing for each loop logic (version 9.19 of Flows beta)

Inspired by Postman Supernova Sowmya Sridharamurthy’s recent tutorial (which I highly recommend taking a look at) if you wish to loop through data in a List, try using a Select block first:-

When Looping, you must first Select the data you wish to loop through

Flow #3: Take Inputs From Multiple APIs

This example shows how you can take requests running against two different environments from two different collections and perform a Check on them both to output to a terminal.

Video showing outputs from two API requests flow into the same check block in Postman Flows

Flow #4: Passing Data Between Requests

From version 9.5.0, you can use the Create Durables block to complete the task of passing data between requests – as long as you have created an example API request first! By adding the token as a durable type, the generated value can be persisted throughout the Flow.

Video showing data being passed through a Postman Flow using Data Durables – Remember to create an example first!

Flow #5: Generating a Test Summary Report

My fave Flow! Takes tests run as part of 3 different requests and outputs the results to a single Test Summary Block. Note these can be from entirely different collections if, for example, you want to generate a quick eyeball test report from across all your critical APIs.

I hope these will help you to see how Flows might be useful to you in your testing endevors. You can see a video of a live stream I did with the Postman team where I walk through Flows in more detail here.

screenshot of YouTube livestream showing Postman DevRel’s Arlemi and Vikram and myself

Bye for now ๐Ÿ‘‹


5 thoughts on “Postman Flows: 5 Example Flows

  1. I send a request to receive a list of peoples. And then I want to send request for detail info about one choosed man. I want to pass value from set of ids from first request to second. Not first id and not second – random of ids. How can I make this?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: