{"record":{"id":"c0b3e6f5aa20266a","repo":"coleam00/Archon","slug":"cannot-execute-run-detachedprecreatedrun-id","errorCode":null,"errorMessage":"Cannot execute run '${detachedPreCreatedRun.id}': it is ${detachedPreCreatedRun.status}, not a run awaiting its first execution. Resume it with `archon workflow resume` instead.","messagePattern":"Cannot execute run '(.+?)': it is (.+?), not a run awaiting its first execution\\. Resume it with `archon workflow resume` instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1499,"sourceCode":"  // closed evidence. The `workflow_name` match (checked once the workflow resolves,\n  // below) is what stops one launch's row being executed as another workflow. Neither is\n  // redundant with the process-group check, and removing either reopens its own outcome.\n  let detachedPreCreatedRun: WorkflowRun | undefined;\n  if (options.detachedRunId !== undefined) {\n    if (!detachedProcessOwner) {\n      throw new Error(\n        '--internal-detached-run-id is set by a detached launch for its own child. ' +\n          'Use `archon workflow run <name> --detach`.'\n      );\n    }\n    detachedPreCreatedRun = (await workflowDb.getWorkflowRun(options.detachedRunId)) ?? undefined;\n    if (!detachedPreCreatedRun) {\n      throw new Error(\n        `Detached workflow child cannot find the run '${options.detachedRunId}' its launcher created.`\n      );\n    }\n    if (detachedPreCreatedRun.status !== 'pending') {\n      throw new Error(\n        `Cannot execute run '${detachedPreCreatedRun.id}': it is ${detachedPreCreatedRun.status}, ` +\n          'not a run awaiting its first execution. Resume it with `archon workflow resume` instead.'\n      );\n    }\n  }\n\n  let preparedSource: PreparedWorkflowSource | undefined;\n  // Pinned at the moment of prepare so the SIGINT/SIGTERM cleanup never rm's a\n  // path a live run is reading from. For `--container` folder-codebase runs,\n  // `finalizeWorkflowSource` (workflow.ts:1749) reassigns `preparedSource` to a\n  // new object whose `captureRoot` is the LIVE artifacts directory the run\n  // executes from — rm-ing `preparedSource.captureRoot` on Ctrl-C mid-run would\n  // destroy the run's source. The original staged path is renamed away by\n  // either `finalizeWorkflowSource` (container) or `executeWorkflow`'s rename\n  // (everything else), so an `rm` against it is a no-op once prep has moved it.\n  let originalStagedRoot: string | undefined;\n  if (!isContinuation && !options.dryRun && !options.stubsInitPath) {\n    try {","sourceCodeStart":1481,"sourceCodeEnd":1517,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1481-L1517","documentation":"Error \"Cannot execute run '${detachedPreCreatedRun.id}': it is ${detachedPreCreatedRun.status}, not a run awaiting its first execution. Resume it with `archon workflow resume` instead.\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/commands/workflow.ts:1499 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}