Code block runs 4 times instead of 3 and 4. run seems to fail

Describe the issue/error/question

My goal is build a update notification workflow.
I get the version from a online json file, compare it to the current version and then notify based on the result. When I run the workflow, I get an error in the “Prepare ha-version.json” file. For some reason I get 4 runs there and the 4. seems to fail.

What is the error message (if any)?

ExpressionError: Invalid code
    at createExpressionError (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:421:20)
    at getPairedItem (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:531:31)
    at Proxy.pairedItemMethod (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:683:40)
    at VM2 Wrapper.apply (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/bridge.js:485:11)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code:1:128
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code:8:2
    at VM2 Wrapper.apply (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/bridge.js:485:11)
    at (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/nodevm.js:426:23)
    at Sandbox.runCodeAllItems (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/Sandbox.js:53:42)
    at Sandbox.runCode (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/Sandbox.js:30:62)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/Code.node.js:75:39)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:659:51)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:585:68
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Please share the workflow

Information on your n8n setup

  • n8n version: 0.211.2
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: ?
  • Running n8n via [Docker, npm,, desktop app]: Docker

Hey @Zoker,

I am not sure why that is running 4 times, Do you have a screenshot of the flow itself showing the data items going into the node?

The only thing I can think of is that for some reason one of the nodes before it is executing twice.

Do you mean something like this?

Or what data do you want to see?

Thanks for the quick reply :slight_smile:

Hey @Zoker,

More the workflow itself, I know you pasted it but a screenshot of the workflow with all the counts on it could be useful.

Ah sure, here you go:

Well all of that looks fine to me, I am not sure what is going on there. I will have a play in the morning and see if I can find anything.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.