Describe the problem/error/question
Hello, I have problem since version 1.105 (presumably) that i have code node that needs information from its previous run (its inside of the loop). It was working so far without issues (last run i did was on 30th July], but today when i’ve run it i encounter error
Cannot assign to read only property 'name' of object 'Error: Error finding the referenced node'
I debugged the problem down to the code:
$('Increment invoice nr').all(0,index-1)[0]
The node is calling its own previous execution and it was working fine before but now it triggers an error.
What is the error message (if any)?
Cannot assign to read only property 'name' of object 'Error: Error finding the referenced node'
Please share your workflow
This is the code of that node:
let input = $input.first();
console.log("test input",input);
let index = $runIndex;
const initialNumber = $('Set last invoice number').first().json.invoiceNumber;
console.log($('Set last invoice number').first().json.invoiceNumber);
console.log("index ",index);
if ($runIndex >0) {
console.log("prev run below");
console.log("prev run", $('Increment invoice nr').all());
if (input.json.error) {
input.json.invoiceNumber = $('Increment invoice nr').all(0,index-1)[0].json.invoiceNumber
return input;
}
console.log('invoicenr: '+$('Increment invoice nr').all(0,index-1)[0].json.invoiceNumber);
input.json.invoiceNumber = $('Increment invoice nr').all(0,index-1)[0].json.invoiceNumber+1
} else {
if (input.json.error) {
input.json.invoiceNumber = initialNumber
return input;
}
input.json.invoiceNumber = initialNumber + 1;
console.log('invoicenr from initial: ',input.json.invoiceNumber);
}
return input;
Information on your n8n setup
- n8n version: 1.105.3
- Running n8n via: n8n cloud
