mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-18 14:56:50 +02:00
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> |
||
|---|---|---|
| .. | ||
| postgres-schema | ||
| sqlite-schema | ||