Skip to content

Commit 048a571

Browse files
committed
Add new a2a call task to the specification and schema
Signed-off-by: Emmanuel Allen <[email protected]>
1 parent 5b815ad commit 048a571

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

dsl-reference.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
+ [gRPC](#grpc-call)
1515
+ [HTTP](#http-call)
1616
+ [OpenAPI](#openapi-call)
17+
+ [A2A](#a2a-call)
1718
- [Do](#do)
1819
- [Emit](#emit)
1920
- [For](#for)
@@ -320,6 +321,7 @@ Serverless Workflow defines several default functions that **MUST** be supported
320321
- [gRPC](#grpc-call)
321322
- [HTTP](#http-call)
322323
- [OpenAPI](#openapi-call)
324+
- [A2A](#a2a-call)
323325

324326
##### AsyncAPI Call
325327

@@ -483,6 +485,48 @@ do:
483485
status: available
484486
```
485487

488+
##### A2A Call
489+
490+
The [A2A Call](#a2a-call) enables workflows to interact with AI agents described by [A2A](https://a2a-protocol.org/).
491+
492+
###### Properties
493+
494+
| Name | Type | Required | Description|
495+
|:--|:---:|:---:|:---|
496+
| method | `string` | `yes` | The A2A JSON-RPC method to send. |
497+
| agentCard | [`externalResource`](#external-resource) | `yes` | The AgentCard resource that describes the agent to call. |
498+
| parameters | `any` | `no` | The parameters for the A2A rpc method. For the `message/send` and `message/stream` methods the parameters `message.messageId` and `message.role` must be automatically set if missing. |
499+
500+
> [!NOTE]
501+
> The `security` and `securitySchemes` fields of the AgentCard contain authentication requirements and schemes for when communicating with the agent.
502+
503+
> [!NOTE]
504+
> On success the output is the JSON-RPC result. On failure runtimes must raise an error.
505+
506+
> [!NOTE]
507+
> For `message/stream` and `tasks/resubscribe` methods the output is a sequentially ordered array of all the result objects.
508+
509+
###### Examples
510+
511+
```yaml
512+
document:
513+
dsl: '1.0.0'
514+
namespace: test
515+
name: a2a-example
516+
version: '0.1.0'
517+
do:
518+
- GenerateReport:
519+
call: a2a
520+
with:
521+
method: message/send
522+
agentCard: https://example.com/.well-known/agent-card.json
523+
parameters:
524+
message:
525+
parts:
526+
- kind: text
527+
text: Generate the Q1 sales report.
528+
```
529+
486530
#### Do
487531

488532
Serves as a fundamental building block within workflows, enabling the sequential execution of multiple subtasks. By defining a series of subtasks to perform in sequence, the Do task facilitates the efficient execution of complex operations, ensuring that each subtask is completed before the next one begins.

dsl.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ Serverless Workflow DSL is designed to seamlessly interact with a variety of ser
596596
- [**gRPC**](dsl-reference.md#grpc-call): Supports Remote Procedure Call (RPC) using gRPC, a high-performance, open-source universal RPC framework. This is suitable for connecting to services that require low-latency and high-throughput communication.
597597
- [**AsyncAPI**](dsl-reference.md#asyncapi-call): Facilitates interaction with asynchronous messaging protocols. AsyncAPI is designed for event-driven architectures, allowing workflows to publish and subscribe to events.
598598
- [**OpenAPI**](dsl-reference.md#openapi-call): Enables communication with services that provide OpenAPI specifications, which is useful for defining and consuming RESTful APIs.
599+
- [**A2A**](dsl-reference.md#a2a-call): Enables interaction with A2A servers (agents described by A2A).
599600

600601
Runtimes **must** raise an error with type `https://serverlessworkflow.io/spec/1.0.0/errors/communication` if and when a problem occurs during a call.
601602

schema/workflow.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,36 @@ $defs:
430430
description: Specifies whether redirection status codes (`300–399`) should be treated as errors.
431431
required: [ document, operationId ]
432432
unevaluatedProperties: false
433+
- title: CallA2A
434+
description: Defines the A2A call to perform.
435+
$ref: '#/$defs/taskBase'
436+
type: object
437+
unevaluatedProperties: false
438+
required: [ call, with ]
439+
properties:
440+
call:
441+
type: string
442+
const: a2a
443+
with:
444+
type: object
445+
title: A2AArguments
446+
description: The A2A call arguments.
447+
properties:
448+
agentCard:
449+
$ref: '#/$defs/externalResource'
450+
title: WithA2AAgentCard
451+
description: The Agent Card that defines the agent to call.
452+
method:
453+
type: string
454+
title: WithA2AMethod
455+
description: The A2A method to send.
456+
parameters:
457+
type: object
458+
title: WithA2AParameters
459+
description: The parameters object to send with the A2A method.
460+
additionalProperties: true
461+
required: [ agentCard, method ]
462+
unevaluatedProperties: false
433463
- title: CallFunction
434464
description: Defines the function call to perform.
435465
$ref: '#/$defs/taskBase'
@@ -440,7 +470,7 @@ $defs:
440470
call:
441471
type: string
442472
not:
443-
enum: ["asyncapi", "grpc", "http", "openapi"]
473+
enum: ["asyncapi", "grpc", "http", "openapi", "a2a"]
444474
description: The name of the function to call.
445475
with:
446476
type: object

0 commit comments

Comments
 (0)