For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
        • Use TypeScript in an Evaluate block
        • Iterate through a list using a For loop
        • Select data from complex JSON
        • Persist data outside a flow
        • Use the AI Agent block as logic for a flow
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Recipe
  • Try it out
Postman FlowsFlows cookbook

Use the AI Agent block as logic for a flow

||View as Markdown|
Was this page helpful?
Previous

Persist data outside a flow

Next

Learn how to use Postman Flows with tutorials

Built with

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.

Recipe

The following recipe shows how to use an AI Agent block to get a list of GitHub issues from Postman’s app support repo:

  1. Create a flow 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

  2. Add an AI Agent block and connect its key input port to the HTTP Request block’s Success port.

  3. Select a Model for the AI Agent block.

  4. 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.

  5. Connect a Display block to the AI Agent block’s Result port.

  6. Run the flow. The AI Agent block generates an email as described in the prompt.

Try it out

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.