pub async fn materialize(
backend: &dyn StateBackend,
execution_id: &ExecutionId,
) -> Result<MaterializedState, StateBackendError>Expand description
Reconstruct the current workflow state from the event log.
Algorithm:
- Load the latest snapshot (if any). If none, start from the initial_input.
- Load all events since the snapshot’s
at_sequence. - Apply state patches from
NodeCompletedevents in order. - Derive
status,completed_nodes, andactive_nodesfrom all events.