Hey everyone,
I’m having an issue with my n8n workflow and wanted to double-check if I’m missing something obvious.
The setup is simple: I have an AI Agent that loops through around 50 clients. Each client produces its own JSON output. After that, I use a Merge node set to append to combine them, then a Code node that combines everything into one long text, then an AI Agent that summarizes the results, and finally a Slack message to post the summary.
The goal is to get one single message that includes all 50 clients’ data combined together.
Here’s the strange part — when I run the full workflow, the final AI Agent and Slack nodes execute 50 times, sending 50 separate messages. But when I test the Code node by itself, it works perfectly and produces only one combined output, exactly as intended.
After digging into it, I realized what was happening: even though my Code node visually looked correct, n8n was still treating the input as multiple items (one per client). That meant every downstream node thought it needed to run for each item, instead of just once.
The fix was to make sure the Code node actually outputs a single item. In other words, instead of passing through multiple individual items from the loop, it should only return one combined object containing everything. Once I made that change, the workflow stopped running 50 times and started sending just one clean message to Slack.
So if anyone else runs into this, the key thing to remember is that n8n executes one run per item. Even if you think you’ve merged everything, you need to make sure the output really is one item — otherwise every connected node will run multiple times.
Now the workflow behaves perfectly: when I test it, it produces one unified output and one Slack message, just as intended.
Describe the problem/error/question
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: