Replies: 1 comment 3 replies
-
Hi @Qmodest! I'm Dosu and I’m helping the dify team. Dify intentionally only records aggregate total_tokens for agent (and tool) nodes in workflow execution metadata, not prompt_tokens. This is by design to simplify reporting for complex, multi-step agent executions, where tracking partial stats like prompt_tokens or completion_tokens for each internal LLM call could be confusing or misleading. Only total_tokens, total_price, and currency are included in the metadata for these nodes, even though more detailed token usage is tracked internally for LLM nodes. This approach helps avoid ambiguity in multi-agent scenarios and is not a bug or oversight reference. If you need prompt_tokens for custom analytics, you would need to extend the workflow node execution logic to surface those details. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
table:workflow_node_executions
execution_metadata
.....
......
"metadata": {
"currency": "RMB",
"elapsed_time": 25.737108811736107,
"finished_at": 71617169.64230153,
"started_at": 71617143.90519297,
"total_price": "0",
"total_tokens": 4002
},
"node_id": "1750316128624"
Beta Was this translation helpful? Give feedback.
All reactions