n8n-code-javascript

Write reliable JavaScript in n8n Code nodes with data access patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing reliable and maintainable JavaScript inside n8n Code nodes can be error-prone due to data access patterns, webhook gotchas, and strict return formats. This skill guides developers through safe, repeatable patterns and built-in helpers to accelerate development.

Core Features & Use Cases

  • Data access patterns: $input.all() for batch processing, $input.first() for single results, and $input.item for per-item logic.
  • Built-ins: $helpers.httpRequest(), DateTime (Luxon), $jmespath for JSON querying.
  • Robust return safety: always return an array of objects with a json property; understand webhook data under .body.
  • Pattern library: practical examples for API calls, data transformation, and error handling.

Quick Start

  1. Choose Run Once for All Items mode for most workflows.
  2. Access data with $input.all(), $input.first(), or $input.item depending on mode.
  3. Return results using the standard [{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 an n8n Code node?

To access input data in an n8n Code node, use $input.all() for batch processing in Run Once for All Items mode, $input.first() for single results, or $input.item for per-item logic in Run Once for Each Item mode.

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

The correct return format for n8n Code node JavaScript is an array of objects containing a json property, such as [{json: {...}}]. Always returning this standard structure prevents workflow execution errors.

How do I make HTTP API requests inside an n8n workflow?

To make HTTP API requests inside an n8n workflow, use the built-in $helpers.httpRequest() method within your Code node. This helper handles external data fetching without needing separate HTTP Request nodes.

Why does my n8n webhook data fail to process in a Code node?

Webhook data fails to process in an n8n Code node when you do not extract it from the body property. Access incoming webhook payloads through the .body object to ensure proper data structure parsing.

Can I use Luxon DateTime for date handling in n8n?

Yes, you can use Luxon DateTime for date handling in n8n. The Code node environment includes DateTime as a built-in global, allowing direct date manipulation and formatting without external imports.

What is the best way to query JSON data in an n8n Code node?

The best way to query JSON data in an n8n Code node is using the built-in $jmespath helper. It applies JSON querying expressions directly to your input items for flexible data transformation.