{"record":{"id":"efad4cce5064dfcc","repo":"coleam00/Archon","slug":"workflow-parent-resume-workflow-not-found","errorCode":"workflow.parent_resume_workflow_not_found","errorMessage":"the parent workflow '${parent.workflow_name}' could not be found","messagePattern":"the parent workflow '(.+?)' could not be found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/workflows/src/executor.ts","lineNumber":1686,"sourceCode":"    // rather than silently running other source.\n    const continuation = await resolveContinuationWorkflow(deps, parent, parentCwd);\n    if (continuation) {\n      parentWorkflow = continuation.workflow;\n    } else {\n      // No recorded source: a parent predating capture, which resumes live as it always did.\n      const { workflows } = await discoverWorkflowsWithConfig(parentCwd, deps.loadConfig);\n      parentWorkflow = resolveWorkflowName(\n        parent.workflow_name,\n        workflows.map(w => w.workflow)\n      );\n    }\n  } catch (err) {\n    getLog().error({ err: err as Error, parentRunId }, 'workflow.parent_resume_discovery_failed');\n    await notifyStuck('workflow discovery failed');\n    return;\n  }\n  if (!parentWorkflow) {\n    getLog().warn(\n      { parentRunId, workflowName: parent.workflow_name },\n      'workflow.parent_resume_workflow_not_found'\n    );\n    await notifyStuck(`the parent workflow '${parent.workflow_name}' could not be found`);\n    return;\n  }\n\n  let hydrated: Awaited<ReturnType<typeof hydrateResumableRun>>;\n  try {\n    hydrated = await hydrateResumableRun(deps, parent);\n  } catch (err) {\n    // Nothing has been mutated yet on a pre-CAS throw (resumeWorkflowRun's CAS is\n    // hydrate's last step; a lost CAS throws WorkflowNotResumableError instead) —\n    // the parent stays 'paused' and manually resumable, so log and stand down.\n    if (err instanceof Error && err.name === 'WorkflowNotResumableError') {\n      // Benign race: a concurrent (manual or duplicate) resume won the CAS and\n      // now owns the parent. Not an error — no user-facing message (it IS resuming).\n      getLog().info(","sourceCodeStart":1668,"sourceCodeEnd":1704,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/executor.ts#L1668-L1704","documentation":"During child-run resume/discovery, the parent run's `workflow_name` no longer resolves to a workflow definition, so the engine cannot reconstruct the parent to resume the child. It marks the situation stuck and reports the missing workflow.","triggerScenarios":"Child resume path looks up the parent workflow by `parent.workflow_name` and discovery returns no definition (workflow file deleted/renamed, bundled workflow removed, or discovery threw separately).","commonSituations":"Renaming or deleting a workflow YAML while runs referencing it were in flight; upgrading Archon where a bundled workflow was removed; typo'd workflow name in an old run row.","solutions":["Restore the workflow definition file with the original name (restore from git)","If the rename was intentional, cancel the stuck child and re-launch under the new workflow name","Check the earlier `workflow.parent_resume_discovery_failed` error log if discovery itself threw"],"exampleFix":"# before: workflows/review-pr.yaml deleted while a child run waits\n# after\ngit checkout dev -- workflows/review-pr.yaml\n# then resume the run","handlingStrategy":"validation","validationCode":"// Before resuming, confirm the parent's workflow definition still resolves\nconst wf = await workflows.resolve(parent.workflow_name);\nif (!wf) throw new Error(`workflow '${parent.workflow_name}' no longer exists; restore it before resuming`);","typeGuard":"function workflowExists(w: unknown): w is { name: string } {\n  return typeof w === 'object' && w !== null && 'name' in w;\n}","tryCatchPattern":"try {\n  await resumeChild(childRunId);\n} catch (err) {\n  if (/could not be found/.test(err.message)) {\n    console.warn(`restore workflow '${parent.workflow_name}' (e.g. git checkout) or relaunch under the new name`);\n  } else throw err;\n}","preventionTips":["Do not delete or rename workflow files while runs referencing them are active","Keep bundled/reference workflows in place across upgrades or migrate runs first","Track workflow renames with a deprecation window rather than hard removal"],"tags":["resume","workflow","discovery"],"backgroundTag":"parent-workflow-not-found","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}