I am creating my first workflow. But getting errors "cannot read properties of null (reading ‘length’).. Seems the OpenAI chat model is providing the output, but the AI agent is seeing some errors. Not able to debug.. Tried various things such as different API keys.. but nothing seems to work.
Its difficult to tell from your images. Copy this template from here into your n8n instance. Its set up be your first AI Agent. All workflows can be copied and pasted between instances.
Hope this helps!
If this response helped you, please click the heart to show that it is useful If this response solved your issue, mark it as the solution to help the community
Thanks for the response @rbreen. I took the exact json file you provided, but still the same error. I am thinking something wrong with the environment or I am missing something. Here is the workflow I have.. Nothing fancy, just the basics. This is my first workflow and unfortunately I am stuck.
Which credits? I am using the community edition (self hosted) of N8N. And I am getting responses from the gpt model. Do I need any other credits? I am new to N8N, so not sure.. I was told that we could use community edition for free? I am just starting to figure out. Thanks @moosa
@moosa I think we are close.. what I found out was I have the latest N8N (1.105.2) and it’s creating the agent of typeVersion 2.2.. somehow this agent didnt work. My friend gave me typeVersion 1.8 (exact same code) and it worked. So not sure how I can change the agent version from N8N. Any solution for this? Or should I go back a version in N8N?
Please suggest what version I should deploy, so that I wont step on any version related issues? Because I am starting to learn, would like to play with stable stuff. Thanks
@Ranjitha I have been experiencing the same issue and just figured out a work around based on this chat.
I am running n8n v 1.105.3 but this issue has been happening with any n8n version after 1.102.4. I believe it is linked to the langchain version update.
simple flow but it results in the error “Cannot read properties of null (reading ‘length’)” from the agent.
However if I copy the flow, paste it in vscode and override the version of the agent node from 2.1 to 1.8 and paste it back into the n8n canvas, it works just fine.