n8n-code-javascript

Write JavaScript code for n8n Code nodes with data access and return formats.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/Gabrielloopes33/nexIA --skill n8n-code-javascript-gabrielloopes33
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/Gabrielloopes33/nexIA/tree/main/.claude/skills
Command: npx skills add https://github.com/Gabrielloopes33/nexIA --skill n8n-code-javascript-gabrielloopes33

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

n8n Code Node development often leads to fragmented workflows, repetitive boilerplate, and error-prone data handling. This skill provides a practical framework of patterns, guardrails, and built-in utilities to implement robust JavaScript code inside n8n Code nodes, reducing debugging time and improving maintainability.

Core Features & Use Cases

  • Direct data access with $input.all(), $input.first(), and $input.item for batch and per-item processing.
  • Built-in helpers and globals: $helpers.httpRequest(), DateTime (Luxon), $jmespath(), JSON, Math, and Node.js modules.
  • Production-grade patterns: data aggregation, JSON comparison, top-N ranking, string reporting, Slack/Block Kit formatting, and webhook-safe data handling.
  • Safe error handling and webhook data access strategies to prevent common runtime failures.
  • How to start: design code in Run Once for All Items mode, choose appropriate data access method, and ensure outputs follow the required [{json: {...}}] shape.

Quick Start

Create a Code node that reads all inputs with $input.all(), processes each item, and returns a properly wrapped [{json: {...}}] array.

Frequently Asked Questions about n8n-code-javascript

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

FAQPage Schema
How do I return data from an n8n Code node without getting an error?

You can access webhook data in an n8n Code node by using safe data access strategies with $input.all() or $input.first(). This prevents common runtime failures when handling webhook payloads by ensuring your JavaScript securely processes the incoming JSON data.

Can I use Luxon and HTTP requests inside an n8n Code node?

Yes, you can use Luxon and HTTP requests inside an n8n Code node through built-in helpers and globals like $helpers.httpRequest() and DateTime. These utilities enable robust date-time operations and external API calls directly within your JavaScript workflow logic.

What is the best way to process multiple items in an n8n Code node?

The best way to process multiple items in an n8n Code node is designing your code in Run Once for All Items mode. You use $input.all() for batch data access, iterate through each item, and return a properly wrapped [{json: {...}}] array.

Why does my n8n Code node fail when transforming JSON payloads?

Your n8n Code node likely fails during JSON transformations because the output does not follow the required [{json: {...}}] return format. Implementing safe data access and proper error handling prevents these common runtime failures.

Does n8n Code node support JMESPath and Node.js modules for data aggregation?

Yes, the n8n Code node supports JMESPath and Node.js modules for data aggregation. You can use the $jmespath() built-in helper alongside standard JavaScript patterns to rank top-N items, compare JSON objects, and format Slack Block Kit strings.