My automations worked fine up through version 0.219.1
Last night I upgraded to 0.221.2 and many of them broke. Debugging, it seems that $input.first().json and input.all() are empty, even when there is input visible in the editor.
Downgraded to 0.221.0 and still had the same problem.
Downgraded to 0.219.1 and the problem has gone away.
Do I need to update my code? This can’t be a widespread problem or it would be affecting a lot of people.
What is the error message (if any)?
console.log($input.all()) and console.log($input.first().json) are empty even when there is input visible in editor.
Please share the workflow
It’s a big automation. Here’s a snippet:
Information on your n8n setup
0.219.1 works. Doesn’t work with 0.221.0 or 0.221.2. Didn’t test other versions
Database: MySQL
Mode: Own
Running on Amazon EC2 t4g.medium running Ubuntu 22.04.2 LTS
Sorry, took me a moment to spin up a replica. I can’t keep changing the n8n version on the production server.
The simple test script you posted above works fine on 0.221.2. However, my script breaks in the same place it was breaking before. So there must be something more complicated going on.
The error I get is ERROR: Code doesn’t return items properly. I think that’s because it gets past the first test if ($input.first().json.length == 0) and I think the main loop for (const item of $input.all()) is empty. So the next step results = allmsgs; return results; returns null.