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

# Workflow Agents

> Orchestrate multiple agents for complex, multi-step educational processes

# Workflow Agents

Workflow agents are specialized orchestrators that coordinate multiple agents or execute complex, multi-step processes. Unlike regular agents that respond to individual requests, workflow agents use deterministic logic to control how and when other agents are executed, enabling sophisticated educational workflows.

<Note>
  Workflow agents are perfect for complex educational processes that require multiple steps, different types of expertise, or coordination between various educational tasks.
</Note>

## Key Differences from Regular Agents

<Tabs>
  <Tab title="Regular Agents">
    * Respond to individual requests
    * Use LLM reasoning for all decisions
    * Work independently with their tools
    * Provide direct answers to questions
    * Best for single-task scenarios
  </Tab>

  <Tab title="Workflow Agents">
    * Orchestrate multiple agents or processes
    * Use coded logic for execution flow
    * Coordinate between different specialists
    * Manage complex, multi-step workflows
    * Best for comprehensive educational projects
  </Tab>
</Tabs>

## Workflow Agent Types

### Sequential Workflows

Execute agents one after another, passing results between them for comprehensive educational pipelines.

<Accordion title="How Sequential Workflows Work">
  1. **Agent 1** completes its task and produces output
  2. **Agent 2** receives Agent 1's output as context and builds upon it
  3. **Agent 3** receives outputs from both previous agents
  4. Process continues until all agents have executed
  5. **Final result** combines all agent outputs into a comprehensive deliverable
</Accordion>

**Perfect for**:

* Content creation pipelines (research → design → assess)
* Curriculum development (outline → content → activities → assessments)
* Quality assurance processes (create → review → refine → approve)

**Example**: Content Creation Pipeline

```text theme={null}
Research Agent → Curriculum Designer → Assessment Designer
```

1. Research Agent gathers information on the topic
2. Curriculum Designer creates structured learning content
3. Assessment Designer develops aligned assessments

### Scheduled Workflows

Execute agents at specific times or intervals for automated educational tasks.

<Accordion title="Schedule Types">
  * **Immediate**: Execute right away
  * **At Time**: Execute at a specific date and time
  * **Cron**: Execute on recurring schedules (daily, weekly, etc.)
  * **Interval**: Execute every X minutes/hours/days
</Accordion>

**Perfect for**:

* Regular curriculum reviews and updates
* Automated content quality checks
* Periodic assessment analysis
* Scheduled report generation

**Example**: Weekly Curriculum Review

```text theme={null}
Schedule: Every Monday at 9 AM
Agent: Curriculum Designer
Task: Review and update weekly lesson plans
```

### Loop Workflows

Repeat agent execution until specific conditions are met, perfect for iterative improvement processes.

<Accordion title="Termination Conditions">
  * **Maximum Iterations**: Safety limit (required)
  * **Success Condition**: Stop when specific text appears in results
  * **No Changes**: Stop when consecutive results are identical
  * **Timeout**: Stop after specified time limit
  * **Custom Conditions**: Advanced LLM-based evaluation (planned)
</Accordion>

**Perfect for**:

* Iterative content improvement
* Assessment question refinement
* Curriculum optimization
* Quality assurance loops

**Example**: Content Quality Loop

```text theme={null}
Content Creator → Review → Improve → Check Quality → Repeat until "excellent quality" achieved
```

### Router Workflows

Intelligently route requests to appropriate specialist agents based on content analysis.

<Accordion title="How Router Workflows Work">
  1. **Analyze Request**: Use LLM to understand the request type and requirements
  2. **Select Agent**: Choose the most appropriate specialist agent
  3. **Route and Execute**: Send the request to the selected agent
  4. **Return Results**: Provide the specialist's response to the user
</Accordion>

**Perfect for**:

* General help desks that need to route to specialists
* Multi-subject educational support
* Adaptive learning systems
* Intelligent task delegation

**Example**: Educational Support Router

```text theme={null}
Student Question → Analyze Subject → Route to Math Tutor OR Science Tutor OR Writing Coach
```

### Parallel Workflows

Execute multiple agents simultaneously for comprehensive analysis or rapid content generation.

<Accordion title="Parallel Execution Benefits">
  * **Speed**: Multiple agents work simultaneously
  * **Comprehensive Coverage**: Different perspectives on the same topic
  * **Efficiency**: Parallel processing reduces total time
  * **Diverse Outputs**: Multiple approaches to the same problem
</Accordion>

**Perfect for**:

* Multi-perspective content analysis
* Rapid curriculum development
* Comprehensive assessment creation
* Research from multiple angles

**Example**: Comprehensive Topic Analysis

```text theme={null}
Content Creator + Assessment Designer + Curriculum Designer (all working on the same topic simultaneously)
```

### Evaluate/Optimize Workflows

Execute an agent, then have a review agent evaluate and provide feedback, repeating until quality standards are met.

<Accordion title="Evaluation Cycle">
  1. **Execution Agent** creates content or completes task
  2. **Review Agent** evaluates the output and provides feedback
  3. **Execution Agent** improves based on feedback
  4. **Repeat** until quality metrics are achieved or cycle limit reached
