Skip to content

Commit 2512767

Browse files
committed
feat(a2a): added a2a protocol
1 parent b5f55b7 commit 2512767

File tree

47 files changed

+4328
-1385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4328
-1385
lines changed

apps/docs/components/icons.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,31 @@ export function McpIcon(props: SVGProps<SVGSVGElement>) {
40614061
)
40624062
}
40634063

4064+
export function A2AIcon(props: SVGProps<SVGSVGElement>) {
4065+
return (
4066+
<svg {...props} viewBox='0 0 860 860' fill='none' xmlns='http://www.w3.org/2000/svg'>
4067+
<circle cx='544' cy='307' r='27' fill='currentColor' />
4068+
<circle cx='154' cy='307' r='27' fill='currentColor' />
4069+
<circle cx='706' cy='307' r='27' fill='currentColor' />
4070+
<circle cx='316' cy='307' r='27' fill='currentColor' />
4071+
<path
4072+
d='M336.5 191.003H162C97.6588 191.003 45.5 243.162 45.5 307.503C45.5 371.844 97.6442 424.003 161.985 424.003C206.551 424.003 256.288 424.003 296.5 424.003C487.5 424.003 374 191.005 569 191.001C613.886 191 658.966 191 698.025 191C762.366 191.001 814.5 243.16 814.5 307.501C814.5 371.843 762.34 424.003 697.998 424.003H523.5'
4073+
stroke='currentColor'
4074+
strokeWidth='48'
4075+
strokeLinecap='round'
4076+
/>
4077+
<path
4078+
d='M256 510.002C270.359 510.002 282 521.643 282 536.002C282 550.361 270.359 562.002 256 562.002H148C133.641 562.002 122 550.361 122 536.002C122 521.643 133.641 510.002 148 510.002H256ZM712 510.002C726.359 510.002 738 521.643 738 536.002C738 550.361 726.359 562.002 712 562.002H360C345.641 562.002 334 550.361 334 536.002C334 521.643 345.641 510.002 360 510.002H712Z'
4079+
fill='currentColor'
4080+
/>
4081+
<path
4082+
d='M444 628.002C458.359 628.002 470 639.643 470 654.002C470 668.361 458.359 680.002 444 680.002H100C85.6406 680.002 74 668.361 74 654.002C74 639.643 85.6406 628.002 100 628.002H444ZM548 628.002C562.359 628.002 574 639.643 574 654.002C574 668.361 562.359 680.002 548 680.002C533.641 680.002 522 668.361 522 654.002C522 639.643 533.641 628.002 548 628.002ZM760 628.002C774.359 628.002 786 639.643 786 654.002C786 668.361 774.359 680.002 760 680.002H652C637.641 680.002 626 668.361 626 654.002C626 639.643 637.641 628.002 652 628.002H760Z'
4083+
fill='currentColor'
4084+
/>
4085+
</svg>
4086+
)
4087+
}
4088+
40644089
export function WordpressIcon(props: SVGProps<SVGSVGElement>) {
40654090
return (
40664091
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25.925 25.925'>

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import type { ComponentType, SVGProps } from 'react'
66
import {
7+
A2AIcon,
78
AhrefsIcon,
89
AirtableIcon,
910
ApifyIcon,
@@ -126,6 +127,7 @@ import {
126127
type IconComponent = ComponentType<SVGProps<SVGSVGElement>>
127128

128129
export const blockTypeToIconMap: Record<string, IconComponent> = {
130+
a2a: A2AIcon,
129131
ahrefs: AhrefsIcon,
130132
airtable: AirtableIcon,
131133
apify: ApifyIcon,
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
title: A2A
3+
description: Interact with external A2A-compatible agents
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="a2a"
10+
color="#4151B5"
11+
/>
12+
13+
{/* MANUAL-CONTENT-START:intro */}
14+
The A2A (Agent-to-Agent) protocol enables Sim to interact with external AI agents and systems that implement A2A-compatible APIs. With A2A, you can connect Sim’s automations and workflows to remote agents—such as LLM-powered bots, microservices, and other AI-based tools—using a standardized messaging format.
15+
16+
Using the A2A tools in Sim, you can:
17+
18+
- **Send Messages to External Agents**: Communicate directly with remote agents, providing prompts, commands, or data.
19+
- **Receive and Stream Responses**: Get structured responses, artifacts, or real-time updates from the agent as the task progresses.
20+
- **Continue Conversations or Tasks**: Carry on multi-turn conversations or workflows by referencing task and context IDs.
21+
- **Integrate Third-Party AI and Automation**: Leverage external A2A-compatible services as part of your Sim workflows.
22+
23+
These features allow you to build advanced workflows that combine Sim’s native capabilities with the intelligence and automation of external AIs or custom agents. To use A2A integrations, you’ll need the external agent’s endpoint URL and, if required, an API key or credentials.
24+
{/* MANUAL-CONTENT-END */}
25+
26+
27+
## Usage Instructions
28+
29+
Use the A2A (Agent-to-Agent) protocol to interact with external AI agents.
30+
31+
32+
33+
## Tools
34+
35+
### `a2a_send_message`
36+
37+
Send a message to an external A2A-compatible agent.
38+
39+
#### Input
40+
41+
| Parameter | Type | Required | Description |
42+
| --------- | ---- | -------- | ----------- |
43+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
44+
| `message` | string | Yes | Message to send to the agent |
45+
| `taskId` | string | No | Task ID for continuing an existing task |
46+
| `contextId` | string | No | Context ID for conversation continuity |
47+
| `apiKey` | string | No | API key for authentication |
48+
49+
#### Output
50+
51+
| Parameter | Type | Description |
52+
| --------- | ---- | ----------- |
53+
| `content` | string | The text response from the agent |
54+
| `taskId` | string | Task ID for follow-up interactions |
55+
| `contextId` | string | Context ID for conversation continuity |
56+
| `state` | string | Task state |
57+
| `artifacts` | array | Structured output artifacts |
58+
| `history` | array | Full message history |
59+
60+
### `a2a_send_message_stream`
61+
62+
Send a message to an external A2A-compatible agent with real-time streaming.
63+
64+
#### Input
65+
66+
| Parameter | Type | Required | Description |
67+
| --------- | ---- | -------- | ----------- |
68+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
69+
| `message` | string | Yes | Message to send to the agent |
70+
| `taskId` | string | No | Task ID for continuing an existing task |
71+
| `contextId` | string | No | Context ID for conversation continuity |
72+
| `apiKey` | string | No | API key for authentication |
73+
74+
#### Output
75+
76+
| Parameter | Type | Description |
77+
| --------- | ---- | ----------- |
78+
| `content` | string | The text response from the agent |
79+
| `taskId` | string | Task ID for follow-up interactions |
80+
| `contextId` | string | Context ID for conversation continuity |
81+
| `state` | string | Task state |
82+
| `artifacts` | array | Structured output artifacts |
83+
| `history` | array | Full message history |
84+
85+
### `a2a_get_task`
86+
87+
Query the status of an existing A2A task.
88+
89+
#### Input
90+
91+
| Parameter | Type | Required | Description |
92+
| --------- | ---- | -------- | ----------- |
93+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
94+
| `taskId` | string | Yes | Task ID to query |
95+
| `apiKey` | string | No | API key for authentication |
96+
| `historyLength` | number | No | Number of history messages to include |
97+
98+
#### Output
99+
100+
| Parameter | Type | Description |
101+
| --------- | ---- | ----------- |
102+
| `taskId` | string | Task ID |
103+
| `contextId` | string | Context ID |
104+
| `state` | string | Task state |
105+
| `artifacts` | array | Output artifacts |
106+
| `history` | array | Message history |
107+
108+
### `a2a_cancel_task`
109+
110+
Cancel a running A2A task.
111+
112+
#### Input
113+
114+
| Parameter | Type | Required | Description |
115+
| --------- | ---- | -------- | ----------- |
116+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
117+
| `taskId` | string | Yes | Task ID to cancel |
118+
| `apiKey` | string | No | API key for authentication |
119+
120+
#### Output
121+
122+
| Parameter | Type | Description |
123+
| --------- | ---- | ----------- |
124+
| `cancelled` | boolean | Whether cancellation was successful |
125+
| `state` | string | Task state after cancellation |
126+
127+
### `a2a_get_agent_card`
128+
129+
Fetch the Agent Card (discovery document) for an A2A agent.
130+
131+
#### Input
132+
133+
| Parameter | Type | Required | Description |
134+
| --------- | ---- | -------- | ----------- |
135+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
136+
| `apiKey` | string | No | API key for authentication \(if required\) |
137+
138+
#### Output
139+
140+
| Parameter | Type | Description |
141+
| --------- | ---- | ----------- |
142+
| `name` | string | Agent name |
143+
| `description` | string | Agent description |
144+
| `url` | string | Agent endpoint URL |
145+
| `version` | string | Agent version |
146+
| `capabilities` | object | Agent capabilities \(streaming, pushNotifications, etc.\) |
147+
| `skills` | array | Skills the agent can perform |
148+
| `defaultInputModes` | array | Default input modes \(text, file, data\) |
149+
| `defaultOutputModes` | array | Default output modes \(text, file, data\) |
150+
151+
### `a2a_resubscribe`
152+
153+
Reconnect to an ongoing A2A task stream after connection interruption.
154+
155+
#### Input
156+
157+
| Parameter | Type | Required | Description |
158+
| --------- | ---- | -------- | ----------- |
159+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
160+
| `taskId` | string | Yes | Task ID to resubscribe to |
161+
| `apiKey` | string | No | API key for authentication |
162+
163+
#### Output
164+
165+
| Parameter | Type | Description |
166+
| --------- | ---- | ----------- |
167+
| `taskId` | string | Task ID |
168+
| `contextId` | string | Context ID |
169+
| `state` | string | Current task state |
170+
| `isRunning` | boolean | Whether the task is still running |
171+
| `artifacts` | array | Output artifacts |
172+
| `history` | array | Message history |
173+
174+
### `a2a_set_push_notification`
175+
176+
Configure a webhook to receive task update notifications.
177+
178+
#### Input
179+
180+
| Parameter | Type | Required | Description |
181+
| --------- | ---- | -------- | ----------- |
182+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
183+
| `taskId` | string | Yes | Task ID to configure notifications for |
184+
| `webhookUrl` | string | Yes | HTTPS webhook URL to receive notifications |
185+
| `token` | string | No | Token for webhook validation |
186+
| `apiKey` | string | No | API key for authentication |
187+
188+
#### Output
189+
190+
| Parameter | Type | Description |
191+
| --------- | ---- | ----------- |
192+
| `url` | string | Configured webhook URL |
193+
| `token` | string | Token for webhook validation |
194+
| `success` | boolean | Whether configuration was successful |
195+
196+
### `a2a_get_push_notification`
197+
198+
Get the push notification webhook configuration for a task.
199+
200+
#### Input
201+
202+
| Parameter | Type | Required | Description |
203+
| --------- | ---- | -------- | ----------- |
204+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
205+
| `taskId` | string | Yes | Task ID to get notification config for |
206+
| `apiKey` | string | No | API key for authentication |
207+
208+
#### Output
209+
210+
| Parameter | Type | Description |
211+
| --------- | ---- | ----------- |
212+
| `url` | string | Configured webhook URL |
213+
| `token` | string | Token for webhook validation |
214+
| `exists` | boolean | Whether a push notification config exists |
215+
216+
### `a2a_delete_push_notification`
217+
218+
Delete the push notification webhook configuration for a task.
219+
220+
#### Input
221+
222+
| Parameter | Type | Required | Description |
223+
| --------- | ---- | -------- | ----------- |
224+
| `agentUrl` | string | Yes | The A2A agent endpoint URL |
225+
| `taskId` | string | Yes | Task ID to delete notification config for |
226+
| `pushNotificationConfigId` | string | No | Push notification configuration ID to delete \(optional - server can derive from taskId\) |
227+
| `apiKey` | string | No | API key for authentication |
228+
229+
#### Output
230+
231+
| Parameter | Type | Description |
232+
| --------- | ---- | ----------- |
233+
| `success` | boolean | Whether deletion was successful |
234+
235+
236+
237+
## Notes
238+
239+
- Category: `tools`
240+
- Type: `a2a`

apps/docs/content/docs/en/tools/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pages": [
33
"index",
4+
"a2a",
45
"ahrefs",
56
"airtable",
67
"apify",

apps/sim/app/api/a2a/agents/[agentId]/route.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createLogger } from '@sim/logger'
1111
import { eq } from 'drizzle-orm'
1212
import { type NextRequest, NextResponse } from 'next/server'
1313
import { generateAgentCard, generateSkillsFromWorkflow } from '@/lib/a2a/agent-card'
14-
import type { AgentAuthentication, AgentCapabilities, AgentSkill } from '@/lib/a2a/types'
14+
import type { AgentCapabilities, AgentSkill } from '@/lib/a2a/types'
1515
import { checkHybridAuth } from '@/lib/auth/hybrid'
1616
import { loadWorkflowFromNormalizedTables } from '@/lib/workflows/persistence/utils'
1717

@@ -60,7 +60,6 @@ export async function GET(request: NextRequest, { params }: { params: Promise<Ro
6060
version: agent.agent.version,
6161
capabilities: agent.agent.capabilities as AgentCapabilities,
6262
skills: agent.agent.skills as AgentSkill[],
63-
authentication: agent.agent.authentication as AgentAuthentication,
6463
},
6564
{
6665
id: agent.workflow.id,
@@ -245,12 +244,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<R
245244
.where(eq(workflow.id, existingAgent.workflowId))
246245
.limit(1)
247246

248-
const skills = generateSkillsFromWorkflow(
249-
existingAgent.workflowId,
250-
wf?.name || existingAgent.name,
251-
wf?.description,
252-
workflowData.blocks
253-
)
247+
const skills = generateSkillsFromWorkflow(wf?.name || existingAgent.name, wf?.description)
254248

255249
await db
256250
.update(a2aAgent)

apps/sim/app/api/a2a/agents/route.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,7 @@ export async function POST(request: NextRequest) {
152152
}
153153

154154
// Generate skills from workflow
155-
const skills = generateSkillsFromWorkflow(
156-
workflowId,
157-
name || wf.name,
158-
description || wf.description,
159-
workflowData.blocks
160-
)
155+
const skills = generateSkillsFromWorkflow(name || wf.name, description || wf.description)
161156

162157
// Create agent
163158
const agentId = uuidv4()

0 commit comments

Comments
 (0)