{"record":{"id":"893d3038d5a18b4c","repo":"n8n-io/n8n","slug":"could-not-determine-personal-project-id","errorCode":null,"errorMessage":"Could not determine personal project ID","messagePattern":"Could not determine personal project ID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/clients/n8n-client.ts","lineNumber":833,"sourceCode":"\t): Promise<void> {\n\t\tawait this.fetch('/rest/instance-ai/eval/seed-data-table-rows', {\n\t\t\tmethod: 'POST',\n\t\t\tbody: { threadId, tableId, rows },\n\t\t});\n\t}\n\n\t// -- Data tables ---------------------------------------------------------\n\n\t/**\n\t * Get the personal project ID for the authenticated user.\n\t * GET /rest/projects/personal\n\t */\n\tasync getPersonalProjectId(): Promise<string> {\n\t\tconst result = (await this.fetch('/rest/projects/personal')) as {\n\t\t\tdata: { id: string };\n\t\t};\n\t\tif (!result.data?.id) {\n\t\t\tthrow new Error('Could not determine personal project ID');\n\t\t}\n\t\treturn result.data.id;\n\t}\n\n\t/**\n\t * List data tables in a project.\n\t * GET /rest/projects/:projectId/data-tables\n\t */\n\tasync listDataTables(projectId: string): Promise<Array<{ id: string; name: string }>> {\n\t\t// The list endpoint paginates: `{ data: { count, data: [...] } }`. Reading\n\t\t// `result.data` as the array made this return [] for every project, silently —\n\t\t// it has no error path, so every caller just saw \"no tables\".\n\t\t//\n\t\t// `take` is explicit because the default page is 10, and every caller here\n\t\t// enumerates the WHOLE set (seed eviction, CU cleanup, discovery's pre-existing\n\t\t// set) — a short page silently leaves leftovers behind. 250 is the server's\n\t\t// per-page cap; a case declares at most 20 tables and eviction runs before\n\t\t// every build, so the backlog drains rather than outgrowing one page.","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/clients/n8n-client.ts#L815-L851","documentation":"getPersonalProjectId GETs /rest/projects/personal and expects result.data.id. If the response is missing data.id, the client cannot address project-scoped resources (data tables, etc.). Usually a sign the call was unauthenticated, the user has no personal project, or the response shape changed.","triggerScenarios":"Calling getPersonalProjectId before login(); user provisioning incomplete so no personal project exists; backend version with a different response envelope.","commonSituations":"Forgetting to await login(); freshly invited user whose project wasn't provisioned; proxy returning an error envelope without data.","solutions":["Ensure login() (or acceptInvitation) completed and the cookie is set before calling getPersonalProjectId.","Confirm the user has a personal project (create/finish onboarding if not).","Inspect the raw /rest/projects/personal response to verify the envelope shape."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!client.sessionCookie) throw new Error('not logged in');\nconst r = (await client.fetch('/rest/projects/personal')) as { data?: { id?: string } };\nif (!r.data?.id) throw new Error('no personal project; finish user onboarding');","typeGuard":"const hasPersonalProject = (v: unknown): v is { data: { id: string } } =>\n  typeof v === 'object' && v !== null && typeof (v as any)?.data?.id === 'string';","tryCatchPattern":"try { return await client.getPersonalProjectId(); }\ncatch (e) {\n  if (e instanceof Error && e.message.includes('personal project')) { /* re-login or provision user */ }\n  else throw e;\n}","preventionTips":["Always login before calling project endpoints.","Ensure the user finished onboarding so a personal project exists.","Inspect the raw envelope when integrating with a new backend version."],"tags":["auth","n8n-api","projects"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}