Skip to main content
Metadata
FieldValue
Canonical URIhttps://docs.aion.to/a2a/extensions/aion/distribution/1.0.0
Issueraion
Version1.0.0
ActivationThis extension is declarative. It will always be active and does not require activation.
Related ExtensionsEvent

Overview

Distributions are A2A-protocol adapters for external messaging systems. They let agents use messaging systems as primary IO in four contexts:
  1. User requests: a user sends a message from an external network and the agent responds.
  2. External-service events: an event occurs in an external service and the agent is notified.
  3. Direct A2A communication: a distribution is also an agent and can be called directly over A2A to provide context sourced from an external network.
  4. MCP access: a distribution may expose an MCP server so downstream agents can look up context via tool calls.

What Is A Distribution?

A distribution is the boundary service between an external network and A2A workflows.
ResponsibilityDescription
Inbound normalizationMaps source-network messages/events into A2A SendMessage requests.
Outbound deliveryMaps terminal A2A responses into provider-native outbound actions.
Identity contextSupplies distribution, sender, identity, behavior, and environment metadata.
Agent endpointExposes an agent card URL so agents in the same project can call it directly.
External endpointSome distributions may expose an external endpoint as a composite agent.
Out of scope:
  • A distribution does not execute agent workflows itself.
  • A distribution does not replace provider-specific APIs for advanced long-tail operations.

Request And Response Flow

All these mechanisms are instrumented with the Aion agent server, which wraps frameworks like LangGraph and normalizes communication in A2A format. Request flow expectations:
  1. Distribution receives a source-network event.
  2. Distribution maps that event to an A2A SendMessage request.
  3. Distribution includes distribution extension metadata in request metadata.
  4. Distribution marks the message as an event using the Event extension metadata in params.message.metadata.
  5. Distribution includes two event DataParts: a normalized payload and a raw source payload.
  6. Agent server runs the target workflow and emits a terminal A2A response.
Response flow expectations:
  1. Distribution receives the terminal A2A response (Message, Task, or terminal TaskStatusUpdateEvent).
  2. Distribution resolves the outbound text/content from that terminal response.
  3. Distribution sends that response back to the originating network and context.

Distribution Payload

Distribution extension data is request-scoped and attached at: params.metadata["https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0"]. This payload is intended for downstream agent consumption. It is not required when sending a request directly to a distribution endpoint. When the payload is present, downstream consumers should expect distribution, behavior, and environment to be included.

Payload Shape

The canonical shape is:
metadata:
  "https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0":
    senderId?: "{source sender id}"
    distribution:
      id: "distribution-uuid"
      endpointType: {Literal("Aion", "Telegram", "A2A", "Playground", "GitHub", "Twitter")}
      url: "https://.../agent-card"
      identities:
        - kind: "principal"
          id: "agent-identity-uuid"
          networkType: "Aion"
          representedUserId?: "aion-user-uuid"
          organizationId: "org-uuid"
          displayName?: "Podcast Generator"
          userName?: "podcastmaxi"
          avatarImageUrl?: "https://..."
          agentType: {Literal("Personal", "Deployed")}
          url?: "https://..."
        - kind: "service"
          id: "external-identity-uuid"
          networkType: "Twitter"
          representedUserId?: "1234567890"
          organizationId: "org-uuid"
          displayName?: "Podcast Maxi"
          userName?: "podcastmaxi"
          avatarImageUrl?: "https://..."
          url?: "https://..."
    behavior:
      id: "behavior-uuid"
      behaviorKey: "myGraph"
      versionId: "version-uuid"
    environment:
      id: "environment-uuid"
      name: "Staging"
      deploymentId: "deployment-uuid"
      configurationVariables: {Map[String, String]}
      systemPrompt?: "You are an agent..."

Data Dictionary

DistributionExtensionPayload

FieldTypeRequiredDescription
senderIdStringoptionalSource-network sender identifier for this request.
distributionDistributionRecordrequired if payload presentDistribution context for the request.
behaviorBehaviorRecordrequired if payload presentBehavior context for the active step.
environmentEnvironmentRecordrequired if payload presentEnvironment context for the active step.

DistributionRecord

FieldTypeRequiredDescription
idUUIDrequiredDistribution identifier in Aion control plane.
endpointTypeStringrequiredSource/target network type (for example, Twitter, A2A).
urlStringrequiredDistribution-facing A2A URL; currently sourced from the principal identity A2A URL.
identitiesIdentityRecord[]requiredIdentity projections associated with this distribution.

IdentityRecord

distribution.identities is polymorphic:
  • kind: "principal" is the distribution’s Aion principal agent identity projection.
  • kind: "service" is the external network/service identity projection.
FieldTypeRequiredDescription
kindStringrequiredIdentity type discriminator (principal or service).
idUUIDrequiredIdentity record id.
networkTypeStringrequiredNetwork/provider namespace for the identity.
representedUserIdStringoptionalEnd-user id represented by this identity on its network.
organizationIdUUIDrequiredOwning organization id.
displayNameStringoptionalDisplay name for rendering.
userNameStringoptionalProvider-facing username/handle (normalized).
avatarImageUrlStringoptionalAvatar URL for display.
urlStringoptionalProfile URL (service) or card/profile URL (principal), if available.
agentTypeStringoptionalPresent for kind: "principal" only (Personal or Deployed).

