n8n-code-javascript

Write JavaScript in n8n Code nodes with $input.all(), $input.first(), and [{json: {...}}] returns.

1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/rafavital/agile-trends-n8n --skill n8n-code-javascript-rafavital
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/rafavital/agile-trends-n8n/tree/main/.gemini/skills/n8n-code-javascript
Command: npx skills add https://github.com/rafavital/agile-trends-n8n --skill n8n-code-javascript-rafavital

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables robust JavaScript coding in n8n Code nodes by clarifying data access, return formats, and mode selection.

Core Features & Use Cases

  • Guidance on choosing Run All Items vs Run Each Item modes for common data transformation tasks.
  • Clear data access patterns with $input.all() and $input.first(), plus the correct use of $node and $json.
  • Return format rules and built-in tooling references to ensure production-ready code.

Quick Start

In your Code node, choose Run Once for All Items, access data with $input.all() or $input.first(), and always return results as an array of objects in the form [{json: {...}}].

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 breaking the workflow?

Accessing n8n Code node data requires $input.all() for all items or $input.first() for a single item. Choosing the correct method depends on whether you process batches or individual records in Run Once for All Items mode.

What is the best way to handle webhook data in an n8n Code node?

Making HTTP requests within an n8n Code node uses the built-in $helpers.httpRequest utility. This function allows you to execute API calls and process external responses directly inside your JavaScript logic.

Does n8n Code support Luxon DateTime for date manipulation in workflows?

Choosing between Run All Items and Run Each Item modes in n8n Code nodes depends on your data transformation needs. Run Once for All Items is specified for batch processing, API calls, and webhook data handling.

Why does my n8n Code node return an empty array or undefined error?

Using $node and $json in n8n Code nodes provides clear data access patterns for previous node outputs. These variables allow you to reference specific items and properties during batch data transformations.