- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the workflow in Postman?
In a Collection, the requests are executed in the sequence in which they are created. However, a workflow can be changed in Postman. To illustrate it, let us take a Collection having four requests.
To trigger that Collection, click on the arrow appearing to the right of the name of the Collection in the sidebar. The Run button appears, click on it.
The Collection Runner window gets launched. Within the RUN ORDERsection, the sequence in which the requests shall get executed is displayed from the top to bottom. In our example, the order is −
Click on Run Collection1.
A new window appears containing the execution details. With the workflow as −
GET – Executed first.
POST – Executed second.
DEL – Executed third.
PUT – Executed last.
Let us try to execute the requests in the order given below −
GET – To be executed first.
POST – To be executed second.
PUT – To be executed third.
DEL – To be executed last.
This change in workflow can be achieved using the function postman.setNextRequest(). It is used to point to the next request to be run. The name of the next request to be executed is passed as a parameter.
postman.setNextRequest("next request name")
The steps to change a workflow are listed below −
Step1 − Incorporate the below script for the Create User request under the Tests tab,
Step2 − Incorporate the below script for the Update Request under the Tests tab,
Step3 − Incorporate the below script for the Delete Request under the Tests tab,
Step4 − Trigger the collection – Collection1 for execution.
Step5 − A new window opens showing the new sequence of request execution as given below:
GET – executed first.
POST – executed second.
PUT – executed third.
DEL – executed last.
- How to handle Infinite loops in Postman Workflow?
- What is the PowerShell Workflow?
- How to run Invoke-Command in PowerShell Workflow?
- How to clear the global variables in Postman?
- How to get the details of a workflow using Boto3
- In SAP Workflow, Binding the receiver dynamically
- How to Monitor Collections in Postman?
- How to use Sessions in Postman?
- How to Manage Cookies in Postman?
- How to Add Cookies in Postman?
- How to Import Collection in Postman?
- How to create sessions in Postman?
- How to parameterize requests in Postman?
- Explain Git collaboration workflow
- How to get the value of environment variable in Postman?