Agent Workflows

Orchestrating together multiple language model calls to solve complex tasks.

In order to solve complex tasks a single LLM call might not be enough, here we'll see how you can solve complex problems by orchestrating multiple language models.

The execution pattern of actions within an agent workflow is determined by its control flow. Various control flow types enable different capabilities:

Sequential

Tasks execute one after another when later steps depend on earlier ones. For example, a SQL query can only run after being translated from natural language.

Learn more about Sequential Workflows

Parallel

Multiple tasks execute simultaneously. For instance, retrieving prices for multiple products at once rather than sequentially.

Learn more about Parallel Workflows

Conditional (If statement)

The workflow branches based on evaluation results. An agent might analyze a company's earnings report before deciding to buy or sell its stock.

Learn more about Conditional Workflows

Iterative (For loop)

A task repeats until a condition is met. For example, generating random numbers until finding a prime number.

Learn more about Iterative Workflows

When evaluating which workflow to use for a task consider tradeoffs between task complexity, latency and cost. Workflows with parallel execution capabilities can dramatically reduce perceived latency, especially for tasks involving multiple independent operations like scraping several websites. Iterative workflows are great for optimizing for a given task until a termination condition is met but can be costly.