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

Drag-and-drop expression in n8n incorrectly generates references to node data #10730

Open
F4ntik opened this issue Sep 9, 2024 · 2 comments
Open
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@F4ntik
Copy link

F4ntik commented Sep 9, 2024

Bug Description

When using the drag-and-drop feature to insert data from nodes that are 2 or more steps back in the workflow, the generated expressions are incorrect. The feature adds unnecessary .item references or other incorrect syntax, which causes the expressions to fail. This issue occurs specifically when trying to reference nodes that are not immediately before the current node in the workflow.
image
Red - using drag'n'drop
Green - manual editing

To Reproduce

  1. Create a workflow in n8n with multiple nodes.
  2. Add data-generating nodes (e.g., HTTP Request or Code nodes).
  3. In a later node, try to use the drag-and-drop feature to reference data from nodes that are two or more steps earlier in the workflow.
  4. Notice that the generated expression contains incorrect syntax, such as unnecessary .item references or other elements that cause errors like "Can't determine which item to use."

Expected behavior

The drag-and-drop feature should correctly generate expressions that use the proper syntax, such as
{{ $node.Configure.json.guild_id }} or {{ $node["Configure"].json["guild_id"] }}, without adding unnecessary .item or other incorrect parts.

Operating System

https://n8n.io/

n8n Version

1.57.0

Node.js Version

don't know

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Sep 9, 2024

Hey @F4ntik,

We have created an internal ticket to look into this which we will be tracking as "GHC-214"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Sep 9, 2024
@Joffcom
Copy link
Member

Joffcom commented Sep 9, 2024

Hey @F4ntik,

The red is actually the "correct" syntax we changed it back in v1, When you try and run the node what error do you see as it could be that paired items is not implemented correctly in the node the data is coming from.

You can find more information on the syntax here: https://docs.n8n.io/code/builtin/output-other-nodes/#__tabbed_1_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants