n8n-code-javascript

Write JavaScript in n8n Code nodes for data transforms and API calls.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/AeyeOps/aeo-skill-marketplace --skill n8n-code-javascript-aeyeops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/AeyeOps/aeo-skill-marketplace/tree/main/aeo-n8n/skills/n8n-code-javascript
Command: npx skills add https://github.com/AeyeOps/aeo-skill-marketplace --skill n8n-code-javascript-aeyeops

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers harness n8n Code nodes to perform advanced data transformations, API calls, and logic directly inside workflows, reducing reliance on external scripts and consolidating automation.

Core Features & Use Cases

  • Access input data with $input.all(), $input.first(), and $input.item to implement batch or per-item logic.
  • Use built-in functions like $helpers.httpRequest(), DateTime (Luxon), and $jmespath() to perform API calls, date handling, and JSON querying without external packages.
  • Implement robust error handling, safe null checks, and correct return formats (an array of objects with each item containing a json property).
  • Use for complex data transformations, data validation, aggregation, and integration scenarios such as CRMs or dashboards.

Quick Start

Begin by reading the Quick Start example, which shows a simple transformation using $input.all() and returns [{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 write JavaScript in n8n Code nodes to transform workflow data?

To write JavaScript in n8n Code nodes, use $input.all() for batch processing or $input.item for per-item logic, ensuring you return an array of objects structured as [{json: {...}}] for valid workflow data transformation.

Can I make HTTP requests inside an n8n workflow using JavaScript?

Yes, you can make HTTP requests inside n8n workflows using the built-in $helpers.httpRequest() function within Code nodes, eliminating the need for external scripts or packages to fetch API data.

What is the correct return format for n8n Code nodes?

The correct return format for n8n Code nodes is an array of objects where each item contains a json property, explicitly structured as [{json: {...}}], to ensure downstream workflow nodes receive the transformed data properly.

How do I handle dates and query JSON in n8n without external packages?

Handle dates and query JSON in n8n without external packages by using built-in functions like DateTime for Luxon date handling and $jmespath() for JSON querying directly within your Code node scripts.

Why does my n8n webhook data access fail in JavaScript?

Webhook data access in n8n fails when not properly referencing the payload; you must safely access incoming webhook data under the .body property to extract values correctly within your Code node logic.

Does n8n support batch and per-item execution patterns for data transforms?

Yes, n8n supports both batch and per-item execution patterns for data transforms using $input.all() and $input.item respectively, allowing flexible implementation of complex logic, safe null checks, and robust error handling.