Hi, I am on “poor man’s n8n” (self-hosted private instance) and try to compose approx. 60 agents that collaborate with each other. Since having those many agents in one workflow does not scale, neither as individual nodes, nor as tool nodes, I setup each agent as workflow and have one workflow that coordinates them.
To make configuration of all those 60 sub-workflows more easy I introduced a couple of “variables” via “Edit Fields” node, which are then passed into each sub workflow. Among them is e.g. the model name to use for the AI agent in the sub workflow.
My challenge: approx. 2% of my sub workflow invocations fail with this error message: Cannot read properties of undefined (reading 'map').They always and everytime fail at the model of AI agent, if they fail.
Yet, the “variable” always holds the valid model name (actually, for testing I set it to the same across all sub-workflows). Here is a (simplified) version of one of my sub workflows, but even in this simplified version it fails:
In the model I tried it with {{$('Input').item.json.model}}, {{$('Input').first().json.model}}, and {{$('Input').last().json.model}} but without any effect. In 2% of invocations as sub-workflow this one fails.
I am on n8n v1.114.4 on Docker 28.4.0 on Ubuntu 24.04.2 . The n8n has always sufficient resources, i.e. CPU and Memory nevery exceed 20% of granted resources. –max_old_space_size is set to 16GB .