Expand description
Workflow Checkpoint Storage Primitives (Task 6)
This module provides durable workflow state persistence as a storage primitive, NOT an orchestration framework. External frameworks (Temporal, Airflow, custom) can use this as a clean storage API for:
- Checkpoint storage:
CHECKPOINT(run_id, node_id, state_blob) - Checkpoint retrieval:
RESUME(run_id) - Run metadata
§Architecture Decision
SochDB is the source of truth for state (runs/events/checkpoints). Scheduling and execution are handled by external orchestrators. This separation of concerns:
- Preserves clean API boundaries
- Avoids building a competing orchestration framework
- Enables easy integration with existing tools
§Complexity
- Checkpoint write: O(S) where S is state size
- Checkpoint read: O(S)
- List checkpoints: O(log N + k) with index
- Recovery: O(S + m) where m is events since snapshot
§Schema
_checkpoints/{run_id}/meta -> RunMetadata
_checkpoints/{run_id}/nodes/{node_id} -> CheckpointData
_checkpoints/{run_id}/events/{seq} -> EventDataStructs§
- Checkpoint
- A checkpoint snapshot
- Checkpoint
Meta - Metadata about a checkpoint (without the state blob)
- Default
Checkpoint Store - Default checkpoint store implementation using ConnectionTrait
- RunMetadata
- Metadata about a workflow run
- Workflow
Event - An event in the workflow event log
Enums§
- RunStatus
- Status of a workflow run
Traits§
- Checkpoint
Store - Trait defining the checkpoint storage interface