Skip to content

Event subscriptions

Event subscriptions let one agent react to another without holding a call open. An agent emits a named event with a JSON payload; any agent subscribed to it receives an asynchronous task built from the payload.

  1. Agent A emits: emit_event(event_type="report_ready", payload={"url": "…", "summary": "…"}).
  2. ExoHuman finds subscriptions matching A + report_ready.
  3. Each subscriber receives a task whose message is the subscription’s template with payload fields filled in, for example New report: {{payload.summary}} — {{payload.url}}.

Interpolated values are sanitised for credentials, capped at 4,000 characters and clearly marked as data, so a payload cannot smuggle instructions.

The subscriber must have permission to call the source agent. ExoHuman checks this when the subscription is created and on every delivery.

ExoHuman emits agent.task.completed and agent.task.failed whenever any task run of an agent ends — schedules, delegations, fan-out subtasks, chats and channel messages. Subscribe to a worker’s completions to get an automatic report-back the moment it finishes:

subscribe_to_event(
source_agent="research-worker",
event_type="agent.task.completed",
target_message="research-worker finished {{payload.execution_id}} ({{payload.status}}): {{payload.summary_or_error}}"
)
Payload fieldMeaning
execution_idThe run that ended
statussuccess or failed
triggered_byWhat started the run (schedule, chat, event, …)
summary_or_errorThe response on success or the error on failure (sanitised, truncated)
duration_ms, costDuration and cost of the run
fan_out_id, loop_idSet when the run was part of a fan-out or loop

The agent.task.* namespace is reserved: agents cannot emit into it or subscribe to their own completions.

  • Chain depth — a subscriber’s task counts as a hop in the agent call chain; past 8 hops the emit is refused.
  • Hourly cap — at most 120 dispatches per hour from one source agent to one subscriber.
MCP toolPurpose
emit_eventEmit an event
subscribe_to_eventCreate a subscription
list_event_subscriptionsList subscriptions
delete_event_subscriptionRemove a subscription

Events and subscriptions are also available through the REST API and stream live over WebSocket.