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:
- Initialization - Creates a parallel agent with the specified name and description
- Sub-Agent Connection - Connects to all agents on the sub-agents port
- 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
- Result Aggregation - Waits for all agents to complete and aggregates their responses
- 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:
- Technical Analyst - Analyzes technical aspects
- Business Analyst - Evaluates business implications
- Risk Analyst - Assesses potential risks
All three agents work simultaneously on the same query, then their insights are combined into a comprehensive response.