Events
Hypergraph emits structured events during graph execution for observability, logging, and monitoring.Event Types
All events inherit fromBaseEvent with common fields:
Unique identifier for the run that produced this event
Unique identifier for this event’s scope (auto-generated)
Span ID of the parent scope, or None for root runs
Unix timestamp when the event was created (auto-generated)
RunStartEvent
Emitted when a graph run begins.Name of the graph being executed
Optional workflow identifier for tracking related runs
Whether this run is part of a map operation
Number of items in the map operation, if applicable
RunEndEvent
Emitted when a graph run completes.Name of the graph that was executed
Outcome of the run (RunStatus.COMPLETED or RunStatus.FAILED)
Error message if status is FAILED
Wall-clock duration in milliseconds
NodeStartEvent
Emitted when a node begins execution.Name of the node
Name of the graph containing the node
NodeEndEvent
Emitted when a node completes successfully.Name of the node
Name of the graph containing the node
Wall-clock duration in milliseconds
Whether the result was served from cache
CacheHitEvent
Emitted when a node result is served from cache.Name of the cached node
Name of the graph containing the node
The cache key that was hit
NodeErrorEvent
Emitted when a node fails with an exception.Name of the node
Name of the graph containing the node
Error message
Fully qualified exception type name
RouteDecisionEvent
Emitted when a routing node makes a decision.Name of the routing node
Name of the graph containing the node
The chosen target(s)
InterruptEvent
Emitted when execution is interrupted for human-in-the-loop.Name of the node that triggered the interrupt
Name of the graph containing the node
Optional workflow identifier
The interrupt payload
Parameter name expected for the response
StopRequestedEvent
Emitted when a stop is requested on a workflow.Optional workflow identifier
Event Processors
Event processors receive and handle execution events.EventProcessor
Base class for synchronous event processing.AsyncEventProcessor
Base class for asynchronous event processing.TypedEventProcessor
Type-safe event processor with handler methods for specific event types.on_run_start(event: RunStartEvent)on_run_end(event: RunEndEvent)on_node_start(event: NodeStartEvent)on_node_end(event: NodeEndEvent)on_cache_hit(event: CacheHitEvent)on_node_error(event: NodeErrorEvent)on_route_decision(event: RouteDecisionEvent)on_interrupt(event: InterruptEvent)on_stop_requested(event: StopRequestedEvent)
RichProgressProcessor
Built-in processor that displays a progress bar using Rich.Whether to show progress bar
Whether to show tree view of nested graph execution
Rich Console instance, or None to auto-create