/* Postman Visual Workflow JSON export example */
{
"info": {
"name": "User API Tests",
"_postman_id": "1234-5678-9012-3456",
"description": "Collection to test User API endpoints",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Users",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/users",
"host": ["{{baseUrl}}"],
"path": ["users"]
}
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', () => {",
" pm.response.to.have.status(200);",
"});",
"pm.test('Response is JSON array', () => {",
" pm.expect(pm.response.json()).to.be.an('array');",
"});"
],
"type": "text/javascript"
}
}
]
},
{
"name": "Create User",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\"\n}"
},
"url": {
"raw": "{{baseUrl}}/users",
"host": ["{{baseUrl}}"],
"path": ["users"]
}
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', () => {",
" pm.response.to.have.status(200);",
"});",
"pm.test('Response has created user', () => {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('name', 'John Doe');",
" pm.expect(jsonData).to.have.property('email', 'john.doe@example.com');",
"});"
],
"type": "text/javascript"
}
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"exec": [],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [],
"type": "text/javascript"
}
}
],
"variable": [
{
"key": "baseUrl",
"value": "https://api.example.com"
}
]
}
/* Visual Workflow Steps in Postman UI */
// 1. Add 'Get Users' request
// 2. Add 'Create User' request
// 3. Connect 'Get Users' to 'Create User' to run sequentially
// 4. Run the workflow and observe test results in Postman Runner