[Bug] Nodes can't Input 2+ nodes back

Describe the problem/error/question

When I edit a node,
When I choose the Input of that Node
When I select a “2 nodes back” input
Then it does not save with this input.

Instead, it always saves with the “1 node back” input.

What is the error message (if any)?

Please share your workflow

{
“meta”: {
“instanceId”: “b14cfa157861b83637cb9723041071ab605725e767e436e60afbfad0f5c00eea”
},
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“field”: “cronExpression”,
“expression”: “0 1 * * SAT”
}
]
}
},
“id”: “661a43a1-68ca-46a4-b528-5719c0ece44a”,
“name”: “Schedule Trigger”,
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.1,
“position”: [
580,
260
]
},
{
“parameters”: {
“method”: “POST”,
“url”: “=https://api.browse.ai/v2/robots/{{ $json.robot_id }}/tasks”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Authorization”,
“value”: “Bearer 5c4a0ffb-3a7d-4e6e-94f8-7dca87b2a396:07288f5b-5b80-48b5-b2dd-bb287c74076c”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “item_list_limit”,
“value”: “5000”
}
]
},
“options”: {}
},
“id”: “2bbfc8c2-fe3f-4d5f-b1cf-dca8294f4989”,
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1340,
260
]
},
{
“parameters”: {
“mode”: “raw”,
“jsonOutput”: “{\n "robot_id": "3010386b-b7fe-4c6a-8914-814bc8bec1eb"\n}”,
“include”: “none”,
“options”: {}
},
“id”: “f645557b-5afd-4c40-adad-1fd6d30d48e1”,
“name”: “Edit Fields”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.2,
“position”: [
1160,
260
]
},
{
“parameters”: {
“operation”: “delete”,
“tableId”: “browse_ai_responses”,
“filters”: {
“conditions”: [
{
“keyName”: “id”,
“condition”: “gt”,
“keyValue”: “0”
}
]
}
},
“id”: “59f22852-558a-4119-9641-6739c89ab253”,
“name”: “Supabase”,
“type”: “n8n-nodes-base.supabase”,
“typeVersion”: 1,
“position”: [
980,
260
],
“alwaysOutputData”: true,
“credentials”: {
“supabaseApi”: {
“id”: “ue8AKSsRQvX00P2U”,
“name”: “Supabase account”
}
}
}
],
“connections”: {
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Supabase”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“Supabase”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: ai-beta
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system:

Hey @Kevin_Lourd,
welcome to the community. Here is the workflow of yours.

Even though I really don’t understand what is not working like you would have had expected. Maybe you can share some screenshots.

Thanks for your quick help @nico-kow!

When I select “Schedule Trigger” (2 node back) and leave the Edit of this Node, then it doesn’t save. Instead when I reopen the Edit I see that the Input is always back to Supabase (1 node back)

Maybe it is a feature and not a bug :wink:

Is my issue clearer now?
Thanks!

Okay I see @Kevin_Lourd,

this is acutally normal behaviour. With that you don’t define the input of that node. You have access to all results of all nodes before. You can think of this as a visual helper to find the data you want and need to access. In the following example you can see that the Result Node has access to all results (outcomes) before.

Cheers.

1 Like

@nico-kow is there a functional solution within a Code node as well?

I tried the same syntax as you mentions in a Code node but get an error in that case

let str = $('Supabase').item.json.item_visible;

Hey @Kevin_Lourd,

this is a little more complex because we need to handle mulitple items in code by ourselfs. This is because it is possible that your Supabase Node returned multiple items and in code you have access to all of them, not just for the current item you want to transform.

Therefore the code which should work for you is something like this (this will not work directly, because you don’t define the items):

let str = $('Supabase').all()[items.indexOf(item)].item.json.item_visible;

If your supabase node is just returning one item then you could use this line which will work directly:

let str = $('Supabase').first().item.json.item_visible;

Here is a workflow which shows the dataflow from node to node and how to handle this in the code nodes. It is based on your example.

Cheers.

It is working beautifully, thank you!