Code node
In n8n, the Code node lets you write JavaScript or Python code and run it as a step in a workflow. It replaced the Function and Function Item nodes starting with version 0.198.0.
On this page
Source content checked . English translation published 2026-10-27.
In business automation
Sometimes there is no ready-made node that does exactly what you need, such as special processing for a list. In n8n, the Code node lets you write JavaScript or Python code and run it as a step in a workflow. According to n8n's documentation, it replaced the Function and Function Item nodes starting with version 0.198.0.
Examples
These examples illustrate a possible workflow. Adapt the connections and rules to your own systems.
Cleaning phone numbers before sending
A workflow receives leads from a form, and the phone number field contains spaces and hyphens. A short Code node cleans the numbers into a consistent format before they are passed to the CRM.
Relevant tools
- n8n
- This definition comes from the official n8n documentation.
What to check
- Looking for the Function or Function Item nodes in newer versions. According to the documentation, the Code node replaced them starting with version 0.198.0.