Problem with AI Agent

Describe the problem/error/question

I tried to process a text with Gemini, and Structured Output Parse, but throws many times.

What is the error message (if any)?

{
  "errorMessage": "Cannot read properties of undefined (reading '0')",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.64.3 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading '0')",
      "    at convertResponseContentToChatGenerationChunk (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\google-genai\\dist\\utils\\common.cjs:224:32)",
      "    at ChatGoogleGenerativeAI._streamResponseChunks (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\google-genai\\dist\\chat_models.cjs:623:87)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at ChatGoogleGenerativeAI._streamIterator (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\language_models\\chat_models.cjs:92:34)",
      "    at ChatGoogleGenerativeAI.transform (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:402:9)",
      "    at RunnableBinding.transform (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:846:9)",
      "    at ToolCallingAgentOutputParser.transform (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:391:26)",
      "    at RunnableSequence._streamIterator (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:1219:30)",
      "    at RunnableSequence.transform (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:402:9)",
      "    at wrapInputForTracing (C:\\Users\\mxate\\AppData\\Roaming\\fnm\\node-versions\\v20.17.0\\installation\\node_modules\\n8n\\node_modules\\@langchain\\core\\dist\\runnables\\base.cjs:275:30)"
    ]
  }
}

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.64.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Dont know
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows.

Hi @Mxater,

Welcome to the community :tada:

Could you share your full workflow, or at least what came before the If node or the chat input of the AI Agent node?