n8n-code-javascript

Write and manage custom JavaScript logic in n8n Code nodes.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/baselakkad585-maker/basel-dev-skills --skill n8n-code-javascript-baselakkad585-maker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/baselakkad585-maker/basel-dev-skills/tree/main/skills/n8n-code-javascript
Command: npx skills add https://github.com/baselakkad585-maker/basel-dev-skills --skill n8n-code-javascript-baselakkad585-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write and manage custom JavaScript logic directly in n8n Code nodes to extend workflow capabilities, reducing external scripting and handoffs between steps.

Core Features & Use Cases

  • Write and run JavaScript with direct access to input data and node helpers (e.g., $input, $json, $node, $helpers).
  • Perform data transformation, API calls, date handling with DateTime, and debugging within a single Code node.
  • Choose between Run Once for All Items and Run Once for Each Item modes to suit batch processing or per-item logic.
  • Troubleshoot Code node errors with guidance and best practices.

Quick Start

Create a Code node in your workflow, access input with $input.all(), and return an array of { json: ... } objects to produce transformed results.

Frequently Asked Questions about n8n-code-javascript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write custom JavaScript for data transformation inside n8n workflows?

To write custom JavaScript for data transformation in n8n, you use a Code node to run scripts with direct access to input data via $input.all() and must return an array of { json: ... } objects to produce transformed results.

What is the difference between Run Once for All Items and Run Once for Each Item in n8n Code nodes?

Run Once for All Items processes the entire batch of input data in a single script execution, while Run Once for Each Item executes the JavaScript logic individually per data item, allowing you to choose between batch processing or per-item logic.

How do I access input data and node helpers inside an n8n Code node?

You access input data and node helpers inside an n8n Code node using built-in syntax like $input, $json, $node, and $helpers, enabling you to perform tasks like API calls, date handling, and debugging within a single node.

Why does my n8n Code node return an error when transforming data?

n8n Code node errors during data transformation often occur because the script environment requires returning an array of objects with json payloads, and failing to format the output correctly will trigger execution errors.

Can I make API calls and handle dates directly within an n8n workflow Code node?

Yes, you can make API calls and handle dates directly within an n8n Code node by writing custom JavaScript logic that leverages node helpers and DateTime functions to manage data without external scripting.

Do I need external scripts to extend n8n workflow capabilities for complex data logic?

No, you do not need external scripts to extend n8n workflow capabilities for complex data logic because you can write and manage custom JavaScript directly in Code nodes to handle API calls, date handling, and debugging.