AI Agent - chat history error on using sessionId from previous node

Hi @ypyly

I was able to replicate the error and found that you’re using an old legacy expression syntax: $node["Node Name"]

Please switch to the current standard syntax $("<node-name>").item which is working as expected:

So in your case, for the Postgres Chat Memory key, try updating your syntax to:

{{ $('set_params').item.json.sessionId }}

Also, since other nodes in your workflow are still using the legacy syntax, I recommend updating those as well to avoid similar errors in the future.



⚡

If you find this helpful, kindly mark the reply as the solution :white_check_mark::pray:t2: