Multi-Step & Parallel

Pattern

Multi-Step Tool Pattern

Execute multi-step workflows with typed tools. Includes streaming, tool chaining, and decision-making for automated tasks.

IntermediateOct 2025View the full pattern on desktop
Multi-Step Tool Pattern preview

Problems solved

  • Coordinate multi-step tool calling inside an Experimental_Agent loop
  • Chain dependent tool results across several agent steps
  • Stream progressive tool activity to the chat UI
  • Stop runaway loops with step-count controls

Use cases

  • Research agents that gather then synthesize
  • Ops assistants that complete multi-step checklists
  • Data enrichment chats with sequential tools
  • Teaching multi-step tool patterns with AI SDK agents

AI SDK APIs

new Agenttool(stepCountIsgenerateObjectExperimental_Agenttools:gatewayhasToolCall

Tags

aiagentstoolsmulti-stepweb-searchnewsanalysisai-sdk-v5strongly-typedstreaming

Requirements

Node.js
24+
Memory
1GB
Other
  • OpenAI API key
  • Perplexity API key

Environment variables

External services

perplexityopenaihackernews

Ready to use?

View the full interactive pattern with live preview and copy the source code.

View the pattern on desktop

Related patterns