Agent Connections
Enable communication between agents.
Overview
Agent-to-agent (A2A) connections allow:
- Cross-agent messaging
- Workflow triggers
- State sharing
- Event subscriptions
Connection Types
Webhook
POST events to another agent:
json
{
"connection_type": "webhook",
"config": {
"url": "https://agent-b.example.com/webhook",
"events": ["workflow.complete", "message.received"]
}
}Direct
Direct Durable Object communication:
json
{
"connection_type": "direct",
"config": {
"target_agent_id": "agent-b"
}
}Creating Connections
Via API
bash
curl -X POST .../agent-connections \
-d '{
"source_agent_id": "agent-a",
"target_agent_id": "agent-b",
"connection_type": "webhook",
"config": {
"events": ["workflow.complete"]
}
}'Event Types
| Event | Description |
|---|---|
workflow.complete | Workflow finished |
workflow.error | Workflow failed |
message.received | New message arrived |
schedule.executed | Schedule ran |
browser.action | Browser action completed |
Use Cases
Workflow Chaining
Agent A completes → triggers Agent B:
json
{
"events": ["workflow.complete"],
"filter": {
"workflow_id": "step-1"
}
}Message Routing
Forward messages between agents:
json
{
"events": ["message.received"],
"filter": {
"channel": "support"
}
}State Sync
Share state updates:
json
{
"events": ["state.update"],
"config": {
"fields": ["contacts", "config"]
}
}Security
Authentication
Connections include auth tokens:
json
{
"config": {
"auth": {
"type": "bearer",
"token": "{{secrets.agent_b_token}}"
}
}
}Access Control
Only admins can create connections.
API Reference
See Agent Connections API for complete endpoint documentation.