n8n-code-javascript

Write robust JavaScript in n8n Code nodes for data transformation and workflow orchestration.

92|27|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/WilkoMarketing/antigravity-n8n-skills --skill n8n-code-javascript-wilkomarketing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/WilkoMarketing/antigravity-n8n-skills/tree/main/n8n-code-javascript
Command: npx skills add https://github.com/WilkoMarketing/antigravity-n8n-skills --skill n8n-code-javascript-wilkomarketing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write robust JavaScript in n8n Code nodes by clarifying data access, execution modes, and return conventions.

Core Features & Use Cases

  • Data access patterns: $input.all(), $input.first(), and $input.item to handle batch and per-item processing.
  • Built-ins and integrations: $helpers.httpRequest() for HTTP calls, DateTime (Luxon) for date-time ops, and $jmespath() for JSON queries.
  • Webhook safety: access webhook payload via the recommended .body structure and guard against nulls with safe access patterns.
  • Return discipline: enforce the required [{json: {...}}] format across All Items and Each Item modes and robust error handling.
  • Use cases: transform, enrich, and route data; perform API calls; aggregate results; debug Code node errors.

Quick Start

Create a basic Code node that processes all inputs and returns the transformed 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?

To return data from an n8n Code node without getting an error, you must structure your output as an array of objects using the exact [{json: {...}}] format. Enforcing this return convention prevents execution errors across both All Items and Each Item modes.

How do I access webhook payload data in an n8n Code node?

Access webhook payload data in an n8n Code node by referencing the recommended .body structure. You should implement safe access patterns and null checks to guard against missing data when handling incoming HTTP webhook requests.

What is the difference between All Items and Each Item modes in n8n JavaScript code?

All Items mode processes the entire batch of input data at once using $input.all(), while Each Item mode processes individual items sequentially using $input.item. Choosing the correct execution mode ensures proper data transformation and routing.

Can I make HTTP API calls directly within an n8n Code node?

Yes, you can make HTTP API calls directly within an n8n Code node using the built-in $helpers.httpRequest() method. This allows you to fetch external data, enrich your current items, and aggregate API results within a single JavaScript execution.

How do I handle date and time operations in n8n JavaScript?

Handle date and time operations in n8n JavaScript using the built-in Luxon DateTime object. This integration allows you to perform robust date-time manipulations, format conversions, and arithmetic calculations directly inside your Code node workflow.

Why does my n8n Code node fail when processing null values?

Your n8n Code node fails on null values because JavaScript cannot access properties of undefined objects. You must implement safe null checks and safe access patterns before manipulating webhook bodies or input items to prevent workflow crashes.