A2A integration for Temporal

Hi everyone,

I’m thrilled to see the work done so far on integrating Agent SDKs like ADK or Langraph into Temporal, but one giant piece of the puzzle that I find missing is an A2A integration for Temporal.

It feels like a very obvious immediate next thing to have. Once a handful of agents have been developed, they ought to be able to communicate. It’s not sufficient - for the use cases the company I work for needs to deal with - to be constrained to an intra-Temporal communication.

Larger corporations have a need for inventory management and as such, agents, tools, LLMs, prompts etc. all need to go into an AI registry such as IBM Context Forge, TrueFroundry or other.
A standardized API/protocol is needed for discovery & inventory management of agents and a standardized communication protocol and communication patterns along with a data model is needed for agents to interact. The a2a (agent to agent protocol standard) addresses all of these needs.

Integrating in-process agent frameworks with a2a is a breeze, but I really want agents to execute WITHIN Temporal. This however makes an a2a integration non-trivial because the a2a communication patterns (sync, async, streaming, SSE, bi-directional comm. via webhook callbacks) cannot easily be hooked up to Temporal, because AI agents based on Temporal would execute inside of Temporal worker nodes which do not have a defined and steady network identity.

It seems that a proxy service of some kind is needed. From early solution architecting, it seems that one might either try to have an agent registry such as IBM Context Forge act as an a2a proxy and integrate Temporal agent calling directly, or one could work on a standalone deployment unit that acts as an a2a proxy, sitting “in front of” Temporal and translating a2a interactions into Termporal workflow calls. For that variant, one might take the a2a python SDK as a basis and hook it up to Temporal agents via a message queue service like NATS or possibly Temporal Workflow Streams.

I can and will go ahead and have an a2a temporal integration be developed inhouse at the company I work for, but meant to ask if there are already plans by the Temporal community to do the same and/or whether this is by any chance on the Temporal roadmap even.

Not sure whether this is the right channel for this, but the company I work for would also be interested in partnering with Temporal on the development of such an integration and I meant to ask whether there was any interest on your end to do so.

Maybe we can join forces and get this done extra fast and share the results back to the community. In my humble opinion, an a2a integration is the missing piece that would accelerate Temporal’s adoption for agentic usecases a LOT.

I attached an architectural draft which goes a bit beyond a mere a2a integration, but hoping that it paints a picture.. The a2a integration could be just a modular piece that might not even require a message broker. I don’t know enough about Nexus to know whether one might even be able to implement an a2a integration with Temporal even entirely “within” Temporal itself.

Curious to get feedback and get to know your thoughts.

Thanks!

For your proxy boundary, can a caller disconnect while the agent runs in Temporal, then reconnect to the same A2A task rather than start another? That’s the behavior I’d use to choose between a registry-integrated proxy and a standalone adapter.

Hi,

thanks for your question.
Yes, a caller can reconnect to the same A2A tasks when using this proxy. There are four different communication patterns in A2A (synchronous, asynchronous, streaming (via SSE events) and two-way-communication via webhooks). For the subset of those that don’t hold a long-running connection, like the asynchronous or two-way comm, the reconnecting to the same agent works via the A2A session ID and task ID which uniquely identify the agent’s task.

For the other communication patterns, A2A has the reconnect concept covered in its API. I think it was called “SubscribeToTask” if I’m not mistaken.
If a reconnect isn’t possible in a certain scenario, then it is a limitation of the communication pattern chosen and not the proxy approach. As far as I can tell from the PoC we did, we did not find any systemic limitations from using a proxy. There isn’t an alternative presently to using a proxy because temporal workers don’t have a stable network identity. So one couldn’t connect to them directly. Temporal itself doesn’t quite offer enough builtin features to be able to model an A2A communication natively, but it isn’t too far away. Currently it is not possible to expose Nexus Services to external client calls and Nexus can also not hold state. Last time I checked, external Nexus calls were still experimental and only the golang SDK had support for it. A second interesting feature might be the workflow streams, but this is also still experimental and not a full replacement for a message queue service.

We ended up implementing the Proxy-to-Temporal communication by choosing direct Temporal API calls for when the Proxy talks to Temporal and NATS-based messaging for the Tempora-to-Nexus route. Not very elegant, but it was the only thing that worked.

We couldn’t use an off-the-shelf a2a proxy quite yet either because the open source ones that exist (MCP context forge / agentgateway) hadn’t implemented all four communication patterns yet, so their A2A support was still too incomplete at the time.

