ba-n8n-js-code

Write JavaScript code for n8n Code nodes with data access and helpers.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Yukine5377/common --skill ba-n8n-js-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ba-n8n-js-code
Source: https://github.com/Yukine5377/common/tree/main/.cursor/skills/ba-n8n-js-code
Command: npx skills add https://github.com/Yukine5377/common --skill ba-n8n-js-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps business analysts and developers write reliable JavaScript code inside n8n Code nodes, addressing data extraction, transformation, API calls, and error handling.

Core Features & Use Cases

  • Data access patterns with $input.all(), $input.first(), and $input.item
  • Built-in helpers like $helpers.httpRequest() and DateTime for dates
  • Webhook data structure awareness and safe null checks
  • Production-grade return formats and error handling for stable workflows

Quick Start

Run a simple example that reads all items with $input.all(), transforms them, and returns [{json: result}] to proceed.

Frequently Asked Questions about ba-n8n-js-code

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

FAQPage Schema
How do I write JavaScript to transform data in an n8n Code node?

To extract data in an n8n Code node, use JavaScript access patterns like $input.all() for all items, $input.first() for the initial item, or $input.item for the current item, ensuring safe null checks during extraction.

How does $helpers.httpRequest work for API integration in n8n?

The $helpers.httpRequest built-in helper executes HTTP requests for API integration inside n8n Code nodes, allowing you to fetch external data and handle responses directly within your JavaScript workflow customization.

Can I use Luxon DateTime for date manipulation in n8n workflows?

Yes, you can use the built-in DateTime helper, which provides Luxon functionality for date manipulation, formatting, and calculations directly inside n8n Code nodes.

Why does my n8n Code node fail when processing webhook data?

n8n Code nodes often fail processing webhook data due to unsafe null checks or incorrect return formats. You must understand webhook data structures and implement safe null handling to return stable outputs like [{json: result}].

What is the correct return format for n8n Code nodes to prevent workflow errors?

The correct return format for n8n Code nodes is an array of objects containing a json key, such as [{json: result}], which ensures stable workflow execution and prevents downstream processing errors.