Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No path back to referenced node There is no connection back to the node 'CodeB', but it's used in code here. #2027

Open
classbasics opened this issue Apr 12, 2024 · 5 comments
Assignees

Comments

@classbasics
Copy link

I can't seem to fix the error 'No path back to referenced node
There is no connection back to the node 'CodeB', but it's used in code here.
'
I have looked at
https://docs.n8n.io/data/data-mapping/data-mapping-ui/
https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-errors/
and
https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-code-node/#paireditem-usage-example
without luck.

I have tried multiple variations.

This is my example workflow
https://github.com/classbasics/intro-to-github/blob/master/My_workflow_7.json

@classbasics
Copy link
Author

I just tried a different approach based on
https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-node-building/
but it failed as well.

My example does not include
"item": item.pairedItem as item.pairedItem is undefined
or
"item": i, as i is undefined

https://github.com/classbasics/intro-to-github/blob/master/My_workflow_7b.json

@StarfallProjects
Copy link
Contributor

Hi @classbasics does this relate to a workflow example in the docs? If you need help with your own workflows, please use the forum: https://community.n8n.io/

@StarfallProjects StarfallProjects self-assigned this Apr 15, 2024
@classbasics
Copy link
Author

classbasics commented Apr 16, 2024 via email

@StarfallProjects
Copy link
Contributor

StarfallProjects commented Apr 16, 2024

Hi @classbasics I think there are a few things going on here. First up, I've got a version of your example working, so hopefully that unblocks you. But I do think there may be some odd behaviour as well. Details of both below:

Working examples

First: I want to make sure in case there's confusion: you usually don't need to handle item pairing yourself. In the case of your simplified examples, the item pairing/item linking does nothing.

Second: Given this data structure in the Code node output:

[
  {
    "fn": "Bob",
    "age": 17
  },
  {
    "fn": "Jane",
    "age": 18
  }
]

You can refer to the fields more simply, with just $json["fn"]

So, using your first example workflow, this works:
image

This simplified example also works (check the simpler data structure in the code node):
compare_datasets_gh.json

So, if these examples reflect what you're trying to do, hopefully that solves the immediate problem.

Odd error

However, I do think there is also something odd going on. Although you don't need the data structure you create in the code node, and there are shorter ways of referring to input items, your way should still work (and indeed it does - for input A). I played around a little with your first example (e.g. simplifying the data) and that expression for referencing it still failed. I'm going to take this to our support team.

@StarfallProjects
Copy link
Contributor

Worth adding: you would usually use the compare datasets node to compare by field name, so wouldn't use an expression here. But I'm guessing this was just for the sake of example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants