Describe the problem/error/question
I am getting the error irrespective of whether I use memory node or not
What is the error message (if any)?
Problem in node ‘Drata Monitoring Test Tool‘
Cannot read properties of undefined (reading ‘map’)
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: Version 2.3.4
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): AWS EKS
- Operating system: Linux
- Qdrant Version: 1.9.5
Hey! I’ve seen this error before with custom AI Agent tools.
The “Cannot read properties of undefined (reading ‘map’)” usually happens when your custom tool isn’t returning data in the format the AI Agent expects.
Here’s what’s likely happening:
Your “Drata Monitoring Test Tool” needs to return an array (or data that can be mapped over). If it’s returning undefined, null, or a single object instead of an array, the AI Agent tries to call .map() on it and fails.
Quick fix:
- Open your “Drata Monitoring Test Tool” node
- Make sure the output is structured properly - it should return data in this format:
return [{ json: { your_data_here } }];
// or if you have multiple items:
return [
{ json: { item1 } },
{ json: { item2 } }
];
- If you’re using a Code node as your tool, wrap your output in an array even if it’s a single result
Another common cause:
The tool might be failing to execute (maybe an API call error?) and returning nothing. Check the tool’s execution output before the AI Agent runs.
Try testing just the tool node alone first to see what it outputs. If you share the code or configuration of your Drata tool, I can give you the exact fix.
I deal with AI agents and custom tools regularly for my automation projects, so happy to help debug further if needed!
@hoiyothaheem
Thank you for looking into the question.
Drata Monitoring Test Tool is a Qdrant Vector Store node which looks like:
This is how the data looks in Qdrant:
I am not using any custom node or custom code in the workflow.
I tried to simplify the workflow removing all other node and still the same issue
Ah got it, sorry for the confusion! I see your original workflow has the AI Agent properly set up.
Since the error happens even with the full AI Agent → Qdrant Vector Store setup, this looks like it could be a compatibility issue with how the Qdrant node handles data when called as a tool.
A few things to check:
-
Qdrant Vector Store mode - In your Qdrant node settings, make sure you’re using it in “Get Many” or “Retrieve Documents” mode (not “Insert” mode) when it’s connected as a tool to the AI Agent.
-
Check if Qdrant has data - The error could happen if the vector store is empty or returns no results. Can you verify your Qdrant collection has documents?
-
Embeddings model match - The embeddings model you’re using to query (OpenAI Embeddings) should be the same one you used when inserting data into Qdrant.
-
Try without Memory first - Remove the Simple Memory node temporarily and test. Sometimes memory nodes can cause unexpected data structure issues.
-
Check n8n version - This specific error with .map() on Qdrant tools might be a known bug. What version are you running? If it’s older than 2.3.x, try updating.
Can you share what mode/operation your Qdrant Vector Store node is set to? That’ll help narrow down the issue.
Hi @hoiyothaheem
Thank you for trying to debug the flow.
I have checked all the items that you mentioned in your response.
Qdrant Vector Store mode

Check if Qdrant has data

Embeddings model match

Try without Memory first

Check n8n version
- n8n version: Version 2.3.4
- Qdrant Version: 1.9.5
Retrieve Documents (As Tool for AI Agent)