# Build an AI Agent with Postman Flows Using Public APIs

Source: https://www.youtube.com/watch?v=CSP9KeLkHAA
Recap page: https://rapidrecap.app/video/CSP9KeLkHAA
Generated: 2025-11-11T19:38:30.111+00:00

---
## Quick Overview

The tutorial successfully demonstrates how to build an AI Agent using Postman Flows that aggregates the top 10 news stories from both the New York Times API (Tech section) and the Hacker News API (item endpoint), combines the results, and outputs a unified list, successfully deployed as an MCP server, although initial runs required debugging due to API key issues and flow configuration errors.

**Key Points:**
- The final AI Agent aggregates the top 10 tech stories from the New York Times API and the top 10 stories from the Hacker News API into a single, combined list.
- The process involved creating a new Postman Flow module, using an HTTP Request block to call the New York Times API (section=technology) and another to call the Hacker News API (topstories endpoint).
- An Evaluate block was used to slice the Hacker News results to only include the top 10 items (body.slice(0, 10)).
- A Loop block iterated over the results from both API calls, and a Collect block gathered all iterated items.
- An AI Agent block (using GPT-4) was prompted to summarize the combined list of news stories, using context from both initial API calls.
- The final deployed agent was assigned the URL `postman.flow.system.com/api/toolDefinition` and was configured to work with the New York Times API key variable, successfully testing the combined output.
- Initial debugging involved fixing an invalid API key error for the New York Times API and correcting the flow connections after adding context variables to the AI Agent.

![Screenshot at 00:01: Setting up the initial Postman Flow canvas with a Start block connected to the first API call block for the New York Times Top Stories.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-00-01.png)

**Context:** The video provides a tutorial on creating a basic AI Agent using Postman Flows, leveraging public APIs to fetch and process data. The presenter, Sterling Chin, demonstrates connecting two external APIs—The New York Times API for tech news and the Hacker News API for top stories—into a single flow. The goal is to combine the results, process them with an LLM (GPT-4) via an AI Agent block, and deploy the entire workflow as a callable MCP (Micro-Control Plane) server.

## Detailed Analysis

The tutorial guides the user through building an AI Agent in Postman Flows that intelligently aggregates news from two different sources: the New York Times Tech section API and the Hacker News 'topstories' API. The process begins by creating a new Flow module. The first step is adding an HTTP Request block for the New York Times API (using the API key variable), which returns a JSON object containing an array of stories under the 'results' key. This output is connected to a Collect block, configured to take only the top 10 items from the array using slicing logic (`body.slice(0, 10)`). Next, a second HTTP Request block is added for the Hacker News API, which returns a simple array of story IDs. This array is passed through a Map block to iterate over each ID, calling the Hacker News 'item' endpoint for each ID. The results from both API calls are fed into a Collect block to merge the lists. Finally, an AI Agent block using GPT-4 is configured with a prompt instructing it to summarize the combined list of top news stories from both sources, utilizing context variables to pass the data from the New York Times and Hacker News API calls. The flow is then deployed to an MCP server using a custom URL definition, demonstrating the agent's ability to handle complex, multi-source data aggregation and summarization.

### Flow Setup & New York Times API

- Initial flow created with a Start block connecting to an HTTP Request for the New York Times Top Stories API, configured to use an environment variable for the API key.

### Hacker News API Integration

- A second branch utilizes an HTTP Request to fetch top story IDs from Hacker News, followed by a Map block to iterate over each ID and call the item endpoint, collecting all results.

### Data Slicing and Collection

- The Evaluate block is used to slice the body output from the New York Times API to only process the top 10 stories; a Collect block merges the data streams from both APIs.

### AI Agent Configuration

- An All Agent block using GPT-4 receives two contexts (one from each API's loop) containing the story data, prompted to summarize the combined top news.

### Deployment and Testing

- The flow is deployed to an MCP server using the tool definition URL (`/toolDefinition`), and subsequent runs confirm the agent successfully processes data from both APIs and produces a combined summary, although initial runs required debugging for API key errors and flow connections.

![Screenshot at 00:01: Demonstration of the Postman interface showing an existing collection and the initial structure of the flow canvas.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-00-01.png)
![Screenshot at 00:07: The initial flow structure showing the Start block connected to the New York Times API block and the subsequent Output block.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-00-07.png)
![Screenshot at 00:44: The Postman REST Client view showing the successful JSON response structure from the New York Times API, including the 'results' array.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-00-44.png)
![Screenshot at 01:38: Creating a new Flow Module within the Postman workspace to build the custom agent logic.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-01-38.png)
![Screenshot at 02:09: Inspecting the output of the Hacker News API call in the Collect block, showing a list of 30 item IDs.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-02-09.png)
![Screenshot at 04:07: Adding an Evaluate block after the successful Hacker News API call to slice the array to the top 10 items.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-04-07.png)
![Screenshot at 07:34: Adding a Flow Module block after the successful New York Times API call to manage the loop logic.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-07-34.png)
![Screenshot at 10:09: The AI Agent block configured with a multi-part prompt instructing it to combine and summarize the news from both sources using the context variables.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-10-09.png)
![Screenshot at 12:28: The final flow diagram showing the parallel execution paths from the initial request, feeding into the AI Agent block.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-12-28.png)
![Screenshot at 15:27: Viewing the deployment panel in Postman, confirming the status is 'Active' after redeploying the updated flow.](https://ss.rapidrecap.app/screens/CSP9KeLkHAA/00-15-27.png)
