Significant-Gravitas/AutoGPT · warning · HTTPException

Graph execution #{graph_exec_id} not found.

Error message

Graph execution #{graph_exec_id} not found.

What it means

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.

Source

Thrown at autogpt_platform/backend/backend/api/features/v1.py:2196

    path="/graphs/{graph_id}/executions/{graph_exec_id}",
    summary="Get execution details",
    tags=["graphs"],
    dependencies=[Security(requires_user)],
)
async def get_graph_execution(
    graph_id: str,
    graph_exec_id: str,
    user_id: Annotated[str, Security(get_user_id)],
    ctx: Annotated[RequestContext, Security(get_request_context)],
) -> execution_db.GraphExecution | execution_db.GraphExecutionWithNodes:
    result = await execution_db.get_graph_execution(
        user_id=user_id,
        execution_id=graph_exec_id,
        include_node_executions=True,
        organization_id=ctx.org_id,
    )
    if not result or result.graph_id != graph_id:
        raise HTTPException(
            status_code=404, detail=f"Graph execution #{graph_exec_id} not found."
        )

    if not await graph_db.get_graph(
        graph_id=result.graph_id,
        version=result.graph_version,
        user_id=user_id,
        organization_id=ctx.org_id,
    ):
        raise HTTPException(
            status_code=HTTP_404_NOT_FOUND, detail=f"Graph #{graph_id} not found"
        )

    # Apply feature flags to filter out disabled features
    result = await hide_activity_summary_if_disabled(result, user_id)
    onboarding = await get_user_onboarding(user_id)
    if (
        onboarding.onboardingAgentExecutionId == graph_exec_id

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Confirm the execution ID comes from the execute response for the same graph and user.
  2. If polling, treat 404 as terminal: stop polling and mark the run as unavailable in the UI.
  3. Check retention settings if executions vanish sooner than expected.
Defensive patterns

Strategy: try-catch

Validate before calling

const runs = await api.listExecutions(graphId);
const known = new Set(runs.map(r => r.execution_id));
if (!known.has(graphExecId)) { dropStalePoller(graphExecId); return; }

Try / catch

catch (e) { if (e.response?.status === 404) { stopPolling(graphExecId); markRunUnavailable(graphExecId); } else throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/16f77e6bab5ba7bb. Report an issue: GitHub.