{"record":{"id":"c852052cd1ee5775","repo":"Significant-Gravitas/AutoGPT","slug":"graph-graph-id-v-schedule-params-graph-version","errorCode":null,"errorMessage":"Graph #{graph_id} v{schedule_params.graph_version} not found.","messagePattern":"Graph #(.+?) v(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":2435,"sourceCode":"@v1_router.post(\n    path=\"/graphs/{graph_id}/schedules\",\n    summary=\"Create execution schedule\",\n    tags=[\"schedules\"],\n    dependencies=[Security(requires_user)],\n)\nasync def create_graph_execution_schedule(\n    user_id: Annotated[str, Security(get_user_id)],\n    ctx: Annotated[RequestContext, Security(get_request_context)],\n    graph_id: str = Path(..., description=\"ID of the graph to schedule\"),\n    schedule_params: ScheduleCreationRequest = Body(),\n) -> scheduler.GraphExecutionJobInfo:\n    graph = await graph_db.get_graph(\n        graph_id=graph_id,\n        version=schedule_params.graph_version,\n        user_id=user_id,\n    )\n    if not graph:\n        raise HTTPException(\n            status_code=404,\n            detail=f\"Graph #{graph_id} v{schedule_params.graph_version} not found.\",\n        )\n\n    # Use timezone from request if provided, otherwise fetch from user profile\n    if schedule_params.timezone:\n        user_timezone = schedule_params.timezone\n    else:\n        user = await get_user_by_id(user_id)\n        user_timezone = get_user_timezone_or_utc(user.timezone if user else None)\n\n    # Expert attribution: explicit expert_id must be an active expert owned\n    # by the caller; when omitted, a unique (user, graph) → expert match\n    # keeps attribution for schedules created through the generic UI.\n    expert_id = schedule_params.expert_id\n    if expert_id is not None:\n        expert = await experts_db.get_expert(\n            user_id, expert_id, include_workflows=False","sourceCodeStart":2417,"sourceCodeEnd":2453,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L2417-L2453","documentation":"Schedule-creation endpoint raises 404 when `graph_db.get_graph(graph_id, version=schedule_params.graph_version, user_id=user_id)` returns None. The graph lookup is user-scoped and version-aware: graph_version defaults to None in ScheduleCreationRequest, and a None version resolves to the latest version — so the 404 means either the graph ID doesn't exist for this user, or the explicitly requested version number doesn't.","triggerScenarios":"POST /v1/schedules (create_graph_execution_schedule) with a graph_id never created by this user, a graph_id copied from another user/template, or graph_version set to a version that was never published (e.g. version 3 when only v1–v2 exist).","commonSituations":"Scheduling right after deleting a graph or a graph version; using template/marketplace graph IDs that were never forked into the user's workspace; sending graph_version as a string or off-by-one from the UI's version selector.","solutions":["List the user's graphs (GET /graphs) and confirm graph_id belongs to the authenticated user.","If passing graph_version, verify that exact version exists (GET /graphs/{graph_id}); omit it to target the latest version.","For template graphs, fork/publish them into the user's workspace before scheduling.","Check for whitespace or URL-encoding issues in graph_id."],"exampleFix":"// before — hardcoding a version that may not exist\nawait api.createSchedule({graphId, graphVersion: 3, name, cron, inputs});\n// after — resolve latest version first\nconst graph = await api.getGraph(graphId);\nawait api.createSchedule({graphId, graphVersion: graph.version, name, cron, inputs});","handlingStrategy":"validation","validationCode":"const graph = await api.getGraph(graphId);\nif (!graph) throw new Error('Graph not found for this user');\nconst versions = graph.versions.map(v => v.version);\nif (params.graphVersion != null && !versions.includes(params.graphVersion)) {\n  params.graphVersion = graph.version; // fall back to latest\n}","typeGuard":"function hasVersion(graph: GraphDTO, v: number | null | undefined): boolean {\n  return v == null || graph.versions.some(ver => ver.version === v);\n}","tryCatchPattern":"try {\n  return await api.createSchedule({graphId, graphVersion, ...});\n} catch (e) {\n  if (e.status === 404) throw new Error(`Graph ${graphId} or version ${graphVersion} unavailable`);\n  throw e;\n}","preventionTips":["Resolve the graph (and its versions) immediately before scheduling instead of trusting cached IDs/versions.","Omit graph_version to schedule the latest published version.","Fork template/marketplace graphs into the user's workspace before scheduling them."],"tags":["http-404","schedules","graph-versioning","ownership"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}