Works in Editor fails in Execution

Describe the problem/error/question

I am using a switch to detect if a variable exists if not, go back and start the flow over again.

When I run this in the editor it works.

When I run it live, it always fails with “Cannot read properties of undefined (reading ‘split’)”

I have tried adding a SET as well before the step and it also works in the editor but fails in execution.


Information on your n8n setup

  • n8n version: 1.57.0
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Self Hosted Render
  • Operating system: Mac

Hey @Stephen_Ai,

Welcome to the community :raised_hands:

Can you share the data you are sending so we can try and reproduce it?

Thanks Jon, are you not able to use the data from the notes I copied above?

I am basically asking Ai to read the contents of an image, a percentage of the time Ai fails to do it.

So I wanted to route that fail to start over.

Since it “can” do it. Sometimes the Ai just seems to fail. But a second attempt works.

Each time I try this in the editor it works flawlessly.

If an image fails it goes back to the beginning.

But as a live execution I get the error: Cannot read properties of undefined (reading ‘split’)

Hmm the Editor job is now failing with the same error. So my previous assumption that it was working in the editor was incorrect.

Why would “run” 2 be different than the first run.

Is it attempting to feed in input values from the switch?

I got it working by adding the set field.

1 Like

Hey @Stephen_Ai,

So while you posted the nodes it doesn’t include the actual data you send to the webhook which is handy for testing.

With the looping the way it will work with what you have is it will run all incoming items and pass it to the next node, then run all items and so on when it comes back to the start it won’t be using the Webhook node output but the output from the Switch.

Thanks Jon, that is helpful to know.

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