</Accordion>

**Perfect for**:

* Content quality assurance
* Assessment validation
* Curriculum review and improvement
* Iterative educational design

**Example**: Assessment Quality Assurance

```text theme={null}
Assessment Designer creates quiz → Assessment Evaluator reviews → Designer improves → Repeat until high quality
```

## Creating Workflow Agents

### Basic Setup

<Steps>
  <Step title="Access Workflow Creation">
    Navigate to Agents → Workflows tab and click "Create Workflow"
  </Step>

  <Step title="Choose Workflow Type">
    Select the appropriate workflow type based on your educational process needs
  </Step>

  <Step title="Configure Workflow">
    Set up agents, execution parameters, and termination conditions
  </Step>

  <Step title="Test and Deploy">
    Test the workflow with sample inputs and deploy for regular use
  </Step>
</Steps>

### Sequential Workflow Configuration

<Tabs>
  <Tab title="Basic Setup">
    ```json theme={null}
    {
      "type": "sequential",
      "subAgents": [
        { "agentName": "content_creator" },
        { "agentName": "curriculum_designer" },
        { "agentName": "assessment_designer" }
      ],
      "passResults": true,
      "combineResults": true
    }
    ```
  </Tab>

  <Tab title="Advanced Options">
    ```json theme={null}
    {
      "continueOnError": false,
      "stepTimeoutMs": 300000,
      "stepMessages": [
        "Research the topic thoroughly",
        "Create curriculum based on research",
        "Generate assessments for curriculum"
      ],
      "context": {
        "gradeLevel": "high_school",
        "subject": "biology"
      }
    }
    ```
  </Tab>
</Tabs>

### Loop Workflow Configuration

<Tabs>
  <Tab title="Basic Loop">
    ```json theme={null}
    {
      "type": "loop",
      "subAgent": { "agentName": "content_creator" },
      "terminationConditions": {
        "maxIterations": 5,
        "successCondition": "content quality is excellent"
      },
      "passResults": true
    }
    ```
  </Tab>

  <Tab title="Advanced Loop">
    ```json theme={null}
    {
      "terminationConditions": {
        "maxIterations": 3,
        "timeoutMs": 600000,
        "noChangesCondition": true,
        "iterationTimeoutMs": 120000
      },
      "delayBetweenIterationsMs": 2000,
      "exponentialBackoff": true,
      "continueOnError": false
    }
    ```
  </Tab>
</Tabs>

### Scheduled Workflow Configuration

<Tabs>
  <Tab title="Cron Schedule">
    ```json theme={null}
    {
      "type": "scheduled",
      "targetAgent": { "agentName": "curriculum_designer" },
      "scheduleType": "cron",
      "cronExpression": "0 9 * * 1-5",
      "timezone": "America/New_York",
      "customMessage": "Perform daily curriculum review"
    }
    ```
  </Tab>

  <Tab title="One-Time Schedule">
    ```json theme={null}
    {
      "scheduleType": "at_time",
      "executionTime": "2024-12-25T10:00:00Z",
      "maxExecutions": 1,
      "customMessage": "Generate holiday learning activities"
    }
    ```
  </Tab>
</Tabs>

## Real-World Educational Workflows

### Comprehensive Course Development

<Accordion title="Sequential Workflow: Complete Course Creation">
  **Agents**: Knowledge Engineer → Curriculum Designer → Content Creator → Assessment Designer → Learning Tutor

  **Process**:

  1. **Knowledge Engineer** creates topic hierarchy and skill mappings
  2. **Curriculum Designer** structures learning progression and modules
  3. **Content Creator** generates educational materials and resources
  4. **Assessment Designer** creates aligned assessments and rubrics
  5. **Learning Tutor** reviews for student accessibility and engagement

  **Timeline**: 2-4 hours for comprehensive course development
</Accordion>

### Adaptive Content Improvement

<Accordion title="Loop Workflow: Iterative Content Refinement">
  **Agent**: Content Creator with quality evaluation

  **Process**:

  1. Create initial content version
  2. Evaluate content quality and student appropriateness
  3. Identify areas for improvement
  4. Refine content based on evaluation
  5. Repeat until quality threshold is met (max 5 iterations)

  **Termination**: "Content meets high quality standards" or 5 iterations
</Accordion>

### Multi-Subject Support System

<Accordion title="Router Workflow: Intelligent Student Support">
  **Router Logic**: Analyze student question → Route to appropriate subject specialist

  **Specialists**:

  * Math Tutor (for mathematical concepts and problem-solving)
  * Science Tutor (for scientific concepts and experiments)
  * Writing Coach (for language arts and communication)
  * History Guide (for historical context and analysis)

  **Benefits**: Students get specialized help regardless of subject area
</Accordion>

### Assessment Quality Assurance

<Accordion title="Evaluate/Optimize Workflow: Assessment Validation">
  **Execution Agent**: Assessment Designer\
  **Review Agent**: Assessment Evaluator

  **Cycle**:

  1. Assessment Designer creates quiz/test
  2. Assessment Evaluator reviews for quality, bias, alignment
  3. Assessment Designer improves based on feedback
  4. Repeat until evaluation score > 0.8 or 3 cycles completed

  **Quality Metrics**: Alignment, clarity, appropriate difficulty, bias-free
