Error in function Node when retrieving from a in-memory vector store

Describe the problem/error/question

I get an error in my function node when I try to use a in-memory vector store using

const vectorStore = await this.getInputConnectionData('ai_vectorStore', 0);

What is the error message (if any)?

Error message in the node

NodeOperationError: Error in sub-node In-Memory Vector Store3 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1850:19 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at Proxy.getInputConnectionData (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1857:19) at Proxy.getInputConnectionData (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2296:24)

Error in the in-memory vector store

context.getWorkflow is not a function
Error details
 Other info
    Item Index 0
    n8n version 1.62.4 (Self Hosted)
    Time 12/10/2024, 16:56:08
    Error cause {}

Please share your workflow

Looks like the error message “context.getWorkflow is not a function” refers to the fact that the in-memory vector store didn’t received the context data.

Information on your n8n setup

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

https://github.com/n8n-io/n8n/issues/11256

Hey @marceltoma,

Do you have a full example workflow and data we can use to test this? I suspect it is likely something missing in the node but having an example we can just run to test will be very helpful.

Here is an example