Unable to Retrieve Node Value Post-Condition Node in n8n

Hello everyone,

I’m facing an issue with my n8n workflow where I’m unable to retrieve a value from a preceding node after passing through a condition node.

Here’s the situation: I have a workflow with an authentication node (“ERMEO API - AUTHENTIFICATION”) that successfully fetches an access token, which I need to use in subsequent nodes. This works fine until the workflow hits a condition node. After the condition node, when I try to retrieve the access token using the syntax:

{{ $('ERMEO API - AUTHENTIFICATION').item.json["data"]["access_token"] }}

I end up with an undefined value.

I can confirm that the value is present and retrievable before the condition node. Would anyone know why the value becomes undefined after the condition node and how I might resolve this issue?

For additional context, I am using the latest version of n8n.

Any help or guidance would be greatly appreciated!

Thank you in advance for your support.

Hi @Daradaal, without knowing your exact workflow I think the problem here is the use of the {{ $("Node Name").item... expression. This relies on item linking which requires additional code to work after the Code node. Seeing you have multiple code nodes this would be a lot of work.

Seeing your node only returns a single item, perhaps you want to use an expression of {{ $("Node Name").first... instead? This expression (documented here) would not not rely on item linking and instead simply read the first item from another node.

1 Like

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