BehaviorRecord

FieldTypeRequiredDescription
idUUIDrequiredBehavior id in Aion control plane.
behaviorKeyStringrequiredBehavior key/graph key used by the runtime.
versionIdUUIDrequiredBehavior version id used for this step.

EnvironmentRecord

FieldTypeRequiredDescription
idUUIDrequiredEnvironment id in Aion control plane.
nameStringrequiredHuman-readable environment name.
deploymentIdUUIDrequiredDeployment id associated with this environment.
configurationVariablesMap[String, String]requiredEnvironment configuration key/value pairs.
systemPromptStringoptionalRuntime system prompt when this value is transmitted.
Optional fields should be omitted when unknown rather than serialized as null.

Metadata Placement Rules

Key aliases used below:
  • DistributionURI: https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0
  • EventURI: https://docs.aion.to/a2a/extensions/aion/event/1.0.0
ConcernLocationRequired
Distribution extension payloadparams.metadata[DistributionURI]optional
Event identity (CloudEvents)params.message.metadata[EventURI]required for event messages
Event payload schema pointerparams.message.parts[i].metadata[EventURI].schemarequired for event DataParts
Event payload dataparams.message.parts[i].datarequired for event DataParts
Examples:
  • Distribution id: params.metadata[DistributionURI].distribution.id
  • Event type: params.message.metadata[EventURI].type
  • Part schema: params.message.parts[i].metadata[EventURI].schema
  • Normalized trajectory: params.message.parts[i].data.trajectory

Events

Inbound distribution requests are considered events if they originated programmatically from an external system. Event extension metadata should be attached at params.message.metadata["https://docs.aion.to/a2a/extensions/aion/event/1.0.0"] with:
  • type
  • source
  • id
All event types defined by this extension are inbound to A2A request processing. For clarity: this extension documents the metadata which will be attached to A2A requests. External systems SHOULD NOT attach such metadata to inbound requests themselves. Such requests will be rejected.

Event Types

  • to.aion.distribution.message.1.0.0: Inbound message context from a messaging integration. Required payloads: InboundMessageEventPayload, SourceSystemEventPayload.
  • to.aion.distribution.activity.1.0.0: Non-message activity from a connected source system. Required payloads: SourceSystemEventPayload.
Rules:
  • SourceSystemEventPayload MUST be included for every distribution event type.
  • InboundMessageEventPayload MUST be included only for to.aion.distribution.message.1.0.0.

Payload Schemas

InboundMessageEventPayload

Schema URI: https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0#InboundMessageEventPayload This payload is the normalized representation of an inbound message context. It is sent for any integration that behaves as a messaging service, regardless of provider-specific event schema.
FieldTypeRequiredDescription
userIdStringrequiredSender identifier on the source network.
messageIdStringrequiredSource-network message id.
contextIdStringrequiredSource-network conversation/thread id.
parentContextIdStringoptionalParent context id when nested threads are used.
trajectoryStringrequiredRouting context for the message.
Trajectory values:
TrajectoryDefinition
direct-messageThe agent received a direct message.
replyA user replied to an agent post/message.
timelineA user mentioned the agent in a feed/timeline context.
conversationMessage arrived in a shared conversation context.

SourceSystemEventPayload

Schema URI: https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0#SourceSystemEventPayload This payload is provided when a distribution is connected to an external service that emitted the event being handled. It preserves the original source-system event for provider-specific inspection.
FieldTypeRequiredDescription
providerStringrequiredSource provider name (for example, twitter).
eventObjectrequiredVerbatim event payload from the source system.

Messages

These operations provide the baseline interaction model across most networks. Some mediums may have additional semantics, but Aion normalizes request and response flow through A2A.

Receive Message

