n8n/packages/@n8n/db
Jaakko Husso ab3048f48d
feat(core): Link delegated Agents executions and store cache tokens in columns (no-changelog)
Replace the `usageDetails` JSON column with top-level columns on
`agent_execution`:

- `cacheReadTokens` and `cacheWriteTokens` store the prompt-cache tokens
  of the `finish` usage. Both are subsets of `promptTokens`.
- `parentExecutionId` and `rootExecutionId` link a delegated run to the
  execution that delegated it and to the top of its tree. Both reference
  `agent_execution.id` with ON DELETE SET NULL and have an index.

The sub-agent runner sets the links from the parent execution id in the
parent persistence metadata. Background jobs pass it on dispatch. A
resumed child keeps the links of its first execution.

Remove the sub-agent usage roll-up. Each delegated run already records
its own execution, so the system usage route now returns each turn with
its descendants (found through `rootExecutionId`) and their sum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 02:48:36 +03:00
..
scripts refactor: Group quality engineering workspaces by capability (#40007) 2026-10-01 11:20:00 +00:00
src feat(core): Link delegated Agents executions and store cache tokens in columns (no-changelog) 2026-10-09 02:48:36 +03:00
AGENTS.md chore(core): Lock the @n8n/typeorm import ratchet and document the boundary (no-changelog) (#34370) 2026-07-21 08:26:21 +00:00
eslint.config.mjs chore: Migrate database and engine lint to Oxlint (no-changelog) (#39841) 2026-09-29 12:24:22 +00:00
oxlint.config.mts chore: Add typescript/no-deprecated and establish a baseline (#40168) 2026-10-02 12:54:37 +00:00
package.json 🚀 Release 2.43.0 (#40376) 2026-10-06 07:10:16 +00:00
tsconfig.build.json chore: Migrate the rest of packages/@n8n to typescript 7 (#34332) 2026-07-17 10:45:58 +03:00
tsconfig.json chore: Migrate the rest of packages/@n8n to typescript 7 (#34332) 2026-07-17 10:45:58 +03:00
vite.config.ts refactor(core): Share decorator transform through Vitest config (#40213) 2026-10-05 06:24:53 +00:00