Describe the problem/error/question
Hi everyone, this might be a very noobie situation, but I hope I can get some help.
In simple terms, my workflow expects emails, triggered by an outlook trigger node, and then an AI Agent node generates and answer email. When dealing with single emails, everything works as expected. However, after doing some active workflow testing, I have found out that multiple emails might enter the workflow at the same time (of course it is good since you can avoid workflow executions). I initially expected everything to work correctly, but I had first() used multiple times in different nodes, meaning that the workflow would break whenever multiple emails entered it at the same time. I fixed most of this by using .item and referencing variables from other nodes but, for my postgress tool used as the memory for the agent, although I reference a set node containing multiple IDs (I use this as the DB id to match email conversations) for every AI agent execution, it only uses a single ID, kind of the same behavior as if you were to use first(). This causes a mix of information from multiple emails to a single one only.
From the image above, you can see that my set node contains two IDs, one for email 1 and another one for email 2.
When referencing the same set node, using .item, it is only using the ID from item 0 in both iterations from the AI Agent (One for each email) rather than each corresponding id for each iteration. Am I doing a stupid mistake? Is this a bug? Am I not understanding properly how items and variables are matched in n8n? I can’t seem to figure out the cause of this issue.
Information on your n8n setup
- **n8n version:1.98.1
- Database PostGres
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via ( n8n cloud):
- Operating system: Windows 10