Skip to content

JavaScript examples#

In n8n, you can write custom JavaScript code snippets to add, remove, and update the data you receive from a node. You can also use code snippets to modify the data structure of the data returned by a node.

Keep in mind

We are using Set node for illustrating expressions here. However, you can use the code snippets as an expression in any node. To do that, click on the gears icon next to a field and click on Add Expression.

For each section, we'll share code snippets that can be used in the function node as well as the expressions. You can read more about Expressions and adding code snippets to the Function node in our documentation.