Back to Skills

n8n-code-javascript

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.

1,530stars269forksUpdated 1/15/2026

Security Assessment

Medium Risk(50/100)

Detected risks:

Remote Code Execution([COMMON_PATTERNS.md] exec()
Security Score50/100

About n8n-code-javascript

The n8n-code-javascript skill enables users to write and execute JavaScript code within n8n Code nodes, streamlining the process of data manipulation and integration with external services. It addresses the need for flexibility and customization in automating workflows by allowing users to implement complex logic and process data directly within the n8n environment. This skill is particularly useful for users who require advanced data handling capabilities and want to make the most of n8n's automation features without relying solely on predefined nodes and actions.

Key features of this skill include access to built-in functions such as $input, $json, $node, and $helpers, which facilitate data retrieval and manipulation. Users can choose between two execution modes: "Run Once for All Items" and "Run Once for Each Item," allowing them to tailor their scripts based on the specific requirements of their workflow. The skill also supports date handling through the DateTime library and provides guidance on troubleshooting common Code node errors, making it a comprehensive resource for developers looking to enhance their n8n experience.

This skill is targeted at developers, data analysts, and automation specialists who leverage n8n to create efficient workflows. Use cases range from simple data transformations to complex aggregations and API integrations. Whether users are looking to validate incoming data, aggregate results from multiple sources, or perform item-specific operations, the n8n-code-javascript skill provides the necessary tools and guidance to achieve their automation goals effectively.

FAQ

How do I access input data in the Code node?

You can access input data using $input.all(), $input.first(), or $input.item depending on the execution mode.

Can I make HTTP requests within the Code node?

Yes, you can use $helpers.httpRequest() to make HTTP requests.

What is the recommended mode for most use cases?

The recommended mode is 'Run Once for All Items' for most use cases.

Are there any specific return formats I need to follow?

Yes, you must return data in the format of `[{json: {...}}]`.

What library is used for date handling?

The skill utilizes the DateTime library from Luxon for date handling.

All Files

6 files
README.md9.2 KB
View
BUILTIN_FUNCTIONS.md16.4 KB
View
SKILL.md15.6 KB
View
COMMON_PATTERNS.md28.5 KB
View
DATA_ACCESS.md15.6 KB
View
ERROR_PATTERNS.md15.9 KB
View

Install n8n-code-javascript

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill