Overview
The Manage Connections endpoint provides CRUD operations for connections between workflow elements. Connections define the data flow between agents in a workflow.Endpoint
Authentication
Requires a valid Supabase JWT token:Operations
Get All Connections
Retrieves all connections for the authenticated user.Method
Example Request
Success Response (200)
Array of connection objects
Example Response
Create Connection
Creates a new connection between two workflow elements.Method
Request Body
ID of the workflow containing these elements
Element ID of the source agent (must be a valid UUID)
Element ID of the target agent (must be a valid UUID)
Example Request
Success Response (201)
Always
true for successful creationThe created connection record
Delete Connection
Removes a connection between workflow elements.Method
Request Body
UUID of the connection to delete
Example Request
Success Response (200)
Always
true for successful deletionConfirmation message
Validation Rules
UUID Validation
BothsourceElementId and targetElementId must be valid UUIDs:
Self-Connection Prevention
A connection cannot have the same source and target:Duplicate Prevention
The database enforces unique constraint on(workflow_id, source_element_id, target_element_id), preventing duplicate connections.
Error Responses
400 Bad Request
Missing parameters:401 Unauthorized
404 Not Found
500 Internal Server Error
Database Schema
Connections are stored in theagent_connections table:
Usage Pattern
- Canvas Interaction: User drags from source agent’s output port to target agent’s input port
- Create Connection: UI calls POST endpoint with element IDs
- Visual Update: Connection line appears on canvas
- Delete Connection: User clicks connection and presses delete, UI calls DELETE endpoint
- Load Connections: On workflow load, UI calls GET endpoint to retrieve all connections
Data Flow
Connections enable data flow between agents:- Output from source agent is available to target agent
- Target agent can use placeholders like
{{input.text}}to access source data - Multiple connections create complex data pipelines
Row Level Security
Theagent_connections table uses RLS to ensure:
- Users can only access their own connections
- Connections are automatically filtered by
user_id - Cross-user access is prevented
See Also
- Connections Database Schema - Detailed database structure
- Connections Concept - How connections work in workflows
- Run Workflow - How connections are used during execution