n8n-code-javascript

Guide JavaScript data access and returns in n8n Code nodes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers craft, validate, and debug JavaScript code inside n8n Code nodes, ensuring correct data access, safe returns, and reliable integration with built-in helpers.

Core Features & Use Cases

  • Data access patterns: $input.all(), $input.first(), and $input.item, plus cross-node references via $node.
  • Built-in utilities: $helpers.httpRequest(), DateTime (Luxon), $jmespath(), and persistent storage with $getWorkflowStaticData().
  • Typical workflows include data aggregation, per-item processing, API calls, transformation, and error handling.

Quick Start

Process all input items with $input.all(), apply a transformation to each item, and return an array of objects in the required { json: { ... } } format.

Frequently Asked Questions about n8n-code-javascript

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

FAQPage Schema
How do I access input data in n8n Code nodes using JavaScript?

Access input data in n8n Code nodes using $input.all() for all items, $input.first() for the initial item, or $input.item for per-item processing. Cross-node references are available via the $node object.

What is the correct return format for n8n Code node JavaScript functions?

The correct return format for n8n Code nodes requires returning an array of objects structured as [{json: {...}}]. This ensures the workflow properly parses the transformed data for downstream nodes.

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

Yes, n8n Code nodes support built-in utilities including DateTime (Luxon) for date manipulation and $helpers.httpRequest() for API calls, enabling complex data transformation and external service integration.

How do I handle webhook data in n8n Code node JavaScript?

Access webhook data in n8n Code nodes by referencing the payload under the .body property. Ensure proper data extraction and validation to prevent common error patterns when processing incoming webhook requests.

What is the best way to aggregate data across multiple items in an n8n Code node?

Use $input.all() to retrieve all items for data aggregation in n8n Code nodes. Apply JavaScript array methods to transform the dataset, then safely return the results as an array of {json: {...}} objects.