The traditional method of performing logic in a flow uses a series of blocks. For example, you might get a response from an HTTP Request block and route the data to a Select block. The flow would process the selected data with an Evaluate block and send the result to a Display or Output block. This method can sometimes result in a complex system of blocks that perform your use case, but can be challenging to design and debug.
With the AI Agent block, this process can use fewer blocks. You can route the response into a single AI Agent block, write a prompt to describe your business logic, and an AI model will handle the logic. You can also explain any data conversion in the prompt to handle that, too.
The following recipe shows how to use an AI Agent block to get a list of GitHub issues from Postman’s app support repo:
Create a flow module and add an HTTP Request block. Leave the HTTP verb as GET
, and enter the following URL:
https://api.github.com/repos/microsoft/vscode/issues
Add an AI Agent block and connect its key input port to the HTTP Request block’s Success port.
Select a Model for the AI Agent block.
Write a prompt that describes what to do. Prompt engineering is beyond the scope of this recipe, but a good strategy is to describe a persona, the task, the context, and the format of the result. For this recipe, use this prompt:
You are a customer support manager named Joe Smith. Draft an email to your team at Example.com showing the first ten items in the body array in the provided list. For each item, provide a ten-word summary of the title and a one-sentence summary of the item’s body. Make this a ten-item bulleted list, with each bullet the title and body summary.
Connect a Display block to the AI Agent block’s Result port.
Run the flow. The AI Agent block generates an email as described in the prompt.
To see this recipe’s completed flow, check out Cookbook: Use the AI Agent block as logic for a flow. You can also clone this flow to your workspace to experiment with it.
Last modified: 2025/09/09