DocsNodesAISupervisor Node

Supervisor Node

Loading node sections...

Overview

The Supervisor Node is an advanced AI component that provides oversight and management capabilities for workflow execution. It can monitor the performance of other nodes, make decisions about workflow routing, and ensure quality control throughout the process.

Supervisor Node

Node Type Information

TypeDescriptionStatus
Batch TriggerStarts the flow on a schedule or batch event. Ideal for periodic data processing.❌ False
Event TriggerStarts the flow based on external events (e.g., webhook, user interaction).❌ False
ActionExecutes a task or logic as part of the flow (e.g., API call, transformation).✅ True

This node is an Action node that monitors and manages workflow execution while providing oversight and control capabilities.

Features

Key Functionalities
  1. Multi-Agent Coordination: Manages multiple agent paths dynamically, ensuring structured workflow execution.
  2. Memory Retention: Stores and recalls context from prior messages, enabling an ongoing conversation-like experience.
  3. Agent Path Definition: Supports multiple agent branches, allowing customized execution flows.
  4. Loop Control: Manages iterative agent execution with stopping conditions for efficient process completion.
Benefits
  1. Scalability: Supports multiple agents within a single node, enabling scalable AI flow.
  2. Efficient Context Handling: Reduces redundant data collection by recalling user-provided information.
  3. Adaptive Execution: Allows for flexible branching based on AI-generated responses.
  4. User-Centric Design: Provides a visual representation of multi-agent execution paths.

What Can I Build?

  • AI-powered personal assistants that dynamically route tasks across sub-agents.
  • Multi-step flow for data collection, processing, and decision-making.
  • Automated AI systems that require iterative questioning to refine responses.
  • Intelligent customer support agents that engage in structured dialogues.

Prompt Examples

Research + Writer Agent

Coordinates a Research agent and a Writer agent to produce final content. Each agent becomes a branch in your flow, add the relevant nodes inside each.

System Prompt

You are a supervisor coordinating two agents: Research and Writer.
First, send the task to the Research agent to gather information on the topic.
Then pass that research to the Writer agent to produce a clear, structured response.
Stop once the Writer has completed the response.

Agent Paths

NameDescription
ResearchSearches and retrieves relevant information on the given topic
WriterTakes the research and writes a clear, structured response

Settings

  • Max Iterations: 5
  • Stop Word: DONE

Customer Support Triage

Collects the user’s issue and routes to the right agent.

System Prompt

You are a customer support supervisor.
Ask the user to describe their issue, then route to the correct agent:
Billing for payment issues, Technical for product problems.
Stop once the issue is resolved.

Agent Paths

NameDescription
BillingHandles payment, invoice, and subscription issues
TechnicalHandles bugs, errors, and product problems

Settings

  • Max Iterations: 5
  • Stop Word: RESOLVED

The Supervisor loops through agents until the Stop Word appears in the response or Max Iterations is reached. Always set both to avoid infinite loops.

Setup

Configuring the Supervisor Node

  1. Define the Agent Paths to specify branching logic.
  2. Set up the Prompt Template to control AI responses.
  3. Assign an LLM Model for text generation.
  4. Configure Stop Words and Iteration Limits for loop control.

Deployment

  1. Integrate the Supervisor Node into the workflow.
  2. Connect relevant agent nodes for branching execution.
  3. Deploy the project and trigger workflow execution.

Configuration Reference

ParameterDescriptionExample Value
PromptsAdd prompts for system,users and assistantsSystem Prompt, User Prompt
Agent PathsDefines execution paths for multiple agents.Agent 1, Agent 2
Memory RetentionRetains context across iterations.Enabled
Max IterationsSets the maximum loops before termination.5
Stop WordTerminates execution when a condition is met.end
LLM ModelSelects the AI model for text generation.GPT-4 Turbo

Low-Code Example

nodes:
  - nodeId: agentNode_960
    nodeType: agentNode
    nodeName: Supervisor
    values:
      tools: []
      agents:
        - name: Research
          schema: {}
          description: Agent 1 description
        - name: Writer
          schema: {}
          description: Agent 2 description
      prompts:
        - id: 9ed337ec-a4c0-4885-9066-f2853347d20b
          role: system
          content: >-
            Research on the topic {{triggerNode_1.output.topic}} and pass on
            your search to the writer to give the ideal text.
      messages: '[]'
      stopWord: ''
      connectedTo: agentLoopEndNode_242
      maxIterations: 5
      generativeModelName:
        type: generator/text
        model_name: gpt-4o-mini-2024-07-18
        credentialId: f6930a0d-9947-472c-b64b-2244a131cad0
        provider_name: openai
        credential_name: OPEN_AI_KEY
    needs:
      - triggerNode_1
      - agentLoopEndNode_242
    connections:
      - condition: Research
        value: webSearchNode_852
        type: conditionEdge
        invisible: false
      - condition: Writer
        value: LLMNode_238
        type: conditionEdge
        invisible: false
      - condition: Agent Loop End
        value: agentLoopEndNode_242
        type: agentLoopEdge
        invisible: true

Output

A nested object containing the output generated by the Supervisor Node. This depends and modifies based on the paths and agents defined in the configuration.

Troubleshooting

Common Issues

ProblemSolution
Invalid API KeyEnsure the API key is correct and has not expired.
Dynamic Content Not LoadedIncrease the Wait for Page Load time in the configuration.

Debugging

  1. Check Lamatic Flow logs for error details.
  2. Verify API Key.

Was this page useful?

Subscribe to updates