Hey all, this is a very simple workflow:
In the last step ‘Send message’ I am trying to include the number of tokens used by the ‘chat model’ in the ‘AI Agent’ step.
As you can see {tokenUsage.totalTokens} isn’t available as an input:
How can I access the output of the ‘OpenAI Chat Model’?
Thanks,
Hi @aminabudahab
You will need to activate Return Intermediate Steps
in the AI Agent node options
1 Like
Much appreciated, I have enabled the option and I can see the object ‘intermediateSteps’ is added to the ‘AI Agent’ output but it is empty:
What am I missing?
Thanks again
unfortunately, It seems that this feature involves intermediate steps performed by the model, but the main process is currently not possible…
there is another question with same request too here
1 Like
I was having the same issue. There’s a workaround that works pretty well.
Take a look here
How can I get this information? It’s shown in the chat model, but I can’t access this data in my workflow.
[image]
I’ve seen workarounds here in the community, but maybe now there’s an official way?
Information on your n8n setup
n8n version: 1.84.3
Database (default: SQLite): default
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): docker
Operating system: Ubuntu 24.04
EDIT: Solution Found …