Understanding Connections
In Agility, connections represent the flow of data from one agent to another. When agents are connected:- Data flows from the source agent to the target agent
- Output from the source becomes input for the target
- Execution order is determined by the connection graph
Connection Visualization
Connections appear as animated arrows (”>”) flowing from source to target, making it easy to understand the data flow direction at a glance.Creating Connections
Locate the Connection Handle
Each agent card has a circular connection handle on its right side. This handle has:
- A white background
- A black border (2px)
- A right-pointing chevron icon
- Hover effect that scales it to 110%
Start the Connection
Click and hold the connection handle, then drag away from the agent. You’ll see:
- The source agent border turns green
- The cursor changes to a crosshair
- A temporary blue connection line follows your cursor
- An animated blue circle at the end of the line
- Instructions appear at the top: “Drag to a target node or release to cancel”
Target an Agent
Drag the connection line to another agent. When hovering over a potential target:
- The target agent border turns blue
- The border width increases (3px)
- The target agent scales slightly (102%)
- The agent’s z-index increases for visibility
You cannot connect an agent to itself. If you try to release on the source agent, the connection will be cancelled.
Connection States
Active Connection Mode
When creating a connection, the canvas enters “connection mode”:- Canvas cursor changes to crosshair
- Panning is temporarily disabled
- Source agent shows green border
- Other agents show blue borders as potential targets
- Temporary connection line follows the cursor
Canceling a Connection
You can cancel a connection in three ways:- Release on empty space - Let go of the mouse button without hovering over an agent
- Click the canvas - Click anywhere on the canvas background
- Press Escape - Press the Escape key
Managing Data Flow
Input Structures
When configuring an agent that receives input from other agents, you can see the available input data structure:- Open the agent’s configuration sidebar
- Look for the “Input Structure” section at the top
- See all fields available from connected source agents
- Click on field paths to insert them into prompts or configurations
Using Input Fields
In agent configurations (like Text Generator), you can reference input from connected agents:View Available Fields
The Input Structure Display shows all fields from connected agents in a collapsible tree format.
Insert Fields
Click on any field path (shown in a monospace font) to insert it into your prompt at the cursor position.
Connection Management
Viewing Connections
All connections are visible as animated arrow lines on the canvas. Each connection shows:- Multiple “greater-than” symbols (>) spaced along the line
- Direction of data flow
- Angle adjusted to match the connection path
Deleting Connections
To remove a connection:- Click on the connection line
- The connection will be removed from the workflow
- Both source and target agents remain on the canvas
Deleting Connected Agents
When you delete an agent that has connections:- The agent is removed from the canvas
- All connections to that agent are automatically deleted
- All connections from that agent are automatically deleted
- Other agents remain unaffected
Connection Patterns
Linear Flow
The simplest pattern - agents connected in a sequence:Fan-Out Pattern
One agent sends data to multiple targets:Fan-In Pattern
Multiple agents send data to one target:Complex Workflows
Combine patterns for sophisticated automations:Technical Details
Connection Objects
Each connection has:- id: Unique identifier (generated from timestamp)
- sourceId: Element ID of the source agent
- targetId: Element ID of the target agent
- type: Connection type (default)
Position Calculation
Connection lines are dynamically calculated based on:- Source agent position (center point)
- Target agent position (center point)
- Pan offset (canvas translation)
- Zoom level (if implemented)
Rendering
Connections are rendered using SVG:- Text elements for arrow symbols
- Rotation transforms for angle alignment
- Spacing calculation based on distance
- Pointer events disabled for performance
Troubleshooting
Connection Not Appearing
- Ensure both agents are fully on the canvas
- Check that you released on the target agent (not empty space)
- Verify the canvas is not in pan mode
Cannot Start Connection
- Make sure you’re clicking the connection handle (circle on right side)
- Check that you’re not in the middle of panning
- Verify the agent card is not being dragged
Visual Artifacts
- If connections appear incorrectly, try refreshing the page
- Save your workflow before refreshing
- The workflow will reload with all connections intact
Best Practices
Connection Design
- Minimize crossings - Arrange agents to reduce overlapping connection lines
- Group related agents - Keep connected agents close together
- Follow data flow - Position agents left-to-right matching data movement
- Test incrementally - Test each connection as you create it
Data Flow
- Verify inputs - Check that target agents receive expected data structure
- Use field references - Reference input fields explicitly in configurations
- Handle missing data - Consider what happens if source agent returns no data
- Test end-to-end - Run the complete workflow to verify data flows correctly
Performance
- Avoid cycles - Don’t create circular connections (A → B → A)
- Limit fan-out - Too many connections from one agent can slow execution
- Save frequently - Connections are saved with the workflow
Next Steps
- Learn how to test workflows and individual agents
- Explore common patterns for effective workflow design
- Review agent-specific documentation for input/output details