n8n-code-javascript

Write JavaScript data transformations in n8n Code nodes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing JavaScript in n8n Code nodes is error-prone and verbose; this guide provides structured, production-ready patterns to help you implement robust data transformations inside Code nodes.

Core Features & Use Cases

  • Data access patterns: use $input.all(), $input.first(), or $input.item to work with multiple inputs, single responses, or per-item logic.
  • Mode selection & return formats: guidance on selecting Run Once for All Items vs Run Once for Each Item and the required [{json: {...}}] output format.
  • Safety & built-ins: leverage safe null handling, $helpers.httpRequest(), DateTime/Luxon, and $jmespath for JSON querying.
  • Error prevention: understand common pitfalls such as webhook data under .body and how to debug with console.log.

Quick Start

Create a simple Code node that reads all inputs, computes a total, and returns it 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 return data from an n8n Code node without getting an error?

To return data from an n8n Code node without errors, always format your output as an array of objects using the required [{json: {...}}] structure. This ensures the workflow correctly parses your transformed data.

When should I use Run Once for All Items vs Run Once for Each Item in n8n?

Choose Run Once for All Items when you need to aggregate multiple inputs or perform complex transformations across the entire dataset. Use Run Once for Each Item for isolated per-item logic.

How do I access webhook data inside an n8n Code node?

Access webhook data in an n8n Code node by targeting the payload under the .body property. Using the correct data access patterns like $input.all() or $input.first() prevents common webhook parsing errors.

Can I use built-in helpers like httpRequest and jmespath in n8n Code nodes?

Yes, you can use built-in helpers in n8n Code nodes to build reliable transformations. Leverage $helpers.httpRequest() for API calls, $jmespath for JSON querying, and DateTime for Luxon date parsing.

What is the best way to handle null values in n8n JavaScript transformations?

The best way to handle null values in n8n JavaScript transformations is to apply safe null handling patterns. Structured guardrails prevent common pitfalls during data access and complex aggregations.

Why does my n8n Code node fail when processing multiple items?

An n8n Code node fails when processing multiple items if the output is not wrapped in the required [{json: {...}}] format or if you select the wrong execution mode for your data access pattern.