Skip to main content

Parallel Agent

A composite agent that runs multiple sub-agents concurrently, allowing parallel processing of tasks with aggregated results.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Inputs

  • Session ID (optional) - (string) A unique identifier for this specific conversation thread.
  • Name - (string) Name of the parallel agent.
  • Description - (string) Description of the parallel agent's purpose.
  • Query - (string) User query that will be sent to all sub-agents concurrently.

Options

  • Timeout (seconds) - (number) Maximum wait time in seconds for all agent operations to finish. Default: 300.

Outputs

  • Response - (string) Final aggregated response from all sub-agents.

Ports

  • sub-agents - (output) Connect to agents (LLM Agent, Sequential Agent, Parallel Agent, Loop Agent) that will execute in parallel.
  • callbacks - (output) Connect to Callback In nodes to monitor parallel agent execution.

How It Works

The Parallel Agent node executes multiple agents simultaneously:

  1. Initialization - Creates a parallel agent with the specified name and description
  2. Sub-Agent Connection - Connects to all agents on the sub-agents port
  3. Concurrent Execution - All sub-agents execute at the same time:
    • Each agent receives the same query
    • Agents run independently without waiting for each other
    • All agents share the same session state
  4. Result Aggregation - Waits for all agents to complete and aggregates their responses
  5. Response - Returns the combined results from all sub-agents

Common Use Cases

  • Multi-Perspective Analysis - Get different viewpoints on the same question
  • Parallel Research - Query multiple sources or domains simultaneously
  • Diversified Responses - Generate multiple solution approaches concurrently
  • Load Distribution - Distribute work across multiple specialized agents
  • A/B Testing - Compare outputs from different agent configurations
  • Redundancy - Use multiple agents for improved reliability

Error Handling

The node will return errors in the following cases:

  • Initialization timeout (30 seconds) - "Agent initialization timed out, cannot process message"
  • Sub-agent execution failure - Errors from failing agents are handled based on Continue On Error setting
  • Timeout during execution - All operations are terminated after the specified timeout
  • Session management errors - Issues with session service connectivity

When Continue On Error is enabled, the workflow will continue even if one or more sub-agents fail.

Usage Notes

  • No Ordering Required - Unlike Sequential Agent, parallel agents don't need a specific execution order
  • Concurrent Execution - All sub-agents run simultaneously, reducing total execution time
  • State Sharing - All sub-agents share the same session state, but concurrent updates may lead to race conditions
  • Callbacks - Before and after callbacks can be connected to monitor the parallel agent's execution
  • Nested Agents - Parallel agents can contain other sequential, parallel, or loop agents
  • Session Management - Provide a Session ID to maintain conversation context
  • Performance - Execution time is approximately equal to the slowest sub-agent (plus overhead)
  • Resource Usage - Running agents in parallel consumes more resources than sequential execution

Performance Considerations

  • Speed - Parallel execution is faster than sequential for independent tasks
  • Resource Consumption - Multiple concurrent API calls may hit rate limits or increase costs
  • Timeout Management - Set timeout values accounting for the slowest expected agent
  • Result Aggregation - The aggregation method depends on the agent's implementation

Example Workflow

A typical parallel agent workflow might look like:

  1. Technical Analyst - Analyzes technical aspects
  2. Business Analyst - Evaluates business implications
  3. Risk Analyst - Assesses potential risks

All three agents work simultaneously on the same query, then their insights are combined into a comprehensive response.