> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asteragents.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Agent Workflows

> Create collaborative workflows where specialized agents work together on complex tasks

## Overview

Multi-agent workflows in Aster Agents allow you to create collaborative systems where specialized agents call each other to handle complex, multi-step tasks. Instead of building one agent that tries to do everything, you can create focused agents that excel at specific functions and coordinate their work automatically.

## How It Works

Multi-agent coordination is powered by the `call_agent` tool. When you configure an agent to work with others, Aster Agents handles the wiring automatically.

<CardGroup cols={2}>
  <Card title="Provides Agent Context" icon="robot">
    The calling agent receives information about available agents in its system prompt.
  </Card>

  <Card title="Maintains Conversation Threads" icon="comments">
    Agents can continue conversations across multiple interactions.
  </Card>

  <Card title="Preserves Context" icon="share-nodes">
    Information flows seamlessly between agents in the workflow.
  </Card>

  <Card title="Handles Permissions" icon="gear">
    Only allows calls to explicitly configured agents.
  </Card>
</CardGroup>

### The Call Agent Tool

The `call_agent` tool enables agents to:

* Send messages to other specific agents
* Continue existing conversation threads
* Delegate specialized tasks
* Build complex workflows through agent collaboration

## Setting Up Multi-Agent Workflows

<Steps>
  <Step title="Configure Agent Relationships" icon="sitemap">
    In the Control Hub when creating or editing an agent:

    * **Enable the Call Agent Tool**: Add `call_agent` to your agent's available tools
    * **Select Callable Agents**: Choose which other agents this agent can invoke from your organization's agent list
    * **Automatic Integration**: Agent details are automatically added to the system prompt
  </Step>

  <Step title="Agent Information Integration" icon="circle-info">
    When an agent has callable agents configured, they automatically receive:

    * **Agent Names**: Human-readable identifiers for each callable agent
    * **Agent IDs**: Technical identifiers needed for the `call_agent` tool
    * **Agent Descriptions**: Understanding of each agent's capabilities and specializations

    This information appears in the system prompt like this:

    ```
    You have access to the following agents that you can call using the call_agent tool:

    - Data Analyst (ID: 123)
      Description: Specializes in analyzing sales data and creating insights

    - Report Writer (ID: 456)
      Description: Creates professional reports and presentations from data analysis

    When using the call_agent tool, you must provide the agent_id from the list above.
    ```
  </Step>

  <Step title="Design Your Workflow" icon="diagram-project">
    Plan how agents will work together:

    * **Define Roles**: What specific task does each agent handle?
    * **Map Information Flow**: What information needs to pass between agents?
    * **Plan Entry Points**: Which agent do users interact with first?
    * **Consider Threading**: When should agents continue existing conversations vs. start new ones?
  </Step>
</Steps>

## Common Workflow Patterns

<CardGroup cols={2}>
  <Card title="Sequential Processing" icon="arrows-split-up-and-left">
    Agents work in a defined order, each building on the previous agent's work.

    **Example: Research to Report Pipeline**

    1. **Research Agent** → Gathers information from web and knowledge bases
    2. **Analysis Agent** → Processes findings and identifies key insights
    3. **Writer Agent** → Creates formatted report from analysis
    4. **Review Agent** → Quality checks and provides final output
  </Card>

  <Card title="Specialized Task Delegation" icon="share-nodes">
    A primary agent delegates specific subtasks to specialized agents.

    **Example: Customer Support Triage**

    1. **Support Agent** receives customer inquiry
    2. Based on issue type, calls:
       * **Technical Agent** for product issues
       * **Billing Agent** for payment questions
       * **Account Agent** for user management
    3. **Support Agent** synthesizes response for customer
  </Card>

  <Card title="Parallel Processing with Coordination" icon="network-wired">
    Multiple agents work simultaneously, with results combined by a coordinator.

    **Example: Market Research Workflow**

    1. **Coordinator Agent** breaks down research request
    2. Calls multiple agents in parallel:
       * **Web Research Agent** → Industry trends
       * **Data Agent** → Internal sales data
       * **Competitor Agent** → Competitive analysis
    3. **Coordinator Agent** combines all findings into comprehensive report
  </Card>

  <Card title="Iterative Refinement" icon="arrows-split-up-and-left">
    Agents work together through multiple rounds to refine outputs.

    **Example: Content Creation Loop**

    1. **Writer Agent** creates initial draft
    2. **Editor Agent** provides feedback and suggestions
    3. **Writer Agent** revises based on feedback (using thread ID to continue conversation)
    4. Process repeats until quality standards are met
  </Card>
</CardGroup>

## Practical Examples

