Help us improve the Code node 💡 Share your ideas and feedback

Hi n8n team!

I discussed with one of my colleagues and he said this: “It should allow you to map fields from other nodes using drag and drop, rather than having to constantly search for the exact syntax and manually enter the names of the nodes in the backend. Also, when you rename a node before a code node, it should automatically update the name in the code within the code node, so you don’t have to do it manually.”

3 Likes

Hey community!
Thanks a lot for all the feedback :raised_hands: that’s very helpful!

Related to the request to drag/drop input data:

if the node is set to “Run Once for All Item”, what would you expect to drag?
In that case, the node works on the whole array of items, which you access with $input.all(). How do you expect drag/drop to work here?

1 Like

You know, it’s one of those things where when I drag the item, I expect the item to appear there with the curly brackets, whatever the normal behavior elsewhere

So you’d have two available routes,
first is, whatever you’re dragging, give me at least the path up until $json or item.
So, if i’m dragging $json.body.group.item , give body.group.item

Otherwise, based on what’s selected, either Run Once for All Item or All at once, put the right prefix?

I’m a user with basic understanding of javascript and this is my experience. I just want to drag the item into where I’m at right now in the block of code. I love the feature because I don’t have to stress about where [n] is and whatnot

1 Like

Here are my suggestions

  1. NPM packages on the cloud version. I am a relatively new cloud user for n8n, and the most frustrating part has been trying to work around this restriction. I so far have been able to work around all the issues. But, for new users, I think being able to just throw in an npm package and work with known tools would be a much better user experience.
  2. Code window could extend further vertically. When editing on a 4k screen, the vertical window size is limited. There is just empty space below it.
  3. If you have longer names for the nodes, you can’t see what you are selecting with the auto select.
    image
  4. Reusable functions. I have to validate the user’s webhook post on every request using firebase auth. So, if I could just reference that function, it would be much simpler to build and maintain. If I change something that could be reusable, I have to change it for every webhook.
  5. You can’t insert the inputs into the code, like you can with all the other nodes.
  6. As a newish user, the way that you have to input parameters is a little confusing. You don’t know if you are selecting the right variable from a previous node. I have got it now (mostly), but if you could automatically see what the value was of the variable that you are inputting (like a popup), then you would be able to figure out the system faster.

Thanks a lot for the feedback @experimarketing :raised_hands:

Could you elaborate a bit on this one:

Thanks in advance

Yes, I just mean, in the left hand panel, you can’t drag values from the left panel into the code editor in the center panel, like you can with other nodes.

1 Like

In our case, my colleague refers to sth similar to Make, like displaying a collection of items from all the nodes; when you click on a field to populate in the code editor.
If it is an array, prompting for which index to use would be great, or allow dragging and dropping the array elements from a node’s output directly.

Another one I thought of. This is pretty minor, but it might be nice to have a console output below the code, so you can console log stuff and have it show up without using dev tools. Pretty minor, as you can just use dev tools, but for ux it might be useful.

Being able to search for text within the code node would be helpful.

In Chrome, if you use CTRL+F, it only shows you what is on the page usually, it doesn’t show any matches outside of the view in the code.