Skip to main content

What are Agentflows?

Agentflows are Flowise’s advanced workflow system designed for multi-agent systems, workflow orchestration, and complex AI automation. Unlike chatflows (single-agent systems), agentflows enable multiple AI agents to work together, each with specialized roles and capabilities.
Agentflows are ideal for complex workflows requiring coordination between multiple specialized agents, sequential processing, or advanced decision-making logic.

Agentflow Versions

Flowise supports two versions of agentflows: The latest version with improved performance, better agent coordination, and enhanced features:
  • Enhanced agent communication protocols
  • Better memory management across agents
  • Improved error handling and recovery
  • Advanced workflow orchestration
  • New agent types and capabilities
All new agentflow projects should use V2. V1 is maintained for backward compatibility but is deprecated.

V1 (Deprecated)

The original multi-agent system. While still functional, it’s recommended to migrate to V2:
// V1 Deprecation Notice
if (agentflowVersion === 'v1' && showDeprecationNotice) {
  // Warning: "V1 Agentflows are deprecated. 
  // We recommend migrating to V2 for improved performance 
  // and continued support."
}

Why Agentflows Matter

Agentflows unlock capabilities beyond simple chatbots:
  • Specialized Agents: Each agent focuses on specific tasks (research, writing, code review)
  • Workflow Orchestration: Define complex, multi-step processes
  • Parallel Processing: Multiple agents work simultaneously
  • Advanced Decision Making: Agents can route tasks based on context
  • Enterprise Scale: Handle complex business processes

Agentflow vs Chatflow

FeatureChatflowAgentflow
Agent CountSingleMultiple
ComplexitySimple to ModerateModerate to Complex
Use CaseQ&A, RAG, SupportResearch, Analysis, Automation
CoordinationN/ABuilt-in orchestration
Best ForDirect interactionsMulti-step workflows

Core Structure

Type Definitions

enum EnumChatflowType {
  CHATFLOW = 'CHATFLOW',      // Single agent
  AGENTFLOW = 'AGENTFLOW',    // Multi-agent V2
  MULTIAGENT = 'MULTIAGENT',  // Multi-agent V1 (deprecated)
  ASSISTANT = 'ASSISTANT'     // OpenAI Assistant
}

FlowData Schema

Agentflows extend the basic chatflow structure:
{
  id: string
  name: string
  flowData: string            // Contains agent nodes and orchestration logic
  type: 'AGENTFLOW' | 'MULTIAGENT'
  category: string
  deployed: boolean
  workspaceId: string
  createdDate: Date
  updatedDate: Date
}

Agent Node Types

Agentflows use specialized node types:

1. Sequential Agents

Agents execute tasks in a defined order:

2. Supervisor Pattern

A supervisor agent coordinates worker agents:

3. State Machine Agents

Agents transition through defined states:
// Example state transitions
states: {
  'research': ['analyze', 'gather_more'],
  'analyze': ['report', 'research'],
  'report': ['complete', 'revise']
}

Creating an Agentflow

Step 1: Choose Version

Select V2 for new projects:
// Navigation routing based on version
const addNew = () => {
  if (agentflowVersion === 'v2') {
    navigate('/v2/agentcanvas')
  } else {
    navigate('/agentcanvas')  // V1 - deprecated
  }
}

Step 2: Design Agent Roles

Define what each agent will do: Example: Content Creation Pipeline
  1. Research Agent: Gathers information from multiple sources
  2. Writer Agent: Creates initial draft based on research
  3. Editor Agent: Reviews and improves content
  4. SEO Agent: Optimizes for search engines
  5. Fact-Checker Agent: Verifies claims and citations

Step 3: Build the Flow

Step 4: Configure Agent Communication

Agents share context through:
  • Shared Memory: All agents access common conversation history
  • State Passing: Explicit data transfer between agents
  • Tool Results: Output from one agent becomes input to another

Real-World Example: Customer Support Automation

