Remove formatting_instructions from AI Agent

Hi,
In AI Agent, I connected a workflow that returns a certain result. However, this result is reprocessed by the AI Agent with the addition of this line in the JSON: "formatting_instructions": "IMPORTANT: Always call format_final_response to format your final response!".
How can I intervene and remove or modify the value of formatting_instructions?

n8n version: 1.61.0
Running n8n via Render.com
Operating system: win 10 pro

3 Likes

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @masai2k,

Welcome to the community :tada:

I am not sure if there is a way to change it but it should be helping to correctly format the data into something we would expect. Is it causing any issues in your workflow?

Hi Jon, the text that returns from my workflow is perfectly formatted, with emojis and other stuff. So it is perfect for the final user. The format changes when AI Agent processes it, and all the emojis disappear.

I agree, I would also like to remove this code: JSON: "formatting_instructions": "IMPORTANT: Always call format_final_response to format your final response!" .

The issue encounter is the formatted answer is not as detailed as the response created by the chat model. I would prefer the originial answer prior to formatting that I can see in the Logs.

  • n8n version:. The latest version.
  • Database (default: SQLite): Using Supabase
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Running in Docker
  • Operating system: mac 15.2
    Thank you for your help.

Regards,
J

issue swept under the rug and ignored by team. :+1:t2:

1 Like

Have you found a solution for this problem?

1 Like

solution? it’s not a bug. its a feature.

1 Like

Having a similar issue. format_final_response messages are adding undefined history context to my database. When trying to recall chat in later iterations you get a “Cannot read properties of undefined (reading ‘map’)”

“formatting_instructions”: “IMPORTANT: Always call format_final_response to format your final response!”,
“chat_history”: [
{
“lc”: 1,
“type”: “constructor”,
“id”: [
“langchain_core”,
“messages”,
“HumanMessage”
],
“kwargs”: {
“content”: “oo7-3658”,
“additional_kwargs”: {},
“response_metadata”: {}
}
},
{
“lc”: 1,
“type”: “constructor”,
“id”: [
“langchain_core”,
“messages”,
“AIMessage”
],

the issue still exists. formatting_instructions on Simple Memory. - local horror )))
i started using 2 days great n8n, but the inability to edit spoils the mood a little )))
is this closed source or open? if i go in and fix it? ok, i need to look at Git hub

This is a manual inconvenient hack:
The problem in the previous version was hidden in the ToolsAgent code, which manages Simple Memory and other nodes via Windows files %USERNAME%\AppData\Local\npm-cache_npx\x8с7eocxxxxxxxxx\node_modules@n8n\n8n-nodes-langchain\dist\nodes\agents\Agent\agents\ToolsAgent execute.js lines 170, 185, 188, 255 and execute.js.map

delete the phrase “IMPORTANT: and so on…”. leave the quotes " "

In the current version 1.94.1, look at the files common.js, common.js.map and in the V1 and V2 subdirectories - the files execute.js and execute.js.map

After editing - save the files - restart n8n
New discoveries await us in the new version. Good luck.