<Tabs>
  <Tab title="Sales Intelligence">
    ```
    Prospect Researcher (Entry Point)
    ├── Data Collector → Gathers company information
    ├── Social Media Analyst → Reviews social presence
    ├── News Tracker → Finds recent company updates
    └── Sales Strategist → Combines insights into outreach plan
    ```
  </Tab>

  <Tab title="Content Production">
    ```
    Content Manager (Entry Point)
    ├── Topic Researcher → Identifies trending subjects
    ├── Writer → Creates initial content
    ├── SEO Optimizer → Enhances for search
    ├── Social Media Adapter → Creates platform-specific versions
    └── Publisher → Schedules and distributes content
    ```
  </Tab>

  <Tab title="Data Analysis">
    ```
    Data Coordinator (Entry Point)
    ├── Data Collector → Extracts from databases/APIs
    ├── Cleaner → Processes and validates data
    ├── Analyst → Performs statistical analysis
    ├── Visualizer → Creates charts and graphs
    └── Reporter → Compiles findings into presentation
    ```
  </Tab>
</Tabs>

## Best Practices

<AccordionGroup>
  <Accordion title="Agent Design" icon="robot">
    1. **Single Purpose**: Each agent should excel at one specific type of task
    2. **Clear Descriptions**: Write detailed agent descriptions since these appear in system prompts
    3. **Consistent Interfaces**: Design agents to work well together
    4. **Error Handling**: Consider what happens when agents can't complete tasks
  </Accordion>

  <Accordion title="Workflow Planning" icon="list-check">
    1. **Start Simple**: Begin with 2-3 agents and expand gradually
    2. **Map Dependencies**: Understand which agents need outputs from others
    3. **Plan for Failures**: What happens if an agent in the chain fails?
    4. **Test Thoroughly**: Run complete workflows manually before deploying
  </Accordion>

  <Accordion title="Communication Design" icon="message">
    1. **Clear Handoffs**: Agents should know exactly what information to pass along
    2. **Context Preservation**: Use thread IDs to maintain conversation context when needed
    3. **Status Updates**: Keep users informed about multi-step progress
    4. **Result Integration**: Plan how final outputs get assembled and presented
  </Accordion>

  <Accordion title="Performance Considerations" icon="bolt">
    1. **Parallel vs Sequential**: Choose based on dependencies and urgency
    2. **Thread Management**: Use conversation threads strategically to maintain context
    3. **Token Efficiency**: Monitor cumulative token usage across agent calls
    4. **User Experience**: Balance thoroughness with response time
  </Accordion>
</AccordionGroup>

## Managing Multi-Agent Systems

<CardGroup cols={3}>
  <Card title="Configuration Management" icon="gear">
    * **Agent Permissions**: Carefully control which agents can call which others
    * **Role Clarity**: Ensure each agent's purpose is clearly defined and documented
    * **Version Control**: Track changes to agent configurations and relationships
  </Card>

  <Card title="Monitoring and Optimization" icon="list-check">
    * **Workflow Performance**: Monitor how long complete workflows take
    * **Agent Utilization**: Track which agents are called most frequently
    * **Success Rates**: Measure how often workflows complete successfully
    * **User Feedback**: Collect input on workflow quality and usefulness
  </Card>

  <Card title="Troubleshooting Common Issues" icon="screwdriver-wrench">
    * **Context Loss**: Information getting lost between agent handoffs
    * **Circular Calls**: Agents calling each other in loops
    * **Permission Errors**: Agents trying to call agents they don't have access to
    * **Thread Management**: Confusion about when to start new threads vs continue existing ones
  </Card>
</CardGroup>

## Getting Started

### Your First Multi-Agent Workflow

<Steps>
  <Step title="Identify a Multi-Step Task" icon="lightbulb">
    Choose something that naturally breaks into distinct phases.
  </Step>

  <Step title="Create Specialized Agents" icon="robot">
    Build 2-3 agents that handle different aspects.
  </Step>

  <Step title="Configure Relationships" icon="sitemap">
    Set up which agents can call which others.
  </Step>

  <Step title="Test the Flow" icon="list-check">
    Run through the complete workflow manually.
  </Step>

  <Step title="Refine and Expand" icon="rocket">
    Improve based on results and add complexity gradually.
  </Step>
</Steps>

### Simple Starter Workflows

<CardGroup cols={2}>
  <Card title="Research → Analysis → Report" icon="diagram-project">
    Great for information gathering and synthesis.
  </Card>

  <Card title="Draft → Review → Revise" icon="message">
    Perfect for content creation and quality control.
  </Card>

  <Card title="Collect → Process → Visualize" icon="diagram-project">
    Ideal for data analysis tasks.
  </Card>

  <Card title="Triage → Specialize → Resolve" icon="share-nodes">
    Excellent for customer support scenarios.
  </Card>
</CardGroup>

***

Multi-agent workflows unlock the full potential of AI collaboration, allowing you to create sophisticated systems that handle complex tasks through intelligent coordination between specialized agents.