// Agentflow configuration
{
  "name": "Multi-Tier Support System",
  "type": "AGENTFLOW",
  "agents": [
    {
      "name": "Triage Agent",
      "role": "Classify incoming support requests",
      "tools": ["ticket_classifier", "urgency_detector"],
      "nextAgents": ["FAQ Agent", "Technical Agent", "Escalation Agent"]
    },
    {
      "name": "FAQ Agent",
      "role": "Handle common questions",
      "tools": ["knowledge_base_search"],
      "condition": "confidence > 0.8"
    },
    {
      "name": "Technical Agent",
      "role": "Debug technical issues",
      "tools": ["log_analyzer", "system_checker"],
      "condition": "issue_type == 'technical'"
    },
    {
      "name": "Escalation Agent",
      "role": "Route to human support",
      "tools": ["ticket_creator", "email_notifier"],
      "condition": "requires_human == true"
    }
  ]
}

Agent Icons & Visualization

Agentflows use special icons to distinguish agent types:
// From source code
const AGENTFLOW_ICONS = [
  { name: 'supervisorAgent', icon: '👔' },
  { name: 'workerAgent', icon: '👷' },
  { name: 'sequentialAgent', icon: '📋' },
  { name: 'stateAgent', icon: '🔄' }
]

// Icon resolution logic
const foundIcon = AGENTFLOW_ICONS.find(
  (icon) => icon.name === node.data.name
)
if (foundIcon) {
  icons[agentflowId].push(foundIcon)
} else {
  // Fallback to standard node icon
  const imageSrc = `${baseURL}/api/v1/node-icon/${node.data.name}`
  images[agentflowId].push({ imageSrc, label: node.data.label })
}

Agentflow Features

1. Version Toggle

Switch between V1 and V2 agentflows:
<ToggleButtonGroup value={agentflowVersion}>
  <ToggleButton value='v2'>
    <Chip label='NEW' /> V2
  </ToggleButton>
  <ToggleButton value='v1'>
    V1
  </ToggleButton>
</ToggleButtonGroup>

2. Agent Memory Management

Agentflows support advanced memory patterns:
  • Individual Memory: Each agent maintains its own context
  • Shared Memory: All agents access global state
  • Hierarchical Memory: Parent agents pass context to children

3. Conditional Routing

Route to different agents based on conditions:
if (intent === 'technical_question') {
  routeToAgent('TechnicalExpertAgent')
} else if (intent === 'billing') {
  routeToAgent('BillingAgent')
} else {
  routeToAgent('GeneralSupportAgent')
}

Performance Considerations

Agentflows involve multiple LLM calls, which can impact:
  • Latency: Sequential agents increase response time
  • Cost: More agents = more API calls
  • Complexity: Debugging multi-agent interactions is harder

Optimization Tips

  1. Parallel Processing: Run independent agents simultaneously
  2. Smart Routing: Skip unnecessary agents with conditions
  3. Caching: Store intermediate results
  4. Model Selection: Use faster/cheaper models for simple agents

Common Agentflow Patterns

Pattern 1: Research Pipeline

Query Agent → Search Agent → Synthesize Agent → Fact Check Agent → Report Agent

Pattern 2: Code Review System

Code Parser → Linter Agent → Security Agent → Performance Agent → Style Agent → Summary Agent

Pattern 3: Content Moderation

Content Intake → Toxicity Agent → Bias Agent → Factuality Agent → Decision Agent → Action

Migration from V1 to V2

To migrate an existing V1 agentflow:
  1. Export your V1 agentflow JSON
  2. Create a new V2 agentflow
  3. Recreate agents with updated V2 nodes
  4. Test thoroughly - agent behavior may differ
  5. Update any API integrations

API Reference

List Agentflows

# V2 Agentflows
GET /api/v1/chatflows?type=AGENTFLOW

# V1 Agentflows (deprecated)
GET /api/v1/chatflows?type=MULTIAGENT

Get Specific Agentflow

GET /api/v1/chatflows/:id

Determine Canvas Route

const goToCanvas = (selectedAgentflow) => {
  if (selectedAgentflow.type === 'AGENTFLOW') {
    navigate(`/v2/agentcanvas/${selectedAgentflow.id}`)
  } else {
    navigate(`/agentcanvas/${selectedAgentflow.id}`)  // V1
  }
}

Troubleshooting

Agent Not Executing

  • Check agent dependencies are met
  • Verify tool configurations
  • Ensure proper routing conditions
  • Check agent execution order

Infinite Loops

  • Review state transitions
  • Add maximum iteration limits
  • Implement proper exit conditions

Memory Issues

  • Clear shared memory between runs
  • Limit conversation history length
  • Use memory summarization for long interactions

Build docs developers (and LLMs) love