The AI Agent does not work if there is at least 1 tool. Everything works without tools. And it doesn’t matter what kind of tool I connect. Even if it’s a simple calculator. Nothing depends on the text and language of the message.
Error message
The error occurs in the ai agent node. Open router in ‘openai/gpt-4o-mini’ mode.
Error: Provider returned error at Stream.iterator (/usr/local/lib/node_modules/n8n/node_modules/openai/streaming.js:40:35) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ChatOpenAI._streamResponseChunks (/usr/local/lib/node_modules/n8n/node_modules/@langchain/openai/dist/chat_models.cjs:1256:26) at ChatOpenAI._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/language_models/chat_models.cjs:100:34) at ChatOpenAI.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at RunnableBinding.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:883:9) at ToolCallingAgentOutputParser.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:391:26) at RunnableSequence._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:1320:30) at RunnableSequence.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at wrapInputForTracing (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:275:30) at pipeGeneratorWithSetup (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/stream.cjs:271:19) at RunnableLambda._transformStreamWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:296:26) at wrapInputForTracing (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:275:30) at pipeGeneratorWithSetup (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/stream.cjs:271:19) at RunnableLambda._transformStreamWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:296:26) at RunnableSequence._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:1320:30)
Workflow
Information on your n8n setup
- n8n version: 1.86.1
- Database: postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main): not specified in yml file. Is it important?
- Running n8n via: docker compose on vps hosting
- Operating system: Ubutnu 24.04