</Accordion>

### Scheduled Curriculum Maintenance

<Accordion title="Scheduled Workflow: Regular Content Updates">
  **Schedule**: Every Sunday at 6 PM\
  **Agent**: Curriculum Designer\
  **Task**: Review and update weekly lesson plans based on student progress data

  **Benefits**:

  * Consistent curriculum maintenance
  * Data-driven improvements
  * Reduced manual administrative work
  * Always current educational content
</Accordion>

## Monitoring and Management

### Workflow Status Tracking

<Tabs>
  <Tab title="Execution Progress">
    * Real-time progress updates
    * Current step and agent status
    * Estimated completion time
    * Tool usage and results
  </Tab>

  <Tab title="Results Analysis">
    * Individual agent outputs
    * Combined workflow results
    * Performance metrics
    * Error logs and debugging info
  </Tab>

  <Tab title="Schedule Management">
    * Next execution times
    * Execution history
    * Success/failure rates
    * Schedule modifications
  </Tab>
</Tabs>

### Performance Optimization

<CardGroup cols={2}>
  <Card title="Execution Time" icon="clock">
    Monitor workflow duration and optimize agent selection and configuration for efficiency
  </Card>

  <Card title="Resource Usage" icon="cpu">
    Track computational costs and adjust model selection and parameters accordingly
  </Card>

  <Card title="Success Rates" icon="check">
    Analyze workflow completion rates and identify common failure points
  </Card>

  <Card title="Quality Metrics" icon="star">
    Measure output quality and user satisfaction to improve workflow design
  </Card>
</CardGroup>

## Best Practices

### Workflow Design

<AccordionGroup>
  <Accordion title="Start Simple">
    Begin with 2-3 agents in a workflow before building more complex orchestrations. Test thoroughly at each stage.
  </Accordion>

  <Accordion title="Clear Handoffs">
    Ensure each agent in a sequence receives appropriate context and clear instructions about their role in the larger process.
  </Accordion>

  <Accordion title="Error Handling">
    Plan for agent failures and decide whether workflows should continue or stop when individual agents encounter problems.
  </Accordion>

  <Accordion title="Timeout Management">
    Set appropriate timeouts for individual steps and overall workflows to prevent hanging processes.
  </Accordion>
</AccordionGroup>

### Educational Effectiveness

<AccordionGroup>
  <Accordion title="Align with Learning Goals">
    Ensure workflow outputs directly support specific learning objectives and educational outcomes.
  </Accordion>

  <Accordion title="Quality Assurance">
    Include review and validation steps in workflows that produce student-facing content or assessments.
  </Accordion>

  <Accordion title="Accessibility">
    Consider diverse learning needs and ensure workflow outputs are accessible to all students.
  </Accordion>

  <Accordion title="Continuous Improvement">
    Regularly review workflow performance and update configurations based on educational effectiveness.
  </Accordion>
</AccordionGroup>

## Troubleshooting Common Issues

<AccordionGroup>
  <Accordion title="Workflow Hangs or Times Out">
    **Causes**: Individual agents taking too long, network issues, complex requests

    **Solutions**:

    * Reduce individual step timeout limits
    * Simplify agent prompts and requests
    * Check network connectivity and service status
  </Accordion>

  <Accordion title="Poor Quality Results">
    **Causes**: Insufficient context passing, inappropriate agent selection, unclear instructions

    **Solutions**:

    * Improve context passing between agents
    * Review agent selection for each step
    * Clarify step-specific instructions and goals
  </Accordion>

  <Accordion title="Workflow Fails Frequently">
    **Causes**: Agent incompatibilities, resource limitations, configuration errors

    **Solutions**:

    * Test individual agents separately
    * Review error logs for specific failure points
    * Adjust resource limits and retry policies
  </Accordion>
</AccordionGroup>

## Advanced Features

### Conditional Logic (Planned)

Future workflow agents will support conditional branching based on agent outputs and educational context.

### Human-in-the-Loop (Planned)

Workflows will be able to pause for human review and approval at critical decision points.

### Multi-Modal Integration (Planned)

Workflows will coordinate agents that work with different media types (text, images, audio, video).

## Getting Started with Workflows

<Steps>
  <Step title="Identify a Process">
    Choose an educational process that involves multiple steps or different types of expertise
  </Step>

  <Step title="Map the Workflow">
    Identify which agents should be involved and in what order or pattern
  </Step>

  <Step title="Start Simple">
    Create a basic workflow with 2-3 agents to test the concept
  </Step>

  <Step title="Test and Iterate">
    Run the workflow with sample inputs and refine based on results
  </Step>

  <Step title="Scale and Optimize">
    Add complexity and optimize performance based on real usage patterns
  </Step>
</Steps>

<Tip>
  Begin with sequential workflows for content creation pipelines - they're the most straightforward to understand and implement effectively.
</Tip>
