Overview
Shannon emits real-time events via Server-Sent Events (SSE) to provide visibility into task execution. This document catalogs the 26 event types actually emitted by the platform, their structure, and when they occur. Events provide:- Real-time progress - Track task execution as it happens
- Debugging insights - LLM prompts, tool invocations, agent reasoning
- Cost monitoring - Track token usage and costs in real-time
- Multi-agent coordination - Observe team formation and collaboration
- Error recovery - Monitor error handling and recovery attempts
Event Structure
All events follow this base structure:Base Fields
| Field | Type | Description |
|---|---|---|
workflow_id | string | Unique task/workflow identifier |
type | string | Event type (see catalog below) |
agent_id | string | Agent that emitted the event |
message | string | Human-readable event description |
timestamp | ISO 8601 | When the event occurred |
seq | integer | Sequence number for ordering |
stream_id | string | Stream identifier for reconnection |
data | object | Event-specific payload (optional) |
Event Categories
Events are organized into logical categories:- Workflow Events - Task lifecycle
- Agent Events - Agent execution
- Tool Events - Tool invocations
- Pattern Events - Cognitive pattern execution
- Team Events - Multi-agent coordination
- LLM Events - Language model interactions
- Progress Events - Task progress and status
- System Events - Errors and system state
Event Type Quick Reference
Authoritative list of event types emitted by Shannon:| Event Type | Category | Description |
|---|---|---|
WORKFLOW_STARTED | Workflow | Task begins execution |
WORKFLOW_COMPLETED | Workflow | Task completes successfully |
AGENT_STARTED | Agent | Agent begins processing |
AGENT_THINKING | Agent | Agent reasoning/planning |
AGENT_COMPLETED | Agent | Agent finishes successfully |
TOOL_INVOKED | Tool | Tool is called |
TOOL_OBSERVATION | Tool | Agent observes tool result |
TEAM_RECRUITED | Team | Multi-agent team assembled |
TEAM_RETIRED | Team | Team disbanded |
TEAM_STATUS | Team | Team coordination update |
DEPENDENCY_SATISFIED | Team | Dependencies resolved |
MESSAGE_SENT | Message | Agent sends message |
MESSAGE_RECEIVED | Message | Agent receives message |
LLM_PROMPT | LLM | Prompt sent to LLM |
LLM_PARTIAL | LLM | Incremental LLM output |
LLM_OUTPUT | LLM | Final LLM output |
PROGRESS | Progress | General progress update |
DATA_PROCESSING | Progress | Processing/analyzing data |
WAITING | Progress | Waiting for resources |
ERROR_OCCURRED | System | Error occurred |
ERROR_RECOVERY | System | Error recovery attempt |
APPROVAL_REQUESTED | System | Human approval needed |
APPROVAL_DECISION | System | Approval decision made |
WORKSPACE_UPDATED | System | Memory/context updated |
ROLE_ASSIGNED | System | Agent role assigned |
DELEGATION | System | Task delegated |
WORKFLOW_FAILED, TASK_COMPLETED, TOOL_COMPLETED, TOOL_FAILED, and BUDGET_UPDATE are not emitted by the streaming API. Failures are surfaced via ERROR_OCCURRED; completion is indicated by WORKFLOW_COMPLETED.
Workflow Events
Events related to the overall task workflow.WORKFLOW_STARTED
Emitted: When a task begins execution Data:query: Original task querymode: Execution mode (SIMPLE, STANDARD, COMPLEX)session_id: Session identifierestimated_complexity: Complexity score (0.0-1.0)
WORKFLOW_COMPLETED
Emitted: When a task completes successfully Data:result: Final task resultduration_ms: Total execution timetotal_tokens: Cumulative token usagetotal_cost_usd: Total costagents_used: Number of agents invokedtools_invoked: Number of tool calls
Selected Examples
AGENT_THINKING
TOOL_INVOKED / TOOL_OBSERVATION
LLM_OUTPUT
ERROR_OCCURRED
APPROVAL_REQUESTED
BUDGET_EXCEEDED- Cost/token limit reachedTIMEOUT- Execution timeoutTOOL_EXECUTION_FAILED- Tool errorLLM_ERROR- LLM provider errorINVALID_INPUT- Malformed request
Agent Events
Events related to individual agent execution.AGENT_STARTED
Emitted: When an agent begins processing Data:AGENT_THINKING
Emitted: Agent is reasoning/processing (most frequent event) Data:AGENT_COMPLETED
Emitted: Agent finished its subtask Data:AGENT_FAILED
Emitted: Agent encountered an error Data:Tool Events
Events related to tool invocations.TOOL_INVOKED
Emitted: When a tool is called Data:TOOL_OBSERVATION
Emitted: Agent observes a tool result Data:Pattern Events
Pattern selection and decomposition events are not part of the public streaming schema and are omitted for brevity.Team Events
Multi-agent team coordination and management.TEAM_RECRUITED
Emitted: When a team of agents is assembled for execution Data:TEAM_RETIRED
Emitted: When a team is disbanded after task completion Data:TEAM_STATUS
Emitted: Periodic updates on multi-agent team coordination Data:DEPENDENCY_SATISFIED
Emitted: When task dependencies are resolved and execution can proceed Data:Message Events
Agent-to-agent communication.MESSAGE_SENT
Emitted: Agent sends message to another agent Data:MESSAGE_RECEIVED
Emitted: Agent receives message Data:LLM Events
Language model interaction events for debugging and monitoring.LLM_PROMPT
Emitted: When a prompt is sent to the LLM (sanitized for privacy) Data:LLM_PARTIAL
Emitted: Incremental LLM output chunk during streaming Data:LLM_OUTPUT
Emitted: Final LLM output for a step Data:TOOL_OBSERVATION
Emitted: Tool result observation by agent Data:Progress Events
Task progress and status updates for user feedback.PROGRESS
Emitted: General progress update during execution Data:DATA_PROCESSING
Emitted: Agent is processing or analyzing data Data:WAITING
Emitted: Agent is waiting for resources or responses Data:System Events
System-level events and errors.ERROR_OCCURRED
Emitted: System error during execution Data:ERROR_RECOVERY
Emitted: System is recovering from an error Data:APPROVAL_REQUESTED
Emitted: Human approval needed to proceed Data:APPROVAL_DECISION
Emitted: Human has made an approval decision Data:approved- Action allowed to proceeddenied- Action blockedtimeout- No decision within timeout period
WORKSPACE_UPDATED
Emitted: Working memory/context updated Data:ROLE_ASSIGNED
Emitted: Agent role assigned during execution Data:DELEGATION
Emitted: Task delegated to another agent Data:Event Ordering
Events are strictly ordered by sequence number (seq):
- Sequence numbers are monotonically increasing
- No gaps in sequence (every number from 1 to N)
- Events from same workflow always ordered correctly
Typical Event Flow (Simplified)
Event Persistence
Events are stored in:- PostgreSQL: Permanent event log
- Redis: Recent events (hot cache)
- Real-time: SSE stream
Event Reliability and Guarantees
Ordering Guarantees
Shannon provides strict ordering within a single workflow:- Events are numbered sequentially (
seqfield) - No gaps in sequence numbers (1, 2, 3, …)
- Events from the same workflow always arrive in order
- Events from different workflows may be interleaved
Delivery Guarantees
- At-least-once delivery: Events may be delivered multiple times (use
seqfor deduplication) - Event persistence: All events stored in PostgreSQL
event_logstable - Hot cache: Recent events cached in Redis for fast retrieval
- Historical access: Query past events via REST API
Stream Reconnection
If SSE connection drops:Event Retention
| Storage | Retention Period | Purpose |
|---|---|---|
| Redis | 1 hour | Real-time streaming |
| PostgreSQL | 90 days (default) | Historical queries |
| Archival | 1+ years (optional) | Long-term audit |