pub async fn pause(
context: &PauseWorkflowContext<'_>,
id: &WorkflowId,
run: &RunId,
reason: Option<String>,
operator: Option<String>,
) -> Result<WorkflowHandle, EngineError>Expand description
Pauses a live, Running run: appends WorkflowPaused through the resident
handle’s own recorder (single-writer, cancel precedent) and inserts the run
into the shared dispatch-hold set. The resident process is left alive.
§Errors
Returns EngineError::WorkflowNotFound when no history / no resident handle
exists for (id, run), and EngineError::InvalidState — naming the actual
status — when the run is not Running (e.g. Completed, already Paused). A
rejection appends nothing to history.