n8n-code-javascript

Write safe JavaScript code patterns for n8n Code nodes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of writing effective, safe, and maintainable JavaScript code within n8n Code nodes, enabling users to perform complex data transformations and API interactions seamlessly.

Core Features & Use Cases

  • Flexible Data Access: Use $input.all(), $input.first(), and $input.item to handle various data processing scenarios.
  • Best Practice Patterns: Provides validated code patterns for aggregation, filtering, JSON querying, and report generation.
  • Error Prevention: Includes guidance on safe coding practices, null checks, and return formatting to prevent common workflow errors.
  • Comprehensive Reference: Leverages n8n's built-in functions like $helpers.httpRequest(), DateTime from Luxon, and $jmespath() for advanced data querying.

Quick Start

Enter your data, then access it with $input.all() or $input.first() to perform your transformation logic directly within the node. Make sure to return the data as an array of objects with a json property.

Frequently Asked Questions about n8n-code-javascript

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

FAQPage Schema
How do I handle data transformation in n8n Code nodes using JavaScript?

Data transformation in n8n Code nodes is handled by accessing items via `$input.all()` or `$input.first()`, applying your JavaScript logic, and returning an array of objects containing a `json` property to ensure proper workflow execution.

What is the best way to prevent workflow errors in n8n JavaScript code?

To prevent workflow errors in n8n JavaScript code, apply safe coding practices including null checks, proper return formatting, and error mitigation patterns. These practices ensure reliable production deployments and prevent common data processing failures.

Can I use built-in n8n helpers like $helpers.httpRequest for API integrations?

Yes, you can use built-in n8n helpers like `$helpers.httpRequest()` for API integrations. The Skill provides validated code patterns to help you seamlessly perform API interactions and data querying within your automation workflows.

How do I query JSON data in n8n workflows using JavaScript?

You query JSON data in n8n workflows using the built-in `$jmespath()` function. This allows for advanced data querying and flexible data access alongside other techniques like filtering and aggregation within the Code node.

Does n8n JavaScript code support Luxon DateTime operations for automation?

Yes, n8n JavaScript code supports Luxon DateTime operations for automation. You can leverage DateTime from Luxon within your Code nodes to handle date and time transformations as part of your data processing logic.

Why does my n8n Code node return a data format error?

An n8n Code node returns a data format error when output is not properly structured. You must return data as an array of objects with a `json` property, using safe coding practices and null checks to prevent common workflow formatting errors.