Skip to main content

finalize_execution

Function finalize_execution 

Source
pub async fn finalize_execution<B>(
    result: Result<Bytes, RuntimeError>,
    snapshot: &mut WorkflowSnapshot,
    backend: &B,
) -> Result<(WorkflowStatus, Option<Bytes>), RuntimeError>
where B: SnapshotStore,
Expand description

Finalize a workflow execution, converting the result to a WorkflowStatus.

On success, marks the workflow as completed in the snapshot and returns the output bytes alongside the status. On cancellation error, returns Cancelled status with details from the backend. On other errors, marks the workflow as failed.

This mirrors CheckpointingRunner::handle_execution_result.

ยงErrors

Returns an error if saving the snapshot to the backend fails.