coleam00/Archon · error

Multiple packaged workflows declare the name '${name}'

Error message

Multiple packaged workflows declare the name '${name}'

What it means

findPackagedWorkflowAt resolves a workflow name to exactly one file under the packaged-workflow directories. If two different files in the scanned packs (folder name, YAML stem, or frontmatter `name`) both resolve to the requested name, the function throws rather than returning an ambiguous match. This protects run creation from silently launching the wrong workflow.

Source

Thrown at packages/server/src/routes/api.ts:208

        .sort((a, b) => a.localeCompare(b));
      if (yamlFiles.length !== 1) continue;

      const yamlFilename = yamlFiles[0];
      const absolutePath = join(workflowPath, yamlFilename);
      let content: string;
      try {
        content = await readFile(absolutePath, 'utf-8');
      } catch (error) {
        if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue;
        throw error;
      }
      const parsed = parseWorkflow(content, yamlFilename);
      const yamlStem = yamlFilename.replace(/\.ya?ml$/, '');
      const isMalformedTarget =
        parsed.workflow === null && (yamlStem === name || workflowFolder === name);
      if (parsed.workflow?.name !== name && !isMalformedTarget) continue;
      if (match !== null) {
        throw new Error(`Multiple packaged workflows declare the name '${name}'`);
      }
      match = {
        absolutePath,
        filename: `${pack}/${workflowFolder}/${yamlFilename}`,
        packaged: true,
        parsed,
      };
    }
  }
  return match;
}

async function findWorkflowAt(
  workflowsRoot: string,
  name: string
): Promise<RawWorkflowFile | null> {
  return (
    (await tryReadWorkflowAt(workflowsRoot, name)) ??

View on GitHub (pinned to 0773b97458)

Solutions

  1. Find the duplicate: grep the workflow packs for `name: '<the name>'` in the frontmatter and rename one workflow's `name:` to a unique value.
  2. If a malformed YAML file is the second match, fix its syntax or remove/rename it so it no longer collides.
  3. Remove an obsolete copy of the workflow left behind after a fork or pack update.
  4. Reference the workflow by its file path/id instead of name if supported, until the duplicate is resolved.

Example fix

# before: two packs both contain
name: fix-issue
# after: rename one
name: fix-issue-v2
Defensive patterns

Strategy: validation

Validate before calling

const names = new Set<string>();
for (const f of workflowFiles) {
  const name = parseWorkflow(readFileSync(f, 'utf8'), f).workflow?.name;
  if (name && names.has(name)) throw new Error(`Duplicate packaged workflow name: ${name} (${f})`);
  if (name) names.add(name);
}

Try / catch

try {
  const wf = await getWorkflowByName(name);
} catch (e) {
  if (/Multiple packaged workflows declare the name/i.test(e?.message ?? '')) {
    logError(`Ambiguous workflow name '${name}'; rename one copy in the packs.`);
  } else throw e;
}

Prevention

When it happens

Trigger: GET/lookup by workflow name via findWorkflowAt/hit/packaged, where two files across packs both match: same frontmatter `name:` in different packs, or a folder/stem collision with a malformed YAML file (isMalformedTarget) that also matches the name.

Common situations: Forking a bundled/packaged workflow and leaving the original `name:` in frontmatter while renaming only the file; two workflow packs installed side by side each containing a workflow with the same name; a broken YAML file whose stem equals a valid workflow's name, counted as a second match.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/40344e85b6c83d59. Report an issue: GitHub.