Advanced
Raw event listener
createInMemoryOrchestratorStore can receive each raw workflow event as it is appended:
The callback runs from appendEvent. If it throws, the append rejects and the run follows core's event-hook failure behavior.
The in-memory store keeps at most 100 snapshots and 5,000 events by default. Pass maxSnapshots or maxEvents to tune retention, or Infinity to disable a cap.
Recovery
createOrchestrator can lazily recover a missing managed run from a stored snapshot when waitForRun, cancelRun, or cancelTask receives a run id that is not active in memory:
Recovery delegates to core runner snapshot recovery. If interruptedTasks is omitted, core uses the workflow recovery config and then falls back to "manual".
Notes
- Workers execute one task job, not a full workflow.
- Workers use core's
TaskRegistryfor real task handlers. - The host orchestrator uses core's
createRunnerfor DAG state. worker/threadprovides local process isolation, not a hostile-code security sandbox.- Persistence is interface-ready; alpha includes only the in-memory store.