I hope that Temporal soon has all features needed to make a native A2A integration viable. This use case is a nice test bed for unearthing missing features within Temporal…

Given the proxy and NATS boundary you described, could a shared message envelope map A2A task and session IDs to workflow IDs, with inter-workflow signals carrying messages between Temporal-hosted agents? For agents across clusters, could Nexus endpoints provide a consistent boundary for that exchange, and what would still need to live in the proxy? I’m curious how you’d handle correlation, duplicate messages and streaming without treating signals as request-response.

Hi. Thanks for your question. Please excuse my late response, I was on vacation…

I relayed your question to the developer who implemented our solution. Please find his response inline below. I hope that it aligns with your idea of a shared message envelope.

Wrt the “inter-workflow signals”: the proxy approach - the way we have implemented it - does not give the case of co-located agents that live within the same Temporal cluster any kind of special treatment. Communication would still happen the same way as with heterogeneous agents. It seemed like the easiest and safest first-milestone baseline. Shortcuts might be possible but wouldn’t translate into any groundbreaking benefit but would have the potential for introducing extra bugs. The proxy also manages the task audit/history as required by A2A and implemented by the a2a SDK as well. So this functionality needs to live somewhere and if two co-located temporal agents were to communicate directly, this aspect of some party having to “listen in” and record their communication audit log would still be required.

Wrt: “For agents across clusters, could Nexus endpoints provide a consistent boundary for that exchange, and what would still need to live in the proxy?”

I personally haven’t worked hands-on with Nexus yet and even based on the documentation, I have only half an understanding of which problem Nexus tries to solve. Yet I was thinking along the same lines during our inception phase, but at the time, Nexus wasn’t feature rich enough. Maybe today it might be? At the time, Nexus couldn’t pose as a microservice facade for temporal workflows, which is where I would see it. Same story about sub-workflows: they would have been a perfect fit, if lifetime-management of sub-workflows would be somehow tied to their parent workflows, but most Temporal features that we were evaluating for solving some of our problems fell short. It felt like this A2A usecase would also be a good design beacon for future Temporal improvements. Some features like Nexus, sub-workflows, workflow streams first need to mature in their design, exactly by this process of finding them lacking in shape and form to cater to certain real life usecases and then re-designing them incrementally until they fit.

But even if Nexus would meanwhile have all caps to act as described, then you’d still have one Nexus facade per physical Temporal cluster to my understanding. (I hope I’m not mistaken here…) In a real business context, this would then still require to have an agent registry on top but once one has an agent registry, one really also would want to integrate it with the agents as well, so that agents can use it to find/discover one another. Our client mentioned several times that it would be awesome if agent registries could be arranged hierarchically. You’d pass a discovery URL of one agent registry to another and then the other would be able to incorporate this agent directory. This would be similar to how individual agents have a discovery URL. Unfortunately, this registry-scoped discovery wasn’t part of the A2A spec. I hope that it will be in some future revision because in my opinion, when designing systems, one always needs to make things explicit. If there is such a thing as a model registry, then there also needs to be specification about how it should behave and which registry-scoped concerns need to be addressed. The A2A spec currently is too focused on the notion of agents alone.


Following is the response from my colleague Vivek:

Every message enters Temporal inside an AgentCommand envelope. It holds the A2A request plus correlation IDs: taskId, contextId (the session), messageId and requestId.

  • taskId maps to the workflow. The ID is a2a/{scope}/{agentKey}/{taskId}, so one A2A task is one workflow.
  • contextId groups tasks. A session spans several task workflows. Each new task loads earlier turns from the proxy at start.
  • A follow-up on the same taskId (answering input-required, say) reaches the same open workflow.

We used one workflow per session at first. We changed it because sessions never end, so those workflows never finished and were hard to update safely.

Signals without request-response
A signal is a one-way note, so the exchange is two notes:

  • A signals B with the command.
  • B finishes and signals A’s workflowId with a reply that carries A’s requestId.
  • A keeps a list of open requestIds and waits on a timer. A reply matches its question by requestId. No reply in time means A decides what to do next.

If A needs B to confirm receipt synchronously, use a Temporal Update.

Duplicates
Every layer assumes a message can arrive twice and dedups on a stable ID:

  • The same messageId always produces the same taskId and workflowId, so a retry can’t start a second workflow.
  • The workflow records each commandId and skips one it has already handled.
  • Each event has an eventId, also used as the NATS message ID, and the proxy applies each eventId once.
  • A reply signal would carry its own eventId, and A ignores ones it has seen.

sorry for the long response, I hope that some of the above could address your questions.

all the best

Sascha