This is my workflow.
Whenever there’s a new session, it works fine.
But when there’s old session, i.e. the chat from memory is retrieved, the AI Agent gives error
”Cannot read properties of undefined (reading ‘map’) ”
I have tried everything but didn’t find the solution.
The problem seems here
The Human message shows undefined. Don’t know why?
Everything was working fine till 2-3 days ago.
I tried recreating a simple workflow again. But the issue persists.
Got to troubleshoot 1 more thing
The Simple Memory call to save the chat data passes below JSON
{
“action”: “saveContext”,
“chatHistory”: [
{
“lc”: 1,
“type”: “constructor”,
“id”: [
“langchain_core”,
“messages”,
“HumanMessage”
],
“kwargs”: {
“from”: “917713501011”,
“message”: “Hello”,
“additional_kwargs”: {},
“response_metadata”: {}
}
},
{
“lc”: 1,
“type”: “constructor”,
“id”: [
“langchain_core”,
“messages”,
“AIMessage”
],
“kwargs”: {
“content”: “Sure, I’d be happy to add you to our system. May I have your full name, please?”,
“tool_calls”: ,
“invalid_tool_calls”: ,
“additional_kwargs”: {},
“response_metadata”: {}
}
}
]
}
In the first object of above JSON array, the kwargs contains “message” key but not “content” key.
In other, it contained “content” key.
This seems to have a bug
system
Closed
January 20, 2026, 3:01pm
3
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.