SmithersEvent objects throughout a run’s lifecycle. You can subscribe via the onProgress callback in runWorkflow, or read persisted events from the NDJSON log files after the fact.
Subscribing to Events
onProgress Callback
Pass anonProgress function to runWorkflow to receive events in real time:
NDJSON Log Files
When logging is enabled (the default), every event is appended as a JSON line to:SmithersEvent object serialized as JSON. You can parse these files with standard tools:
logDir to runWorkflow or --log-dir to the CLI. To disable log files entirely, pass logDir: null or --no-log.
Common Fields
EverySmithersEvent includes:
| Field | Type | Description |
|---|---|---|
type | string | The event type discriminator (e.g. "NodeStarted", "RunFinished"). |
runId | string | The run this event belongs to. |
timestampMs | number | Unix timestamp in milliseconds when the event was emitted. |
| Field | Type | Description |
|---|---|---|
nodeId | string | The task node this event relates to. |
iteration | number | The Ralph iteration number. |
| Field | Type | Description |
|---|---|---|
attempt | number | The attempt number (starts at 1, increments on retry). |
Event Types
Run Lifecycle
These events mark the overall run’s state transitions.RunStarted
Emitted once at the beginning of every run (including resumes).RunStatusChanged
Emitted when the run’s status changes (e.g. from"running" to "waiting-approval").
RunStatus is one of: "running", "waiting-approval", "finished", "failed", "cancelled".
RunFinished
Emitted when all tasks complete successfully.RunFailed
Emitted when the run fails due to a task failure or engine error.RunCancelled
Emitted when the run is cancelled viaAbortSignal.
Frame Events
FrameCommitted
Emitted each time the engine renders a new frame (a snapshot of the workflow tree).xmlHash is a SHA-256 hex digest of the canonicalized XML tree. It changes whenever the tree structure changes (e.g. new tasks appear after a Branch resolves).
Node Lifecycle
These events track individual task execution.NodePending
A task has been identified in the tree and is waiting to be scheduled.NodeStarted
A task has begun executing. Theattempt number starts at 1 and increments on each retry.
NodeFinished
A task completed successfully and its output was persisted.NodeFailed
A task attempt failed. Check theerror field for details.
NodeCancelled
A task was cancelled (e.g. because the run was aborted or the task was unmounted from the tree between frames).reason field may contain "unmounted" if the task was cancelled because it disappeared from the tree after a re-render.
NodeSkipped
A task was skipped because itsskipIf condition evaluated to true or its approval was denied with continueOnFail.
NodeRetrying
A task failed but has remaining retry attempts. This event fires before the next attempt starts.attempt field is the upcoming attempt number (e.g. 2 for the first retry).
NodeWaitingApproval
A task requires human approval and is now paused.Approval Events
ApprovalRequested
An approval request was created for a task.ApprovalGranted
A human approved the task. The task will execute on the next engine cycle.ApprovalDenied
A human denied the task. The task is marked as failed (or skipped ifcontinueOnFail is set).
Tool Events
ToolCallStarted
An agent invoked a tool (e.g.read, bash, edit).
seq field is a sequential counter for tool calls within the attempt.
ToolCallFinished
A tool call completed.Output Events
NodeOutput
Streaming text output from an agent (stdout or stderr).Revert Events
RevertStarted
A workspace revert operation has begun.RevertFinished
A workspace revert operation completed.Event Type Reference
Quick reference table of all event types and their extra fields (beyondtype, runId, timestampMs):
| 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 |
RevertStarted | nodeId, iteration, attempt, jjPointer |
RevertFinished | nodeId, iteration, attempt, jjPointer, success, error? |
Persistence
Events are persisted in two places:- SQLite database — Every event is inserted into the
_smithers_eventstable with a sequentialseqnumber, enabling replay and querying. - NDJSON log file — Each event is appended as a JSON line to
stream.ndjsonin the run’s log directory.
onProgress callback fires synchronously on the event bus before persistence.
Related
- runWorkflow — Where
onProgressis configured. - Monitoring and Logs — Practical guide to monitoring workflows.
- CLI — View run status and frames from the command line.