I’m getting this problem too. Updated to the latest version, recreated the entire workflow from scratch. I’m far from an expert with any of this, I really truly do not know whether I’ve screwed something up somewhere along the line, whether there’s an error/bug that’s just not possible to get around currently, or whether or not there’s something missing entirely from the workflow.
Check you have a primary field specified with [[ ]] rather than {{ }}. The other thing I had going was the Parent agent sending null and empty data. Corrected that with the images attached. But the actual input error was just specifying the primary key with [[ ]].
OK so I looked at it with a group of people in a support call yesterday and couldn’t find anything wrong with the flow in my case. I swapped around memory also without any succes. It looks like a bug in the Tools Agent. I was able to work around it by calling a part of my code in a separate flow.
I installed my n8n server yesterday and I have the same problem when I use an AI Agent (tools agent) Node with telegram trigger. When I use a chatbot trigger no problem.
I try to connect Xata, PostgresSql in local, Redis and always the same problem.
I see that the memory is called 2 times before and after model call. And It fail at the second time.
First call Input (tool agent)
[
{
"action":
"loadMemoryVariables",
"values":
{
"input":
"",
"system_message":
"You are an intelligent assistant.\nFor any requests related to emails, use the 'mail agent'.\nFor retrieving contact information or details about any contact, use the 'contact agent'.\nEnsure you select the appropriate tool based on the nature of the request.",
"formatting_instructions":
"IMPORTANT: Always call `format_final_response` to format your final response!"
}
}
]
Seconde call input (Tool Agent)
[
{
"action":
"saveContext",
"input":
{
"input":
"",
"system_message":
"You are an intelligent assistant.\nFor any requests related to emails, use the 'mail agent'.\nFor retrieving contact information or details about any contact, use the 'contact agent'.\nEnsure you select the appropriate tool based on the nature of the request.",
"formatting_instructions":
"IMPORTANT: Always call `format_final_response` to format your final response!"
},
"output":
{
"input":
"",
"system_message":
"You are an intelligent assistant.\nFor any requests related to emails, use the 'mail agent'.\nFor retrieving contact information or details about any contact, use the 'contact agent'.\nEnsure you select the appropriate tool based on the nature of the request.",
"formatting_instructions":
"IMPORTANT: Always call `format_final_response` to format your final response!",
"chat_history":
[
],
"output":
"Hello there! How can I assist you today?"
}
}
]
@raggyp I was experiencing the same error. I noticed that I was sending an empty string in the “User Message” field. After I changed it to access the correct attribute and send the correct string, it worked again.
I seem to have fixed this issue…with help of chat GPT…by changing the Postgres node session ID to ‘define below’. Then for my workflow I enetred ‘{{$json[“session_id”] || $json[“chat_id”] || “default-session”}}’. and that seemed to have fixed it!
I also have the same Issue, but in my case, Im doing a Whatsapp bot, the first iteration its good and the bot replies correctly, but for some reason, after that good iteration, the workflow inmediately run itself again and that error appears.