{"record":{"id":"21805864a44a938b","repo":"Significant-Gravitas/AutoGPT","slug":"graph-graph-id-not-found","errorCode":null,"errorMessage":"Graph #{graph_id} not found.","messagePattern":"Graph #(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/external/v1/routes.py","lineNumber":288,"sourceCode":"        require_permission(APIKeyPermission.READ_GRAPH)\n    ),\n) -> GraphExecutionResult:\n    graph_exec = await execution_db.get_graph_execution(\n        user_id=auth.user_id,\n        execution_id=graph_exec_id,\n        include_node_executions=True,\n    )\n    if not graph_exec:\n        raise HTTPException(\n            status_code=404, detail=f\"Graph execution #{graph_exec_id} not found.\"\n        )\n\n    if not await graph_db.get_graph(\n        graph_id=graph_exec.graph_id,\n        version=graph_exec.graph_version,\n        user_id=auth.user_id,\n    ):\n        raise HTTPException(status_code=404, detail=f\"Graph #{graph_id} not found.\")\n\n    return GraphExecutionResult(\n        execution_id=graph_exec_id,\n        status=graph_exec.status.value,\n        nodes=[\n            ExecutionNode(\n                node_id=node_exec.node_id,\n                input=node_exec.input_data.get(\"value\", node_exec.input_data),\n                output={k: v for k, v in node_exec.output_data.items()},\n            )\n            for node_exec in graph_exec.node_executions\n        ],\n        output=(\n            [\n                {name: value}\n                for name, values in graph_exec.outputs.items()\n                for value in values\n            ]","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/external/v1/routes.py#L270-L306","documentation":"HTTP 404 raised by GET /api/v1/graphs/{graph_id}/executions/{graph_exec_id} in the external v1 API. The execution row itself was found, but the graph lookup with the execution's stored graph_id/graph_version under the authenticated user_id returned nothing. This happens when the graph was deleted, its version was removed, or the execution belongs to a different user (the DB query scopes graphs by user_id).","triggerScenarios":"Calling GET /api/v1/graphs/{graph_id}/executions/{graph_exec_id} where (a) the execution exists but the graph was deleted after the run, (b) the graph_version stored on the execution no longer exists (version purged), or (c) the API key's user_id does not own the graph — note the route checks graph_exec.graph_id, not the path graph_id, so a mismatched path id alone does not trigger this.","commonSituations":"Querying execution results for an agent template deleted from the builder; org sharing where one user ran a graph another user owns; multi-version graphs where an old version was cleaned up; copying an execution_id between environments (dev vs prod).","solutions":["Verify the graph still exists and is owned by the same user: call GET /api/v1/graphs and check both graph_id and version.","If the graph was deleted, the execution result is orphaned — re-run the workflow from a current graph version.","Confirm you are querying with the API key of the user who created the graph; executions made from another user's template store that user's graph ownership.","Check the AgentGraph table (Prisma) for the exact (id, version, userId) triple if you have DB access."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await fetch(`/api/v1/graphs/${graphId}/executions/${execId}`, opts);\nif (res.status === 404) {\n  // Distinguish: execution missing vs graph missing via detail text\n  const { detail } = await res.json();\n  if (detail.startsWith('Graph #')) {\n    // execution exists but graph deleted/not owned — result is orphaned\n  }\n}","typeGuard":null,"tryCatchPattern":"try { const r = await api.getExecution(graphId, execId); } catch (e) { if (e.status === 404 && e.detail?.includes('Graph #')) { /* treat as orphaned execution, prompt re-run from live graph */ } else { throw e; } }","preventionTips":["Before querying old executions, confirm the graph (id + version) still exists under the calling user.","Keep executions referenced by their owning graph; archive instead of delete graphs that have execution history.","Never reuse execution ids across environments."],"tags":["http-404","external-api","graph-execution","authorization"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}