I am using the Google Gemini Chat Model with the Basic LLM Chain.
In the Gemini node output, I can see the tokenUsage data (prompt, completion, and total tokens). However, in the next node (Set or Code node), this data disappears. Only the text is passed through.
Hi @Kunwei_TAN, welcome!
Currently this is a limitation with the basic LLM Chain node.
There is a possible workaround by using the AI agent node or by retrieving data by the N8N API.
If you want that kind of information directly, consider using the OpenAI node or Gemini node.
If you want to get the usage by the n8n API, here is the workaround: