SmithersEvent objects throughout a run. Subscribe via onProgress in runWorkflow, or read persisted events from NDJSON log files.
Events serve as the durable replay/audit log, correlate with structured logs through runId/nodeId/attempt, and drive built-in lifecycle counters. For OTLP export and Prometheus/Grafana setup, see Observability.
Subscribing
onProgress Callback
NDJSON Log Files
Events are appended as JSON lines to:logDir in runWorkflow or --log-dir / --no-log in the CLI.
Event-Driven Metrics
| Event | Metric |
|---|---|
RunStarted | smithers.runs.total |
NodeStarted | smithers.nodes.started |
NodeFinished | smithers.nodes.finished |
NodeFailed | smithers.nodes.failed |
| Approval events | Approval counters |
trackSmithersEvent from smithers-orchestrator/observability exposes this mapping for custom integrations.
Common Fields
EverySmithersEvent:
| Field | Type | Description |
|---|---|---|
type | string | Event type discriminator. |
runId | string | Run this event belongs to. |
timestampMs | number | Unix timestamp in milliseconds. |
| Field | Type | Description |
|---|---|---|
nodeId | string | Task node ID. |
iteration | number | Loop iteration number. |
| Field | Type | Description |
|---|---|---|
attempt | number | Attempt number (starts at 1). |
Event Types
Run Lifecycle
RunStarted
Emitted once at the beginning of every run (including resumes).RunStatusChanged
RunStatus: "running" | "waiting-approval" | "finished" | "failed" | "cancelled".
RunFinished
RunFailed
RunCancelled
Frame Events
FrameCommitted
Emitted each time the engine renders a new frame.xmlHash: SHA-256 hex digest of the canonicalized XML tree.
Node Lifecycle
NodePending
Task identified, waiting to be scheduled.NodeStarted
NodeFinished
NodeFailed
NodeCancelled
reason may be "unmounted" if the task disappeared from the tree after re-render.
NodeSkipped
NodeRetrying
Fires before the next attempt starts.attempt is the upcoming attempt number.
NodeWaitingApproval
Approval Events
ApprovalRequested
ApprovalGranted
ApprovalDenied
Tool Events
ToolCallStarted
seq: sequential counter for tool calls within the attempt.
ToolCallFinished
Output Events
NodeOutput
Streaming text from an agent.Revert Events
RevertStarted
RevertFinished
Hot Reload
WorkflowReloadDetected
WorkflowReloaded
generation: monotonically increasing reload counter.
WorkflowReloadFailed
WorkflowReloadUnsafe
Quick Reference
| Event Type | Extra Fields |
|---|---|
RunStarted | — |
RunStatusChanged | status |
RunFinished | — |
RunFailed | error |
RunCancelled | — |
FrameCommitted | frameNo, xmlHash |
NodePending | nodeId, iteration |
NodeStarted | nodeId, iteration, attempt |
NodeFinished | nodeId, iteration, attempt |
NodeFailed | nodeId, iteration, attempt, error |
NodeCancelled | nodeId, iteration, attempt?, reason? |
NodeSkipped | nodeId, iteration |
NodeRetrying | nodeId, iteration, attempt |
NodeWaitingApproval | nodeId, iteration |
ApprovalRequested | nodeId, iteration |
ApprovalGranted | nodeId, iteration |
ApprovalDenied | nodeId, iteration |
ToolCallStarted | nodeId, iteration, attempt, toolName, seq |
ToolCallFinished | nodeId, iteration, attempt, toolName, seq, status |
NodeOutput | nodeId, iteration, attempt, text, stream |
AgentEvent | nodeId, iteration, attempt, engine, event |
RevertStarted | nodeId, iteration, attempt, jjPointer |
RevertFinished | nodeId, iteration, attempt, jjPointer, success, error? |
WorkflowReloadDetected | changedFiles |
WorkflowReloaded | generation, changedFiles |
WorkflowReloadFailed | error, changedFiles |
WorkflowReloadUnsafe | reason, changedFiles |
RunHijackRequested | target? |
RunHijacked | nodeId, iteration, attempt, engine, mode, resume?, cwd |
ScorerStarted | nodeId, scorerId, scorerName |
ScorerFinished | nodeId, scorerId, scorerName, score |
ScorerFailed | nodeId, scorerId, scorerName, error |
TokenUsageReported | nodeId, iteration, attempt, model, agent, inputTokens, outputTokens, cacheReadTokens?, cacheWriteTokens?, reasoningTokens? |
Persistence
Events are persisted in two places:- SQLite —
_smithers_eventstable with sequentialseqnumber. Source of truth. - NDJSON —
stream.ndjsonin the run’s log directory. Best-effort.
onProgress fires synchronously before persistence.
Related
- runWorkflow — Where
onProgressis configured. - Monitoring and Logs — Practical monitoring guide.
- CLI — View run status and frames.