n8n-io/n8n · error · Error
Trace project "${projectName}" not found in the eval workspa
Error message
Trace project "${projectName}" not found in the eval workspace — is this the right tenant/workspace? What it means
Thrown by resolveTraceProjectId() (build-cost-report.ts:134) when the sessions lookup succeeds (HTTP OK) but no project in the returned list matches the requested projectName exactly. This means the trace project does not exist in the resolved eval workspace/tenant. The message hints at a wrong tenant or workspace, since the project name is fixed per run and the workspace is resolved separately.
Source
Thrown at packages/@n8n/instance-ai/evaluations/cli/build-cost-report.ts:134
...(workspaceId ? { 'X-Tenant-Id': workspaceId } : {}),
},
};
}
async function resolveTraceProjectId(ls: LangSmithConfig, projectName: string): Promise<string> {
const res = await lsFetch(
`${ls.apiUrl}/api/v1/sessions?name=${encodeURIComponent(projectName)}`,
{
headers: ls.headers,
},
);
if (!res.ok) {
throw new Error(`LangSmith sessions lookup failed: ${res.status} ${await res.text()}`);
}
const projects = z.array(lsProjectSchema).parse(await res.json());
const match = projects.find((p) => p.name === projectName);
if (!match) {
throw new Error(
`Trace project "${projectName}" not found in the eval workspace — is this the right tenant/workspace?`,
);
}
return match.id;
}
interface ThreadCost {
costUsd: number;
tokens: number;
/** Root runs in the thread — one per build turn. */
turns: number;
}
const RUNS_QUERY_LIMIT = 100;
/** Sum a thread's root runs (one per turn); roots aggregate their children,
* so this is the thread's whole backend LLM spend. Null when the thread has
* no runs in the project — an unknown cost, not a $0 build (wrongView on GitHub (pinned to 5ac6606e81)
Solutions
- Pass the correct project name via --trace-project <name> matching what the eval harness used.
- Verify the eval workspace is correct — check the workspace ID resolution (resolveEvalWorkspaceId) and the LANGSMITH_* env vars.
- Confirm traces have landed: query the LangSmith UI for the expected project name in the right tenant.
- If running a custom cohort, ensure the eval run and the cost report agree on the project name.
Example fix
// before pnpm tsx evaluations/cli/build-cost-report.ts --results aia-run/eval-results.json // after (traces landed under a different project name) pnpm tsx evaluations/cli/build-cost-report.ts --results aia-run/eval-results.json --trace-project instance-ai-evals-staging
Defensive patterns
Strategy: validation
Validate before calling
// Before resolving, confirm the project exists in the workspace:
async function projectExists(ls: LangSmithConfig, name: string): Promise<boolean> {
const res = await fetch(`${ls.apiUrl}/api/v1/sessions?name=${encodeURIComponent(name)}`, { headers: ls.headers });
const projects = await res.json();
return Array.isArray(projects) && projects.some((p: { name: string }) => p.name === name);
} Try / catch
try {
const id = await resolveTraceProjectId(ls, traceProject);
} catch (error) {
const msg = error instanceof Error ? error.message : String(error);
if (msg.includes('not found in the eval workspace')) {
console.error(`Trace project "${traceProject}" missing — pass --trace-project <name> matching the eval run.`);
process.exit(2);
}
throw error;
} Prevention
- Pin --trace-project to the exact name the eval harness used.
- Verify the resolved eval workspace (tenant) matches where traces landed.
- Check the LangSmith UI for the project before running the report.
When it happens
Trigger: The trace project name (default 'instance-ai-evals', overridable via --trace-project) does not exist in the eval workspace that resolveEvalWorkspaceId() resolved. This happens when evals ran under a different project name, or the X-Tenant-Id header resolved to a workspace that does not contain that project.
Common situations: The eval harness wrote traces to a project named differently from the default (e.g. a custom --trace-project was used during the eval but not the report), the eval workspace ID resolved wrong (env misconfiguration), or the evals simply have not produced traces in that project yet.
Related errors
- LANGSMITH_API_KEY is not set — the AIA arm needs LangSmith a
- LangSmith sessions lookup failed: ${res.status} ${await res.
- LangSmith runs/query failed: ${res.status} ${await res.text(
- LangSmith mode requires `--dataset` and does not support `--
- LangSmith client not initialized - check LANGSMITH_API_KEY
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/8fb2c58354cd3e44.
Report an issue: GitHub.