OptionalclearCalled before each run to reset per-run state. Implement for stateful recorders.
OptionalonCalled at the end of EVERY attempt — a stage's own, and the calls and
observed attempts it makes during the stage (filter on record.kind) —
with its record and the decision that followed (10.1). See
FlowAttemptEvent.
OptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonCalled once per top-level executor.run() AFTER traversal completes
cleanly. Carries event.payload = chart's return value. NOT fired on
pause (the run didn't end) or uncaught error.
OptionalonCalled once per top-level executor.run() when the run throws a
non-pause error, BEFORE the exception propagates. The TERMINAL
counterpart to onRunEnd — lets a monitor close the run boundary on
failure instead of waiting forever. NOT fired on pause.
OptionalonCalled once per top-level executor.run() BEFORE traversal begins.
Carries event.payload = run({input}). Subflow-traversers don't fire it.
OptionalonOptionalonOptionalonCalled once per failed attempt that WILL be retried, for stages carrying a
declared retry policy. The final failure arrives via onError instead,
so a stage never reports the same failure twice. See
FlowStageRetryEvent for the exact event arithmetic.
OptionalonOptionalonOptionalonCalled when a dynamic subflow is registered during traversal.
OptionalonCalled when a fork child's error is classified as throttling by the
executor's throttlingErrorChecker — see FlowThrottledEvent.
OptionaltoOptional: expose collected data for inclusion in snapshots.
FlowRecorder — Pluggable observer for control flow events.
Mirrors the scope-level ScopeRecorder pattern for the engine layer. All methods are optional — implement only the hooks you need. Recorders are invoked synchronously in attachment order. If a recorder throws, the error is caught and swallowed; execution continues.
Example