My variables are suddenly [undefined] after months of working properly

Describe the problem/error/question

My variables are suddenly [undefined] after months of working properly.

It happens since last night and I don’t know why.

What is the error message (if any)?

This was an execution before the update:

And this one after the update:

When I use the variables in the schema it gives me those variables so I don’t know what’s happening. This workflow has been used for months without any changes and it has been working properly with no issues for months.

Please share your workflow

I cut of 95% the workflow because the topic wouldnt allow this many characters.

Share the output returned by the last node

Thisis the output because the airtable formula doesn’t work because the variables are [undefined] but i use these variables in many subsequent nodes so those would error too.

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Cloudron):
  • Operating system:
1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: LATEST VERSION (auto-updated by cloudron)
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It happened to all my other workflows as well?!?! This is really problematic.

I had to change all my variables from for example:
{{ $(‘Get an order’).json.data.orders.edges[0].node.displayFinancialStatus }}

To
{{ $node[‘Get an order’].json.data.orders.edges[0].node.displayFinancialStatus }}

1 Like

It’s a bug.

The issue is nodes later in the workflow can not reference nodes that executed earlier in the workflow!

What makes this bug weird:

  1. I can still access the node that ran earlier and drag and drop fields from it but they just become undefined.
  2. I can reference the node that ran with the exact same expression earlier in the workflow just fine, i.e. there is a random “cut off” point in the workflow after which the earlier node can’t be referenced.
  3. Workflows that have worked fine and referenced those earlier nodes suddenly broke down after hundreds of successful executions.

I’m escalating this to our engineering team.

1 Like

@Leon_Botzen @Tero - Which version are you running?
The latest is 1.79.3

1 Like

Apologies for this @Leon_Botzen, that should definitely not happen. We’re trying to reproduce this right now but fail to do so at the moment. A few questions:

  • What version of n8n are you seeing this on?
  • Is this only happening in manual executions or also in production ones?

I tried copying the workflow above but did not run into the error. Would you happen to have another example? Maybe @Tero could you share your example?

2 Likes

Thanks for the quick replies guys!

  • I am running the latest could version 1.79.3.

  • Sorry, I can’t get the workflow below the character limit without completely breaking it so can’t paste it here. Here is a download link to the workflow from the video (add a set node after the Postgres node and reference Company Data node to replicate): database_contacts_agent____.json

  • Here is a quick recording how it looks: After postgres node can’t access previous nodes.mp4
    (Edit: changed video share settings to anyone)

That mp4 is not public… If it’s < 5MB you can just drag it into the message editor to upload it here.

1 Like

Sorry about that, should be public now.

1 Like

Can you update to 1.79.4 or 1.80.3 either of these 2 versions will fix this issue.

1 Like

Confirmed: Updating to 1.80.3 fixed the issue!

Even this beauty of an expression started working:

{{(() => {
    return ['No New Contacts Added', 'New Contacts Added', 'No Contacts Updated', 'Contacts Updated']
        .filter(node => $(node).isExecuted) // Keep only executed nodes
        .map(node => $(node).first().json.enrichment_notes) // Extract enrichment_notes
        .filter(note => note && note.trim() !== '') // Remove empty values
        .join(' | ') || 'No enrichment notes available'; // Default if none executed
})()}}

Yesterday I was scratching my head trying to spot why I can’t get it to work.

2 Likes

How do I reference a variable that I set with edit fields and later want to check again. I want to access that variable in a switch fields event. Nio way to access my $json.whichflow cause it wasn’t passed… how do I pass global variables that I want to access across the entire workflow? Is this so hard… like wtf?


{{ $('Edit Fields1').item.json.whichflow }}

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