{"record":{"id":"16f77e6bab5ba7bb","repo":"Significant-Gravitas/AutoGPT","slug":"graph-execution-graph-exec-id-not-found-16f77e","errorCode":null,"errorMessage":"Graph execution #{graph_exec_id} not found.","messagePattern":"Graph execution #(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":2196,"sourceCode":"    path=\"/graphs/{graph_id}/executions/{graph_exec_id}\",\n    summary=\"Get execution details\",\n    tags=[\"graphs\"],\n    dependencies=[Security(requires_user)],\n)\nasync def get_graph_execution(\n    graph_id: str,\n    graph_exec_id: str,\n    user_id: Annotated[str, Security(get_user_id)],\n    ctx: Annotated[RequestContext, Security(get_request_context)],\n) -> execution_db.GraphExecution | execution_db.GraphExecutionWithNodes:\n    result = await execution_db.get_graph_execution(\n        user_id=user_id,\n        execution_id=graph_exec_id,\n        include_node_executions=True,\n        organization_id=ctx.org_id,\n    )\n    if not result or result.graph_id != graph_id:\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=result.graph_id,\n        version=result.graph_version,\n        user_id=user_id,\n        organization_id=ctx.org_id,\n    ):\n        raise HTTPException(\n            status_code=HTTP_404_NOT_FOUND, detail=f\"Graph #{graph_id} not found\"\n        )\n\n    # Apply feature flags to filter out disabled features\n    result = await hide_activity_summary_if_disabled(result, user_id)\n    onboarding = await get_user_onboarding(user_id)\n    if (\n        onboarding.onboardingAgentExecutionId == graph_exec_id","sourceCodeStart":2178,"sourceCodeEnd":2214,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L2178-L2214","documentation":"Raised (404) by GET /graphs/{graph_id}/executions/{graph_exec_id} when execution_db.get_graph_execution returns nothing for the (user, execution_id) pair OR the found execution's graph_id differs from the URI graph_id. Both cases are treated as 'not found' to avoid leaking whether someone else's execution ID exists.","triggerScenarios":"Polling an execution that finished and was cleaned up/retention-expired; mistyped or foreign execution ID; polling an execution under the wrong graph_id in the URL (copy-paste mismatch).","commonSituations":"Frontend run-status polls racing with execution retention cleanup; URLs constructed from stale route state after navigating between agents; API scripts reusing recorded execution IDs after a DB reset.","solutions":["Confirm the execution ID comes from the execute response for the same graph and user.","If polling, treat 404 as terminal: stop polling and mark the run as unavailable in the UI.","Check retention settings if executions vanish sooner than expected."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const runs = await api.listExecutions(graphId);\nconst known = new Set(runs.map(r => r.execution_id));\nif (!known.has(graphExecId)) { dropStalePoller(graphExecId); return; }","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.response?.status === 404) { stopPolling(graphExecId); markRunUnavailable(graphExecId); } else throw e; }","preventionTips":["Treat 404 during polling as a terminal state, not a transient error — never retry it.","Always take execution IDs from the execute response for the same graph_id you put in the URL.","Expire pollers after the execution's expected max age so retention cleanup doesn't strand them."],"tags":["api","execution","http-404","not-found","polling"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}