tinyhumansai/openhuman · error

unknown workflow definition

Error message

unknown workflow definition: {definition_id}

What it means

start_workflow_run could not resolve definition_id to any registered builtin WorkflowDefinition. The definition registry is fixed at build/config time; the faulting input is the definition id — unknown, renamed, or a workflow whose registration is gated off. Fails before any ledger row is created, so no run exists.

Solutions

  1. List registered workflow definitions and use a valid id
  2. If the workflow was renamed/removed, update the caller to a current definition id
  3. For custom workflows, register the definition before starting a run
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:166 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/282e82a0bbd54dd3. Report an issue: GitHub.

Appendix: source

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

/// Start a new workflow run and return immediately.
///
/// Resolves `definition_id` to a builtin [`WorkflowDefinition`], creates a
/// `Running` ledger row with `phase_states` initialised to one `pending` entry
/// per phase, persists it, then `tokio::spawn`s the engine loop. The returned
/// [`WorkflowRun`] is the freshly-created row (status `Running`); callers poll
/// `workflow_run_get` to observe progress.
pub async fn start_workflow_run(
    config: &Config,
    definition_id: &str,
    input: Value,
    parent_thread_id: Option<String>,
) -> Result<WorkflowRun> {
    log::debug!(
        target: LOG_TARGET,
        "[workflow_run_engine] start.entry definition={definition_id} parent_thread={parent_thread_id:?}"
    );
    let definition = definition_by_id(definition_id)
        .ok_or_else(|| anyhow!("unknown workflow definition: {definition_id}"))?;

    let run_id = format!("wfrun-{}", uuid::Uuid::new_v4());
    let phase_states = init_phase_states(&definition);

    let run = upsert_workflow_run(
        &config.workspace_dir,
        WorkflowRunUpsert {
            id: run_id.clone(),
            definition_id: definition.id.clone(),
            parent_thread_id,
            input: input.clone(),
            phase_states,
            child_run_ids: Vec::new(),
            status: WorkflowRunStatus::Running,
            summary: None,
            started_at: None,
            completed_at: None,
        },

View on GitHub (pinned to 7491200858)