n8n/docs
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
..
adr docs: Add a README for the ADR directories (no-changelog) (#39006) 2026-10-08 14:28:52 +00:00
generated feat(core): Link delegated Agents executions and store cache tokens in columns (no-changelog) 2026-10-09 02:48:36 +03:00
ADR_TEMPLATE.md ci: Add ADR template (#39358) 2026-09-23 08:30:55 +00:00
db.md feat(core): Add auto-generated database schema documentation (no-changelog) (#32069) 2026-06-12 07:44:01 +00:00