BaseEvent is the typed payload + runtime state object that flows through the bus.
Use subclassing (Python) or BaseEvent.extend(...) (TypeScript) to define event payload fields.
Defining events
- Python
- TypeScript
Core metadata fields
Common event metadata fields available in both runtimes:event_id: unique UUIDv7event_type: event name/type keyevent_version: payload version markerevent_result_type: expected handler return schema/typeevent_timeout: per-event timeout overrideevent_handler_timeout: per-handler timeout cap overrideevent_handler_slow_timeout: per-handler slow warning thresholdevent_concurrency: event scheduling mode overrideevent_handler_concurrency: handler scheduling mode overrideevent_handler_completion: handler completion strategy override
Runtime fields
event_status: pending/started/completedevent_created_at,event_started_at,event_completed_atevent_parent_id: parent event linkevent_path: buses traversedevent_results: per-handler result entries- Child-event tracking (
event_children/descendants)
Completion model
Events are returned in pending state fromemit()/emit(), then complete asynchronously.
- Python
- TypeScript
Result access helpers
first()
- Python
- TypeScript
All results
- Python
- TypeScript
reset()
You can create a fresh pending copy for re-emit.
- Python
- TypeScript
Serialization
Events are JSON-serializable in both implementations for bridge and cross-runtime workflows.- Python
- TypeScript
Notes
- Keep custom payload field names away from
event_*reserved metadata names. event_result_typedrives handler return validation in both runtimes.- Parent-child tracking is automatic when events are emitted from handlers.