Postman Flows is a visual tool for building software for the API-First world. With Postman Flows, anyone can connect their web services' APIs to build workflows, integrations, and API applications in a visual and collaborative development environment.orkflows in your Postman workspace.
This page shows you how to create flows with a quick start tutorial and a more detailed tutorial. The quick start tutorial shows you how to create a flow in Postman that checks if a website is down.
The more detailed tutorial starts with Creating a request and a collection. This tutorial creates a flow that gets a list of Pokémon, one page at a time, until it reaches the last page.
This quick start tutorial creates a flow to check if a website is down or not. It does this by sending a request to the website and looking for a 200
status code in the response. If the website is up and running, the flow's Output block will display True. If the website is down, it will display False.
value1
and change it to status
. Then select Enter path..., scroll down, and select http.status. status=200
. This is the beginning of a detailed tutorial that builds a flow that gets a list of Pokémon, one page at a time, until it reaches the last page. Start by creating a new collection and adding a GET request. You'll use this collection with the flow you'll create later.
Pokemon API
.https://pokeapi.co/api/v2/pokemon?limit=200
. https://pokeapi.co/api/v2/pokemon?limit=200
with the variable {{URL}}
. Pokemon API
. Then select the GET request you created earlier. https://pokeapi.co/api/v2/pokemon?limit=200
.{{URL}}
on the Send Request block. body.results
.
body.next
to get the link to the next set of 200 results.body.next
Select block. Connect the body.next
Select block to the key
port. This creates a variable named value1
.body.next
Select block to the Data
port in the If block. value1
and replace it with has_next
. This assigns the body.next
value from the Select block to the has_next
variable in the If block. != null
.
has_next
value to the existing URL variable in the Send Request block.After completing the above steps, select Run. The flow runs and logs all the Pokémon to the console.
Congratulations, you've created your first flow!
Postman Flows can get data with API requests or directly from the Start block. This tutorial shows examples of Postman Flows getting data using both methods and passing data between blocks.
These examples get response data with API requests from existing collections in your workspace and from data pasted into the Start block. In these examples, the entire response is passed between blocks.
In this example, the Send Request block gets data using a collection's GET request. The Send Request block then passes all the data to a Log block.
Random User Collection
and add a GET request with this URL: https://randomuser.me/api/
.In this example, the flow gets data from the Start block and passes it to an Evaluate block. The Evaluate block passes the entire response to the Log block in a variable.
{
"results": [
{
"gender": "female",
"name": {
"title": "Miss",
"first": "Astrid",
"last": "Klingenberg"
},
"location": {
"street": {
"number": 2547,
"name": "Lyseskrenten"
},
"city": "Tvedestrand",
"state": "Oppland",
"country": "Norway",
"postcode": "6523",
"coordinates": {
"latitude": "44.5909",
"longitude": "130.7502"
},
"timezone": {
"offset": "+9:00",
"description": "Tokyo, Seoul, Osaka, Sapporo, Yakutsk"
}
},
"email": "[email protected]",
"login": {
"uuid": "263e48e9-1d6d-4d18-9458-27b1b7bad1b9",
"username": "lazycat514",
"password": "francois",
"salt": "YAY2fGhq",
"md5": "0ed2300b7aad0843267d658db0f22f2a",
"sha1": "57ef1b1c5cac06feb6712ac863b7c9d6292e400e",
"sha256": "5312eee0d8693e522aa62814fb49fb3239bad5326ca0f37011a97704978a4add"
},
"dob": {
"date": "1984-03-11T08:50:14.752Z",
"age": 38
},
"registered": {
"date": "2003-09-27T19:45:20.432Z",
"age": 19
},
"phone": "57680755",
"cell": "96350131",
"id": {
"name": "FN",
"value": "11038429851"
},
"picture": {
"large": "https://randomuser.me/api/portraits/women/68.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/68.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/68.jpg"
},
"nat": "NO"
}
],
"info": {
"seed": "4be1e2e93f6d34ba",
"results": 1,
"page": 1,
"version": "1.4"
}
}
body
. This assigns all the data received from the Start block to the variable body
. body
. This sends all the data in the body
variable to the Evaluate block's output.You can extract specific values from response data in a number of ways using variables and Flows Query Language (FQL). The example below uses FQL in an Evaluate block to get the country
field value from sample response data in the Start block.
{
"results": [
{
"gender": "female",
"name": {
"title": "Miss",
"first": "Astrid",
"last": "Klingenberg"
},
"location": {
"street": {
"number": 2547,
"name": "Lyseskrenten"
},
"city": "Tvedestrand",
"state": "Oppland",
"country": "Norway",
"postcode": "6523",
"coordinates": {
"latitude": "44.5909",
"longitude": "130.7502"
},
"timezone": {
"offset": "+9:00",
"description": "Tokyo, Seoul, Osaka, Sapporo, Yakutsk"
}
},
"email": "[email protected]",
"login": {
"uuid": "263e48e9-1d6d-4d18-9458-27b1b7bad1b9",
"username": "lazycat514",
"password": "francois",
"salt": "YAY2fGhq",
"md5": "0ed2300b7aad0843267d658db0f22f2a",
"sha1": "57ef1b1c5cac06feb6712ac863b7c9d6292e400e",
"sha256": "5312eee0d8693e522aa62814fb49fb3239bad5326ca0f37011a97704978a4add"
},
"dob": {
"date": "1984-03-11T08:50:14.752Z",
"age": 38
},
"registered": {
"date": "2003-09-27T19:45:20.432Z",
"age": 19
},
"phone": "57680755",
"cell": "96350131",
"id": {
"name": "FN",
"value": "11038429851"
},
"picture": {
"large": "https://randomuser.me/api/portraits/women/68.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/68.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/68.jpg"
},
"nat": "NO"
}
],
"info": {
"seed": "4be1e2e93f6d34ba",
"results": 1,
"page": 1,
"version": "1.4"
}
}
body
. This assigns all the data received from the Start block to the variable body
. body.results.location.country
. This navigates the response data with FQL and extracts the value for the country
field.country
field ("Norway"
) in the response data and sends it to the Log block. "Norway"
appears in the console. If you have several requests that have no dependency on each other but have to be executed in a particular order, you can use send events to connect your blocks.
Most APIs require authorization to access their data. Postman Flows can include credentials in its API requests, explicitly or as variables. This tutorial creates a simple flow that uses a global variable to access the OpenAI API with a secret key.
This example flow uses a secret key to access the OpenAI API. To get your secret key:
https://beta.openai.com/account/api-keys
and select Sign up.https://beta.openai.com/account/api-keys
and create a secret key.By assigning your secret key value to a variable, you can keep your key secure and easily include it in multiple Send Request blocks and flows.
auth
and paste Bearer
in the INITIAL VALUE field. For example: Bearer ab-123456789876543212345678987654321
OpenAI Collection
and add a GET request with this URL: https://api.openai.com/v1/models
.Authorization
.{{auth}}
.{{auth}}
variable appears at the bottom of the Send Request block. {{auth}}
variable and includes it in the API request. The API accepts the secret key and sends the response with a 200
code, visible in the console. This tutorial shows how to take data from a GET response and use it in a GET request in Postman Flows.
The Random User API returns a randomly chosen set of user data for each GET request, unless you include a seed as a query parameter. This tutorial takes the seed from a GET response and includes it as a query parameter in another GET request so that both GET requests return the same user's data.
Random User Collection
and add a GET request named First Request
.https://randomuser.me/api/
. Key
and enter seed.Value
and enter the variable {{seedVar}}
.
{{seedVar}}
variable appears at the bottom of the block. {{seedVar}}
.To create a flow that executes on the Postman servers, create a Start block.
Before starting, enter your test data and run it to see the output on your local console. Test data can be added by clicking the gear icon on the Start block. The test data can either be in text or JSON format.
Select Deploy and your flow will be running in the cloud. Selecting the Runs section of the right pane will display the deployed flow was last updated. The webhook URL can be seen here as well as in the top left corner of the flow.
In the Runs section, select View to observe the flow running in the cloud. The logs will be visible in your client. Make a POST request to trigger the webhook endpoint and observe your flow executing in the cloud.
The Output block takes in information from other blocks and creates a visual display of that information.
For some examples of what you can do with these blocks, check out the Stock Dashboard and WordPress Sentiment Analysis Flows.
The following can be selected from the drop-down menu in the upper-right corner of the block.
If you want to learn more about Postman Flows, review the official documentation for more details.