tinyhumansai/openhuman · error

unknown workflow run

Error message

unknown workflow run: {id}

What it means

resume_workflow_run (or stop path) reloaded a run id from the ledger and found nothing — the run row does not exist in this workspace. Faulting input is the id: deleted run, different workspace_dir, or a stale id held by the UI/orchestrator after a ledger reset.

Solutions

  1. List workflow runs to confirm existing ids and re-issue
  2. Verify the workspace_dir matches where the run was created
  3. Restart the workflow from its definition if the old run is gone
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:293 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/a6ae63f6d8bfa2b2. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:293

    )
    .context("persist workflow run interrupt")?;

    log::debug!(target: LOG_TARGET, "[workflow_run_engine] stop.marked_interrupted run={id}");
    Ok(Some(updated))
}

/// Resume an interrupted (or otherwise incomplete) workflow run.
///
/// Reloads the run, clears any stale cancellation flag, flips the row back to
/// `Running`, and spawns a fresh engine loop. Phases already `completed` in
/// `phase_states` are skipped; the loop continues from the first incomplete
/// phase whose dependencies are satisfied. Returns the run row (now `Running`),
/// or an error if the run is unknown / already terminal-complete / its
/// definition no longer exists.
pub async fn resume_workflow_run(config: &Config, id: &str) -> Result<WorkflowRun> {
    log::debug!(target: LOG_TARGET, "[workflow_run_engine] resume.entry run={id}");
    let run = get_workflow_run(&config.workspace_dir, id)?
        .ok_or_else(|| anyhow!("unknown workflow run: {id}"))?;

    if matches!(run.status, WorkflowRunStatus::Completed) {
        return Err(anyhow!("workflow run {id} is already completed"));
    }

    let definition = definition_by_id(&run.definition_id)
        .ok_or_else(|| anyhow!("definition {} no longer exists", run.definition_id))?;

    // Clear any prior cancellation intent and re-register a fresh flag.
    clear_cancel_flag(id);
    register_cancel_flag(id);

    let resumed = upsert_workflow_run(
        &config.workspace_dir,
        WorkflowRunUpsert {
            id: run.id.clone(),
            definition_id: run.definition_id.clone(),
            parent_thread_id: run.parent_thread_id.clone(),

View on GitHub (pinned to 7491200858)