n8n-code-javascript

Write robust JavaScript in n8n Code nodes using $input, $helpers, and DateTime.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/Gingi892/automation-shamai --skill n8n-code-javascript-gingi892
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/Gingi892/automation-shamai/tree/main/skills/n8n-code-javascript
Command: npx skills add https://github.com/Gingi892/automation-shamai --skill n8n-code-javascript-gingi892

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write robust JavaScript code inside n8n Code nodes, replacing guesswork with proven patterns and safe data handling.

Core Features & Use Cases

  • Data access mastery with $input.all(), $input.first(), and $input.item, plus references to other nodes via $node and direct $json usage.
  • Return format enforcement: always output an array of objects with a json property.
  • Safeguards for webhook data, including the common .body nesting pattern.
  • Built-in helpers: $helpers.httpRequest, DateTime (Luxon), and $jmespath for data querying.
  • Production-ready patterns library: 10 patterns for data transformation, aggregation, and reporting.

Quick Start

  1. Open a Code node and choose Run Once for All Items as the typical mode.
  2. Use $input.all() to collect items and perform transformations with map/reduce.
  3. Return results as [{json: ...}] and test with empty input.

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?▼

n8n Code node JavaScript requires returning an array of objects containing a json property, such as [{json: ...}], to safely pass transformed data downstream. Test with empty input to validate the return format.

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

Access webhook data inside an n8n Code node by referencing the common .body nesting pattern from the incoming request payload, ensuring you extract the correct JSON structure rather than top-level metadata.

Can I make HTTP requests directly within n8n Code node JavaScript?▼

You can make HTTP requests directly within n8n Code node JavaScript using the built-in $helpers.httpRequest method, enabling API integration and data fetching without a separate HTTP Request node.

Does n8n Code node support Luxon DateTime for date manipulation?▼

n8n Code node supports Luxon DateTime for date manipulation, allowing you to parse, format, and compute dates directly within your JavaScript transformations using the built-in DateTime object.

What is the best way to query JSON data in n8n Code nodes?▼

The best way to query JSON data in n8n Code nodes is using the built-in $jmespath helper, which extracts and filters specific data elements from complex API responses during workflow transformations.