Buffer memory problem: input values have 2 keys

Describe the problem/error/question

Hello guys,

I am getting this error:

However, I am pretty sure I have one key, which is the workflow execution id (since this workflow is not connected to a chat node).

I have also tried with random fixed strings, and I get the same issue.

Interestingly, this is the first time I see this error, and it happened after I “rescued” this workflow. That’s a topic for another day, but this workflow was somehow overwritten by another workflow (title and everything). I couldn’t find it in my workflow list but luckily I still had the workflow ID because I was referencing from another workflow. When I visited the URL, I saw that the workflow was another one than the one I expected, but when I checked the version history I found the original workflow before it was overwritten. I though about posting a bug report about it, but since it wasn’t an immediate problem I didn’t. But now that I try to run the workflow I restored, I get that error.

Here is the workflow:

Thank you!

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

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:

This error typically occurs when the input to the OpenAI node doesn’t match the expected format for the memory key.

  1. Before the OpenAI node, add a “Function” node with this code:
return {
  json: {
    input: JSON.stringify($input.item.json),
    keys: Object.keys($input.item.json)
  }
};
  1. Ensure Single Key:
  • The OpenAI node expects a single key for input. If you’re passing multiple, combine them:
const combinedInput = Object.values($input.item.json).join('\n');
return { json: { input: combinedInput } };
3 Likes

Awesome! That worked, thank you so much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.