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.

My feedback would a combination of some of the requests above for:

  • drag/drop inputs
  • some boiler plate templates that help you to get started
  • improved AI assistant (I havenā€™t been able to get anything functional from the current assistant and always go elsewhere for this)

These could intersect in a number of ways:

  1. Basic templates with drag/drop inputs can be used as a starting point for customising the code
  2. You could have a form where you drag the input fields you want to work with and then a text box where you write instructions for the code you want the AI assistant to produce.
  3. Have a specific option for to describe to the the AI assistant of problems with current code (e.g. based on the log messages) or changes you want made.