Long-running workflows should not collapse to a terminal failure just because a child session hit a transient provider, network, or local execution problem. The workflow runtime should pause with actionable recovery metadata and let the user decide how to continue.
paused with failure, pauseReason, and
recoveryActions.WorkflowRunStatus includes paused. A paused workflow is non-terminal and may be resumed or
retried.
interface WorkflowFailure {
code?: string;
kind:
| "network"
| "rate_limit"
| "timeout"
| "auth"
| "provider"
| "model_context"
| "configuration"
| "permission"
| "tool"
| "cancelled"
| "unknown";
message: string;
retryable: boolean;
recoverable: boolean;
activityId?: string;
nodeId?: string;
phase?: string;
sessionId?: string;
traceId?: string;
turnId?: string;
}
interface WorkflowRecoveryAction {
action: "retry" | "retry_with_current_model" | "skip_node" | "cancel";
activityId?: string;
destructive?: boolean;
label: string;
nodeId?: string;
phase?: string;
}
cancelled.completed.failed.retry resets the selected failed graph node, or the failed nodes in the current phase, to
pending, clears run-level pause metadata, and re-enters the workflow executor.retry_with_current_model has the same runtime operation as retry; the distinction is for UI
copy after the user changes model.skip_node is not required for the first implementation unless the workflow definition marks a
node as optional.failed should be reserved for unrecoverable workflow-level corruption or explicit user choice.ZCode protocol clients use extension methods:
zcode.dev/workflow/get: returns snapshot.failure, snapshot.recoveryActions, and
snapshot.sessionLinks.zcode.dev/workflow/retry: retries a paused workflow, optionally scoped by nodeId,
activityId, or phase.zcode.dev/workflow/cancel: remains the terminal stop operation.workflow/retry forwards kind, definition id, run id, and node selector.