{"record":{"id":"8fe4a3e7cea27ef8","repo":"Significant-Gravitas/AutoGPT","slug":"graph-execution-graph-exec-id-not-found","errorCode":null,"errorMessage":"Graph execution #{graph_exec_id} not found.","messagePattern":"Graph execution #(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/external/v1/routes.py","lineNumber":279,"sourceCode":"\n@v1_router.get(\n    path=\"/graphs/{graph_id}/executions/{graph_exec_id}/results\",\n    tags=[\"graphs\"],\n)\nasync def get_graph_execution_results(\n    graph_id: str,\n    graph_exec_id: str,\n    auth: APIAuthorizationInfo = Security(\n        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()},","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/external/v1/routes.py#L261-L297","documentation":"Raised (HTTP 404) by the external get-graph-execution endpoint when `execution_db.get_graph_execution(user_id, execution_id, include_node_executions=True)` returns nothing — no execution with that id is visible to the API key's user. Ownership is enforced inside the DB query, so other users' executions look identical to nonexistent ones. (A second 404, `Graph #{graph_id} not found.`, fires when the execution exists but the caller-supplied graph_id doesn't match it.)","triggerScenarios":"GET `/api/external-api/v1/graphs/{graph_id}/executions/{graph_exec_id}` with a typo'd/deleted execution id, an execution owned by another user, or a graph_id that doesn't match the execution's actual graph/version.","commonSituations":"Polling an execution id after it was pruned/retention-expired; mixing ids between environments (staging vs prod); passing the graph id where the execution id belongs or vice versa; version skew after re-uploading a graph (old executions reference old versions invisible to the current graph lookup).","solutions":["Use the execution id returned by the execute endpoint (`{\"id\": ...}`) exactly, and the graph id that created it.","List executions for the graph to discover valid, retained execution ids.","Confirm the API key belongs to the user who started the execution.","If executions were pruned by retention, restart the graph run to produce a fresh execution."],"exampleFix":"# before: swapped ids\nGET /graphs/{execution_id}/executions/{graph_id}  # 404\n\n# after\nrun = POST /graphs/{graph_id}/executions\nGET /graphs/{graph_id}/executions/{run.id}","handlingStrategy":"validation","validationCode":"run = client.post(f\"/graphs/{graph_id}/executions\", json=payload).json()\nexec_id = run[\"id\"]  # always use the id returned by the execute endpoint\n# poll only this id, and keep graph_id from the same call\nclient.get(f\"/graphs/{graph_id}/executions/{exec_id}\")","typeGuard":null,"tryCatchPattern":"try:\n    client.get(f\"/graphs/{graph_id}/executions/{exec_id}\")\nexcept HTTPError as e:\n    if e.response.status_code == 404:\n        execs = client.get(f\"/graphs/{graph_id}/executions\").json()  # re-discover valid ids\n        if exec_id not in {x[\"id\"] for x in execs}:\n            log(\"execution pruned or owned by another user\")\n    raise","preventionTips":["Persist the execution id returned by the execute endpoint; never derive ids by hand.","Keep (graph_id, execution_id) pairs together — the GET checks both match.","Use the same API key (same user) that started the execution when polling."],"tags":["graph-execution","not-found","external-api","ownership"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}