Audience : Postman user with collection working knowledge
A workflow is a sequence of things to achieve a particular task. In Postman, workflow is the flow of requests in a defined sequence. In research or quick POC, this workflow can be very handy.
Let's setup Postman workflow with our dummy use case.
Use Case : I live in NJ. When co levels > 160, I plan to visit Icelander else Norway. If any of these two countries have co level greater than 150 then it's Greenland.
I am using openweather API for fetching current co level using Air pollution API.
My PlanVisit collection looks like
Postman use setNextRequest for setting up the workflow. When we want to forward the call to next request use:
postman.setNextRequest("<<RequestName Or RequestID>>")
and, to stop
postman.setNextRequest(null)
Let's put our logic in a neat way
If co > 160, set postman.setNextRequest('iceland')
Else, postman.setNextRequest('norway')
If at destination check co >150, set postman.setNextRequest('greenland')
Else, postman.setNextRequest(null)
If at greenland, set postman.setNextRequest(null)
In Postman, test case for request current_airQuality @ NJ looks like as below
Finally run the PlanVisit collection
See the results promptly
If you are interested in watching a screen capture Click here
Sharing my Postman public collection, fork it, play with it and share how did you use conditional workflows.
Hope this helps!