[Bug] MYSQL tool executes only the first query Tools AI Agent has generated

Hi
I have AI Tools Agent and MYSQL Execution tool node connected with it.
The AI tools agent generates and executes MYSQL query using the tool.
If the Agent calls MYSQL tools to execute more than once,the MYSQL tool executes the first query everytime. In the Logs section,i can the second query as the input parameter but on execution it executes first query which is still persisting somehow in backend data and taking it as input.
Edit : Screenshots attached of Run1 and Run2.
As in SS,on run1 the query on input left side and output sql right side both are same.
While in run2, the query on input left side and output sql right side both are different.
MYSQL tool is configured to get input query as {{ $fromAI(‘query’) }} the Query field

Information on your n8n setup

  • n8n version:: 1.68.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu


Hey @AasimK , it is expected as sub-nodes only work on the first item. See the note for the standard tools in our docs.

Hi @ihortom Thank you for the reply!!
The AI Agent is not sending two items at once to the tool.
What i mean is when it calls the tool second time or more with new query, the tool somehow executes the first query. The Logs are also wrong in that case.

For now i have created a separate workflow to execute MYSQL query and connected the trigger as a tool, this works without any problem.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.