Skip to content

Autonomous topic wiring

Agents and MCPMCPSDKlist_topicsregister_topicpublish_eventcreate_agent_subscriptiontopics

Topics carry payload schemas in a catalog, so an agent can discover what is published and wire a subscription entirely through tool calls.

The situation

A new service starts publishing order events. An agent should learn the event exists, read what fields it carries, and start reacting, without an engineer writing the wiring by hand.

The recipe

The publisher declares its topic with a payload schema, in code or by tool:

tool call: register_topic
{
"topic": "app.orders.created",
"description": "Fired when a new order is placed.",
"payload_schema": {
"type": "object",
"properties": { "orderId": { "type": "string" }, "total": { "type": "number" } }
},
"tags": ["orders"]
}

The agent browses the catalog, then subscribes using the fields the schema names:

tool call: list_topics
{ "category": "app", "search": "orders" }
tool call: create_agent_subscription
{
"agent_id": "order-intake",
"topic": "app.orders.created",
"reaction_type": "durable",
"workflow_type": "reviewOrder",
"input_mapping": { "data": { "orderId": "{event.data.orderId}" } }
}

Topics enter the catalog three ways: 22 system topics seeded at startup, startConfig.topics[] declared in code, and runtime topics auto-registered on the first publish_event to an unknown name.

The guarantee

The catalog is a persistent registry: every topic has a name, description, payload schema and subscriber list, matched with the same wildcard rules as the bus. list_topics is open to any account; registering, editing and publishing topics require builder access. See Agents and events.