Skills Development n8n JavaScript Code Node Guide

n8n JavaScript Code Node Guide

v20260928
n8n-code-javascript
This skill provides expert guidance for writing JavaScript code within n8n Code nodes. It covers using $input, $json, and $node syntax, making HTTP requests with $helpers, and working with dates using DateTime. It helps with troubleshooting Code node errors and choosing between Code node modes. Use this for complex transformations, custom calculations, recursive operations, and data aggregation that simple nodes cannot handle.
Get Skill
309 downloads
Overview

JavaScript Code Node

Expert guidance for writing JavaScript code in n8n Code nodes.


Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use Code Node

Use Code node when:

  • ✅ Complex transformations requiring multiple steps
  • ✅ Custom calculations or business logic
  • ✅ Recursive operations
  • ✅ API response parsing with complex structure
  • ✅ Multi-step conditionals
  • ✅ Data aggregation across items

Consider other nodes when:

  • ❌ Simple field mapping → Use Set node
  • ❌ Basic filtering → Use Filter node
  • ❌ Simple conditionals → Use IF or Switch node
  • ❌ HTTP requests only → Use HTTP Request node

Code node excels at: Complex logic that would require chaining many simple nodes


Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Info
Category Development
Name n8n-code-javascript
Version v20260928
Size 6.34KB
Updated At 2026-09-28
Language