Resume a paused or failed workflow run.
(
run_id: str = typer.Argument(..., help="Run ID to resume"),
input_values: list[str] | None = typer.Option(
None, "--input", "-i", help="Updated input values as key=value pairs"
),
json_output: bool = typer.Option(
False,
"--json",
help="Emit the resume outcome as a single JSON object instead of formatted text.",
),
)
| 391 | |
| 392 | @workflow_app.command("resume") |
| 393 | def workflow_resume( |
| 394 | run_id: str = typer.Argument(..., help="Run ID to resume"), |
| 395 | input_values: list[str] | None = typer.Option( |
| 396 | None, "--input", "-i", help="Updated input values as key=value pairs" |
| 397 | ), |
| 398 | json_output: bool = typer.Option( |
| 399 | False, |
| 400 | "--json", |
| 401 | help="Emit the resume outcome as a single JSON object instead of formatted text.", |
| 402 | ), |
| 403 | ): |
| 404 | """Resume a paused or failed workflow run.""" |
| 405 | from . import load_custom_steps |
| 406 | from .engine import WorkflowEngine |
| 407 | |
| 408 | project_root = _require_specify_project() |
| 409 | load_custom_steps(project_root) |
| 410 | engine = WorkflowEngine(project_root) |
| 411 | if not json_output: |
| 412 | engine.on_step_start = lambda sid, label: console.print(f" \u25b8 [{sid}] {label} \u2026") |
| 413 | |
| 414 | inputs = _parse_input_values(input_values) |
| 415 | |
| 416 | try: |
| 417 | with _stdout_to_stderr_when(json_output): |
| 418 | state = engine.resume(run_id, inputs or None) |
| 419 | except FileNotFoundError: |
| 420 | console.print(f"[red]Error:[/red] Run not found: {run_id}") |
| 421 | raise typer.Exit(1) |
| 422 | except ValueError as exc: |
| 423 | console.print(f"[red]Error:[/red] {exc}") |
| 424 | raise typer.Exit(1) |
| 425 | except Exception as exc: |
| 426 | console.print(f"[red]Resume failed:[/red] {exc}") |
| 427 | raise typer.Exit(1) |
| 428 | |
| 429 | if json_output: |
| 430 | _emit_workflow_json(_workflow_run_payload(state)) |
| 431 | raise typer.Exit(_run_outcome_exit_code(state.status.value)) |
| 432 | |
| 433 | status_colors = { |
| 434 | "completed": "green", |
| 435 | "paused": "yellow", |
| 436 | "failed": "red", |
| 437 | "aborted": "red", |
| 438 | } |
| 439 | color = status_colors.get(state.status.value, "white") |
| 440 | console.print(f"\n[{color}]Status: {state.status.value}[/{color}]") |
| 441 | |
| 442 | raise typer.Exit(_run_outcome_exit_code(state.status.value)) |
| 443 | |
| 444 | |
| 445 | @workflow_app.command("status") |
nothing calls this directly
no test coverage detected