Skip to content

executionLog()

Creates a reactive execution log for workflow step tracking. Backed by reactiveLog (Phase 3b).

Signature

ts
function executionLog(opts?: ExecutionLogOptions): ExecutionLogResult

Parameters

ParameterTypeDescription
optsExecutionLogOptionsOptional configuration.

Returns

ExecutionLogResult — reactive log with step filtering, pipeline auto-connect, and optional persistence.

MethodSignatureDescription
logReactiveLog\<ExecutionEntry\>Underlying reactive log.
append(entry)(entry) => numberAppend an execution event.
forStep(step)(step) => ExecutionEntry[]Get entries for a specific step.
latestStore\<ExecutionEntry \undefined>
lengthStore\<number\>Reactive entry count.
persistErrorStore\<unknown\>Last persist error (null when healthy).
connectPipeline(stepMeta, names)(...) => () => voidAuto-log pipeline step events.
clear()() => voidClear the log.
destroy()() => voidDestroy and clean up.

Basic Usage

ts
import { executionLog } from 'callbag-recharge/orchestrate';
import { pipeline, step, fromTrigger } from 'callbag-recharge/orchestrate';

const log = executionLog({ maxSize: 500 });
const wf = pipeline({
    trigger: step(fromTrigger<number>()),
  });
const unsub = log.connectPipeline(wf.stepMeta, wf.order);
// Events auto-logged as pipeline runs
log.forStep("trigger"); // all events for "trigger" step
unsub();

Options / Behavior Details

  • Auto-logging: connectPipeline() subscribes to per-step metadata stores and auto-appends start/value/complete/error events.
  • Persistence: Optional adapter writes through on every append. Load on construction for recovery.
  • Bounded: Set maxSize for production to prevent unbounded memory growth.

See Also

Released under the MIT License.