Capture metrics from workflow running inside a tool #6861
Replies: 5 comments 4 replies
-
|
From my point of view, the missing piece is hierarchical accounting rather than raw metric collection. If a workflow runs inside a tool, AgentOS should either treat it as a child trace of the outer run or offer an explicit rollup API so the parent team run can absorb nested token usage instead of silently underreporting it. Without that, cost data becomes misleading exactly in the workflows where orchestration is most valuable. |
Beta Was this translation helpful? Give feedback.
-
|
This is a missing gap @raphaelrodrigues, thanks for the spot. We're working on how to best enable this. Will keep you posted! |
Beta Was this translation helpful? Give feedback.
-
|
not sure about this one tbh, but it seems like using WorkflowTools might help since they could be more integrated with AgentOS. you might want to check if there's a way to explicitly report the inner workflow's metrics to AgentOS. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @kausmeows , |
Beta Was this translation helpful? Give feedback.
-
|
This is a known gap - nested workflow metrics do not propagate to the parent team run in AgentOS. The issue is that the inner workflow creates its own metric context that is not linked to the outer team's trace. Until the official fix ships, you can work around it by manually aggregating the metrics. After the inner workflow completes, sum up the token counts from its events and attach them to the parent run context using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I’m running into an issue where AgentOS is not capturing the token metrics from a workflow that runs inside a custom tool.
My Setup
I have a Team with a custom async tool that internally runs a Workflow:
The Problem
When I print the metrics from the workflow events, I see the actual token usage:
But in AgentOS, I only see:
AgentOS is only tracking the outer Team’s metrics and completely missing the ~17,500 tokens consumed by the inner workflow agents.
Questions
Is there a way to have nested workflow metrics automatically propagate to AgentOS?
Would using WorkflowTools instead of a custom tool solve this?
Is this a known limitation or am I missing something?
This is important for tracking actual token usage and costs. Any help appreciated!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions