{"record":{"id":"c078d0810a0b0249","repo":"coleam00/Archon","slug":"workflow-workflow-name-is-not-present-in-the","errorCode":null,"errorMessage":"workflow '${workflow.name}' is not present in the captured source","messagePattern":"workflow '(.+?)' is not present in the captured source","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/orchestrator/orchestrator.ts","lineNumber":556,"sourceCode":"    preparedSource = await prepareWorkflowSource(workflowDeps, {\n      sourceRoot: workflowSourceRoot,\n    });\n    // From here the owner reclaims it unless a run adopts it, whichever way we leave.\n    owner.hold(preparedSource);\n    // See the note in orchestrator-agent.ts: an empty capture means the definition came\n    // from a binary's embedded bundled set, which has nothing on disk to re-read.\n    if (preparedSource.manifest.scopes.length > 0) {\n      const { workflows: capturedWorkflows } = await discoverWorkflowsWithConfig(\n        workerCwd,\n        loadConfig,\n        preparedSource.roots\n      );\n      const reResolved = resolveWorkflowName(\n        workflow.name,\n        capturedWorkflows.map(w => w.workflow)\n      );\n      if (!reResolved) {\n        throw new Error(`workflow '${workflow.name}' is not present in the captured source`);\n      }\n      workflow = reResolved;\n    }\n    await recordSelectedWorkflow(preparedSource.captureRoot, workflow.name);\n  } catch (error) {\n    const err = error as Error;\n    // Reclaim before returning: this branch is the console's default dispatch path, and\n    // leaving the tree behind here leaks one capture per failed dispatch.\n    getLog().error({ err, workflowName: workflow.name }, 'workflow.source_capture_failed');\n    await ctx.platform.sendMessage(\n      ctx.conversationId,\n      `Could not capture the workflow source for **${workflow.name}**: ${err.message}. ` +\n        'Nothing has been started.'\n    );\n    return;\n  }\n\n  // 7. Pre-create workflow run row so the UI can fetch it immediately.","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/orchestrator/orchestrator.ts#L538-L574","documentation":"After a workflow source is captured (preparedSource), dispatchBackgroundWorkflowOwned re-resolves the requested workflow name against the workflows actually present in the captured source. If resolveWorkflowName cannot find it, the throw prevents dispatching a workflow that does not exist in that snapshot. This guards against name drift between what was requested and what was captured.","triggerScenarios":"Dispatching by workflow name when the captured source (repo/branch/capture root) does not contain that workflow — renamed workflow file, wrong branch captured, workflows moved or deleted, or a name that only resolves loosely and fails the strict re-resolution.","commonSituations":"Workflow renamed upstream after a caller pinned the old name; dispatching against an old pinned branch/commit that lacks the new workflow; bundling a custom workflow pack that was never committed to the captured source.","solutions":["List the workflows available in the captured source and use an exact present name.","Re-capture the workflow source from the branch/commit that actually contains the workflow.","Fix the workflow name in the dispatch request (typos, case, path vs name).","Commit the workflow file to the repository branch being captured."],"exampleFix":"// before\nresolveWorkflowName('fix-issue', capturedWorkflows.map(w => w.workflow)); // null\n// after: dispatch with a name present in the captured source\nresolveWorkflowName('coding/fix-issue', capturedWorkflows.map(w => w.workflow));","handlingStrategy":"validation","validationCode":"const available = capturedWorkflows.map(w => w.workflow);\nif (!available.some(w => resolveWorkflowName(requestedName, available))) {\n  throw new Error(`workflow ${requestedName} not in captured source; available: ${available.map(w => w.name)}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await dispatchBackgroundWorkflow(req);\n} catch (e) {\n  if (e.message.includes('not present in the captured source')) {\n    console.error('Re-capture source or fix the workflow name');\n  } else throw e;\n}","preventionTips":["List workflows in the captured source before dispatching by name.","Pin dispatches to a branch that is known to contain the workflow.","Update callers promptly when a workflow is renamed or moved."],"tags":["orchestrator","workflow","not-found"],"backgroundTag":"workflow-not-found","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}