Inbound: Distribution -> Agent This request is emitted by the distribution when a new source-network message arrives. If an agent responds with a message, text/data/file parts are translated into an outbound provider message.
{
  "jsonrpc": "2.0",
  "method": "SendMessage",
  "id": "req-123",
  "params": {
    "message": {
      "messageId": "msg-6a0dbe8a",
      "role": "ROLE_USER",
      "extensions": [
        "https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0",
        "https://docs.aion.to/a2a/extensions/aion/event/1.0.0"
      ],
      "metadata": {
        "https://docs.aion.to/a2a/extensions/aion/event/1.0.0": {
          "type": "to.aion.distribution.message.1.0.0",
          "source": "aion://distribution/f1eb53f6-8a2d-4a8f-9f8d-f0f01b0a9d11",
          "id": "evt-1901234567890"
        }
      },
      "parts": [
        {
          "text": "What's the weather like in Reno today?"
        },
        {
          "data": {
            "userId": "2244994945",
            "messageId": "1901234567890",
            "contextId": "tw-dm-334455",
            "parentContextId": "tw-dm-root-334455",
            "trajectory": "direct-message"
          },
          "mediaType": "application/json",
          "metadata": {
            "https://docs.aion.to/a2a/extensions/aion/event/1.0.0": {
              "schema": "https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0#InboundMessageEventPayload"
            }
          }
        },
        {
          "data": {
            "provider": "twitter",
            "event": {
              "data": {
                "id": "1901234567890",
                "text": "What's the weather like in Reno today?",
                "author_id": "2244994945",
                "conversation_id": "1901234567800"
              },
              "matching_rules": [
                {
                  "id": "1888888888888",
                  "tag": "direct-message-proxy"
                }
              ]
            }
          },
          "mediaType": "application/json",
          "metadata": {
            "https://docs.aion.to/a2a/extensions/aion/event/1.0.0": {
              "schema": "https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0#SourceSystemEventPayload"
            }
          }
        }
      ]
    },
    "metadata": {
      "https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0": {
        "senderId": "twitter:user:2244994945",
        "distribution": {
          "id": "f1eb53f6-8a2d-4a8f-9f8d-f0f01b0a9d11",
          "endpointType": "Twitter",
          "url": "https://api.aion.to/agents/distributions/f1eb53f6-8a2d-4a8f-9f8d-f0f01b0a9d11/card",
          "identities": [
            {
              "kind": "principal",
              "id": "f08bc0a3-9466-4b0f-9de9-2c9dcad2c9cf",
              "networkType": "Aion",
              "organizationId": "df0f52f8-2d35-4bc7-ae9f-3eb2fd352f18",
              "displayName": "Podcast Generator",
              "userName": "podcastmaxi",
              "agentType": "Deployed"
            },
            {
              "kind": "service",
              "id": "2c72f45f-f5f2-4332-9baf-f3d68d85d0a9",
              "networkType": "Twitter",
              "representedUserId": "2244994945",
              "organizationId": "df0f52f8-2d35-4bc7-ae9f-3eb2fd352f18",
              "displayName": "Podcast Maxi",
              "userName": "podcastmaxi",
              "url": "https://x.com/podcastmaxi"
            }
          ]
        },
        "behavior": {
          "id": "bc4d48d9-8ea0-4fe9-8a61-d298b2ef1e2c",
          "behaviorKey": "podcast_assistant",
          "versionId": "7f9f3cd8-f2f3-4e5e-a1e6-6623ab5f0f6b"
        },
        "environment": {
          "id": "2fbe9acc-6bf6-4b0a-9f5f-f7a1e1f093aa",
          "name": "Staging",
          "deploymentId": "9e2bfad3-cf13-45c8-9f45-2ecbc09d8f32",
          "configurationVariables": {
            "REGION": "us-east-1"
          },
          "systemPrompt": "You are a helpful assistant."
        }
      }
    }
  }
}

Response Example

Agents are generally expected to respond to inbound requests. A distribution translates this A2A response back to the source network.
{
  "jsonrpc": "2.0",
  "id": "req-123",
  "result": {
    "message": {
      "messageId": "agent-msg-991",
      "contextId": "tw-dm-334455",
      "role": "ROLE_AGENT",
      "parts": [
        {
          "text": "The weather in Reno is a balmy 72F right now."
        }
      ]
    }
  }
}

Send Message

Outbound: Agent -> Distribution Outbound messages are sent to the distribution’s A2A endpoint defined in its Agent Card.
{
  "jsonrpc": "2.0",
  "method": "SendMessage",
  "id": "req-123",
  "params": {
    "message": {
      "messageId": "agent-msg-991",
      "role": "ROLE_AGENT",
      "parts": [
        {
          "text": "The weather in Reno is a balmy 72F right now."
        },
        {
          "data": {
            "trajectory": "direct-message",
            "userId": "2244994945",
            "contextId": "tw-dm-334455",
            "replyToMessageId": "1901234567890"
          },
          "mediaType": "application/json"
        }
      ]
    }
  }
}

OutboundMessageTargetPayload

Schema URI: https://docs.aion.to/a2a/extensions/aion/distribution/1.0.0#OutboundMessageTargetPayload This payload specifies where the outbound message should be delivered in the target network.
FieldTypeRequiredDescription
trajectoryStringrequiredTarget delivery mode.
contextIdStringrequiredTarget conversation/thread context.
userIdStringoptionalTarget user for direct messages; required for direct messages.
replyToMessageIdStringoptionalProvider message id being replied to.
Trajectory requirements:
TrajectoryRequired FieldsDescription
direct-messagetrajectory, contextId, userIdDirect message to a target user/context.
replytrajectory, contextId, replyToMessageIdReply to a specific prior message.
timelinetrajectory, contextIdPost to the identity timeline/feed context.
conversationtrajectory, contextIdPost to a shared conversation context.

Get Conversation

Outbound: Agent -> Distribution When additional context is needed out-of-band, clients can use distribution.url from this extension payload as the distribution agent card URL and communicate directly to the distribution. Typically, distribution-level context will be available via natural language A2A requests or parameterized MCP tool calls.