Hmbown/CodeWhale · error

workflow source for ` ` not found; tried

Error message

workflow source for `{workflow}` not found; tried {}

What it means

`resolve_workflow_source` builds an ordered list of candidate paths via `workflow_source_candidates(workflow, source_path, workspace)` and returns the first that `is_file()`. If none of the candidates exists as a regular file it bails, listing every path it tried. This exists so workflow resolution fails loudly with an actionable search trace instead of a bare NotFound downstream.

Solutions

  1. Check the 'tried ...' list in the message and place your workflow file at one of those paths (e.g. the workspace workflows directory).
  2. Fix typos in the workflow name or pass an explicit source path (`--source <file>`) pointing at the real file.
  3. Run the command from the workspace root that actually contains the workflow.
  4. If the workflow was renamed in a newer version, use the new name or restore the file.

Example fix

// before
codewhale workflow run deploiy
// error: workflow source for `deploiy` not found; tried ./workflows/deploiy.toml, ...

// after
codewhale workflow run deploy
// or: codewhale workflow run deploy --source /path/to/deploy.toml
Defensive patterns

Strategy: validation

Validate before calling

let candidates = ["./workflows", "~/.config/codewhale/workflows"];
if !candidates.iter().any(|d| std::path::Path::new(d).join(format!("{workflow}.toml")).is_file()) {
    eprintln!("workflow '{workflow}' not found in known locations");
}

Try / catch

match resolve_workflow_source(wf, src, ws) {
    Err(e) if e.to_string().starts_with("workflow source for") => {
        eprintln!("pass --source <file> with the workflow's real path");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Calling a workflow command with a `workflow` name whose source file is absent from all standard locations: explicit `--source`/`source_path` missing, no file in the workspace workflow directory, and no packaged/builtin candidate matching the name.

Common situations: Typo in the workflow name, workflow file lives outside the workspace directory the command was run from, a custom `source_path` points to a directory that was moved, or the workflow was renamed/deleted in a newer version.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/2bc9d3c2f99a2389. Report an issue: GitHub.

Appendix: source

Thrown at crates/cli/src/lib.rs:1195

            let root = PathBuf::from(root);
            return Ok(root.canonicalize().unwrap_or(root));
        }
    }
    Ok(cwd)
}

fn resolve_workflow_source_path(
    workflow: &str,
    source_path: Option<&PathBuf>,
    workspace: &Path,
) -> Result<PathBuf> {
    let candidates = workflow_source_candidates(workflow, source_path, workspace);
    for candidate in &candidates {
        if candidate.is_file() {
            return Ok(candidate.clone());
        }
    }
    bail!(
        "workflow source for `{workflow}` not found; tried {}",
        candidates
            .iter()
            .map(|p| p.display().to_string())
            .collect::<Vec<_>>()
            .join(", ")
    )
}

fn workflow_source_candidates(
    workflow: &str,
    source_path: Option<&PathBuf>,
    workspace: &Path,
) -> Vec<PathBuf> {
    let mut candidates = Vec::new();
    if let Some(path) = source_path {
        candidates.push(resolve_against_workspace(path, workspace));
        return candidates;

View on GitHub (pinned to 73e0f67d83)