Connections
Connections define how data flows between nodes in the Pattern Builder.
Creating Connections
Drag to Connect
- Hover over a node's output handle (right side)
- Click and drag to another node's input handle (left side)
- Release to create the connection
Connection Line
The connection line shows:
- Animated dots: Data flow direction
- Line color: Connection type
- Curve: Automatic routing around nodes
Connection Types
Data Connection
Passes data from one node to the next.
- Color: Blue
- Animation: Flowing dots
- Purpose: Transfer results between nodes
Trigger Connection
Signals execution order without data transfer.
- Color: Gray
- Animation: None (dashed line)
- Purpose: Define execution sequence
Error Connection
Routes errors to error handlers.
- Color: Red
- Animation: None
- Purpose: Error handling
Connection Rules
Valid Connections
| From | To | Valid |
|---|---|---|
| Input | Agent | Yes |
| Agent | Vote/Consensus/Merge | Yes |
| Agent | Agent (sequential) | Yes |
| Vote | Output | Yes |
| Consensus | Output | Yes |
| Merge | Output | Yes |
| Any | Quality Gate | Yes |
| Quality Gate | Output | Yes |
Invalid Connections
| From | To | Reason |
|---|---|---|
| Output | Any | Output is terminal |
| Any | Input | Input is entry point |
| Node → Same Node | Self-reference | Creates cycle |
Type Compatibility
Connections validate data types:
Managing Connections
Select Connection
- Click on the connection line
- Selected connections show handles
Delete Connection
- Select and press
DeleteorBackspace - Or right-click and select "Delete"
Reroute Connection
- Delete existing connection
- Create new connection to different target
Connection Handles
Output Handles
Located on the right side of nodes:
Input Handles
Located on the left side of nodes:
Multiple Handles
Some nodes have multiple connection points:
Data Flow Patterns
Linear Flow
Simple sequential processing:
Parallel Flow
Multiple paths merge:
Branching Flow
Conditional routing:
Loop Flow
Iterative processing:
Variable References
Connections implicitly create variable references.
Automatic Variables
When you connect nodes, variables are created:
Creates:
$results- Agent results$vote.result- Voting winner$vote.confidence- Voting confidence
Referencing in Output
The Output node uses these variables:
Output Mappings:
result → $vote.result
confidence → $vote.confidence
Variable Scope
Variables are scoped to their creation point:
Step 1: $step1.result
Step 2: $step2.result (can access $step1.result)
Step 3: $step3.result (can access $step1 and $step2)
Connection Validation
Error Indicators
- Red connection: Invalid or broken
- Orange connection: Warning (may work but not recommended)
- Blue connection: Valid
Common Errors
| Error | Cause | Solution |
|---|---|---|
| "Missing target" | Connection end not attached | Connect to valid input |
| "Type mismatch" | Incompatible data types | Use compatible types |
| "Cycle detected" | Circular reference | Break the cycle |
| "Missing dependency" | Required input not connected | Add missing connection |
Validation Messages
Hover over a problematic connection to see details:
⚠️ Warning: Connection from Agent to Output skips aggregation.
Consider adding a Vote or Consensus node.
Best Practices
Keep Flows Clear
- Avoid crossing connections when possible
- Use consistent left-to-right flow
- Group related nodes together
Validate Connections
- Check for red error indicators
- Verify data type compatibility
- Ensure all required inputs are connected
Name Your Variables
- Use descriptive output variable names
- Reference variables consistently
- Document complex mappings
Use Comments
- Add Comment nodes to explain complex flows
- Group related connections with Group nodes
Troubleshooting
Connection Won't Create
- Check handle compatibility (output → input)
- Verify types are compatible
- Ensure no cycles would be created
- Check if target already has maximum connections
Connection Disappears
- May have been deleted accidentally (Cmd+Z to undo)
- Check if source or target node was deleted
- Verify connection is not hidden by another node
Data Not Flowing
- Verify connection is properly attached
- Check variable references in downstream nodes
- Ensure aggregation node is present before output