[Fix #1087] A2A implementation#1469
Conversation
85ef704 to
baa443a
Compare
There was a problem hiding this comment.
Pull request overview
Adds initial A2A call support to the Serverless Workflow Java implementation (Fix #1087), introducing a new impl-a2a executor module and a basic “hello world” workflow + integration test to validate end-to-end execution via a mocked A2A endpoint.
Changes:
- Introduces new
serverlessworkflow-impl-a2amodule with an A2A task executor and request dispatchers (message send/stream + task operations). - Registers the A2A callable task builder via Java SPI so the implementation can discover the executor at runtime.
- Adds an integration test + sample workflow to validate A2A
message/sendbehavior.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/test/src/test/resources/workflows-samples/a2a/a2a-hello-world.yaml | Adds a sample workflow exercising call: a2a with message/send. |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/A2ADefinitionTest.java | Adds an integration-style test using MockWebServer to validate A2A execution. |
| impl/test/pom.xml | Pulls in the new serverlessworkflow-impl-a2a module for tests. |
| impl/pom.xml | Adds the new a2a module + dependency management for the A2A SDK and Gson. |
| impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowError.java | Refactors stacktrace capture into a reusable getStackTrace(...) helper. |
| impl/a2a/src/main/resources/META-INF/services/io.serverlessworkflow.impl.executors.CallableTaskBuilder | Registers A2AExecutorBuilder via SPI. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/MessageStreamConsumer.java | Implements streaming event handling for message/task updates. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/MessageSendConsumer.java | Implements non-stream message/task event handling. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/MessageDispatcher.java | Builds/sends A2A messages and returns a future for the workflow result. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/MessageConsumerFactory.java | Centralizes consumer creation and exception handling hookup. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/MessageConsumer.java | Base consumer abstraction returning a CompletableFuture<WorkflowModel>. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/ListTaskParamsDispatcher.java | Implements A2A tasks/list dispatch and model conversion. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/GetTaskParamsDispatcher.java | Implements A2A tasks/get dispatch and model conversion. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/CancelTaskParamsDispatcher.java | Implements A2A tasks/cancel dispatch and model conversion. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/A2AUtils.java | Adds parameter extraction/coercion helpers + conversions to WorkflowModel. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/A2ARequestDispatcher.java | Introduces the dispatcher functional interface used by the executor. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/A2AExecutorBuilder.java | Wires CallA2A tasks to dispatcher implementations and endpoint resolution. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/A2AExecutor.java | Creates the A2A SDK client and executes the selected dispatcher. |
| impl/a2a/src/main/java/io/serverlessworkflow/impl/executors/a2a/A2AExceptionHandler.java | Maps thrown errors into WorkflowException + WorkflowError details. |
| impl/a2a/pom.xml | Adds the Maven module definition for serverlessworkflow-impl-a2a. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
94ff620 to
e8a027e
Compare
| case AGENT_GET_AUTHENTICATED_EXTENDED_CARD, | ||
| TASKS_PUSH_NOTIFICATION_CONFIG_DELETE, | ||
| TASKS_PUSH_NOTIFICATION_CONFIG_GET, | ||
| TASKS_PUSH_NOTIFICATION_CONFIG_LIST, | ||
| TASKS_PUSH_NOTIFICATION_CONFIG_SET, | ||
| TASKS_RESUBSCRIBE -> |
There was a problem hiding this comment.
Since these operations are not really frequent, they will be adressed with a separate issue #1485
| <dependency> | ||
| <groupId>com.google.code.gson</groupId> | ||
| <artifactId>gson</artifactId> | ||
| <version>${version.com.google.code.gson}</version> |
There was a problem hiding this comment.
yes, the a2a SDK is using Gson, google gRPC is also using gson and here we are aligning the two versions to the latest one.
Signed-off-by: fjtirado <ftirados@ibm.com>
ricardozanini
left a comment
There was a problem hiding this comment.
Looks solid, but for this use case, shouldn't we implement integration tests with real models?
| try { | ||
| return dispatcher.apply( | ||
| agentCard, | ||
| Client.builder(agentCard) |
There was a problem hiding this comment.
How do we replace this client with a framework's infra?
| optionalParam(parameters, "pageToken", String.class), | ||
| optionalParam(parameters, "historyLength", Integer.class), | ||
| optionalParam(parameters, "statusTimestampAfter", Instant.class), | ||
| optionalParam(parameters, "includeArtifacts", Boolean.class), |
There was a problem hiding this comment.
In the next iteration, I'd transform all these strings into consts in a A2AConsts style-class to align with their spec.
Fix #1087