Purpose
The Parallel node executes multiple branches simultaneously. Each branch runs independently and in parallel, and the workflow continues only after all branches complete. Use Parallel nodes to maximize throughput when processing independent tasks. Parallel execution is essential for AI workflows where multiple agents need to analyze the same input from different perspectives, or when you need to process multiple items simultaneously.How parallel execution works
When execution reaches a Parallel node:Branch initialization
All branches within the Parallel node are initialized simultaneously. Each branch receives the same input data from the variable store.
Concurrent execution
Each branch executes its activities independently. Branches don’t wait for each other — they run at the same time.
No cross-branch communication
Branches cannot communicate with each other during execution. Each branch operates on its own copy of the variable store.
Wait for completion
The workflow waits for ALL branches to complete before proceeding to the next node after the Parallel node.
Parallel nodes leverage Temporal’s concurrent execution capabilities. Each branch runs as a separate activity, enabling true parallelism across multiple workers.
Configuration
Configure a Parallel node to define branches and how they execute.Add branches
Create two or more branches within the Parallel node. Each branch is a sequence of activities:- Branch 1: Activity A → Activity B → Activity C
- Branch 2: Activity D → Activity E
- Branch 3: Activity F → Activity G → Activity H
Branch naming
Give each branch a descriptive name. Branch names become keys in the variable store for accessing outputs:technical_evaluation— Branch that evaluates technical requirementsvendor_assessment— Branch that assesses vendor capabilitiesfinancial_analysis— Branch that analyzes financial terms
Input distribution
Configure how input data is distributed to branches:- Same input for all branches — Each branch receives identical input (most common)
- Branch-specific input — Each branch receives different data
Execution settings
Configure how the Parallel node behaves:- Wait for all — Workflow continues only after all branches complete (default)
- Wait for first — Workflow continues as soon as the first branch completes
- Wait for majority — Workflow continues when a majority of branches complete
- Timeout — Maximum wait time for all branches to complete
Use cases
Parallel nodes enable powerful patterns for AI orchestration.Multi-perspective analysis
Analyze the same input from multiple perspectives simultaneously. Example: RFP (Request for Proposal) analysisTechnical evaluation
Branch 1
- Technical requirements agent
- Evaluate solution architecture
- Assess technical feasibility
- Score: 0-100
Vendor assessment
Branch 2
- Vendor research agent
- Check vendor reputation
- Review past performance
- Score: 0-100
Commercial analysis
Branch 3
- Financial analysis agent
- Evaluate pricing
- Assess commercial terms
- Score: 0-100
Compliance review
Branch 4
- Compliance agent
- Check regulatory requirements
- Assess risks
- Score: 0-100
Timeline analysis
Branch 5
- Timeline assessment agent
- Evaluate delivery schedule
- Check resource availability
- Score: 0-100
- Sequential: ~5 minutes (5 agents × 1 minute each)
- Parallel: ~1 minute (all agents run simultaneously)
Document verification (KYB/KYC)
Process multiple documents simultaneously for Know Your Business or Know Your Customer workflows. Example: Business verificationParallel document processing
Three branches process documents simultaneously:Branch 1: Emirates ID verification
- Vision model agent extracts Emirates ID data
- Validates document authenticity
- Extracts: name, ID number, expiry date
- Vision model agent extracts trade license data
- Validates license status
- Extracts: company name, license number, activities
- Vision model agent extracts passport data
- Validates document authenticity
- Extracts: name, passport number, nationality
Data cross-validation
After parallel completion, a validation agent checks consistency:
- Do names match across documents?
- Are all documents valid and not expired?
- Does the trade license owner match the passport holder?
- Sequential: ~3 minutes (3 documents × 1 minute each)
- Parallel: ~1 minute (all documents processed simultaneously)
Multi-language processing
Process the same content in multiple languages simultaneously. Example: Global announcement distributionEnglish version
Branch 1
- Translation agent (if needed)
- Content formatting agent
- Cultural adaptation agent
Arabic version
Branch 2
- Translation agent
- RTL formatting agent
- Cultural adaptation agent
French version
Branch 3
- Translation agent
- Content formatting agent
- Cultural adaptation agent
Spanish version
Branch 4
- Translation agent
- Content formatting agent
- Cultural adaptation agent
Competitive intelligence gathering
Research multiple competitors simultaneously. Example: Market analysis Each branch researches one competitor:- Branch 1: Competitor A analysis
- Branch 2: Competitor B analysis
- Branch 3: Competitor C analysis
- Branch 4: Competitor D analysis
- Research agent gathers public information
- Analysis agent evaluates strengths/weaknesses
- Pricing agent extracts pricing information
Output collection and merging
After all branches complete, their outputs are merged into the variable store. Understanding how to access this merged data is crucial.Branch output structure
Each branch’s output is stored under its branch name:Accessing parallel outputs
Reference branch outputs in downstream nodes: Specific branch output:Best practices
Use parallel for independent tasks
Use parallel for independent tasks
Only use Parallel nodes when branches are truly independent. If branch B needs results from branch A, don’t run them in parallel — run them sequentially.
Balance branch complexity
Balance branch complexity
Try to design branches with similar execution times. If one branch takes 10 seconds and another takes 5 minutes, the workflow waits for the slowest branch.
Name branches descriptively
Name branches descriptively
Branch names appear in the variable store and in execution logs. Use clear names that indicate what each branch does.
Add synthesis step after parallel
Add synthesis step after parallel
After parallel execution, add a synthesis step that combines results. Don’t try to merge results manually — let an agent do it intelligently.
Handle partial failures
Handle partial failures
Use Condition nodes after the Parallel node to check if all branches succeeded. Route to error handling if any branch failed.
Set appropriate timeouts
Set appropriate timeouts
Set timeouts at the Parallel node level, not just individual activities. This prevents indefinite waits if a branch gets stuck.
Consider resource limits
Consider resource limits
Each branch consumes compute resources. Running 20 branches simultaneously may hit resource limits. Monitor and scale appropriately.
Advanced patterns
Nested parallel execution
You can nest Parallel nodes within branches for complex orchestration:Dynamic branch creation
Use a ForEach node before a Parallel node to dynamically create parallel tasks based on input data:Conditional parallel execution
Use Condition nodes within parallel branches to create adaptive workflows:Performance considerations
Execution time
Parallel execution time = max(branch execution times) + overhead Example:- Branch A: 30 seconds
- Branch B: 90 seconds
- Branch C: 45 seconds
- Total parallel time: ~90 seconds (+ small overhead)
- Total sequential time: 30 + 90 + 45 = 165 seconds
Resource utilization
Each branch consumes resources:- Compute: Each agent execution uses CPU/GPU
- Memory: Each branch maintains its own state
- API costs: Each LLM call incurs API costs