Skip to content
Skillpedia
General coding48k · #3654

n8n-code-javascript

Helps your agent write JavaScript code in n8n. It uses specific syntax and makes HTTP requests. Useful for customizing workflows with custom logic.

What it does

This guide helps you write JavaScript code within n8n, an automation tool. It's useful for more complicated programming tasks that other n8n tools can't handle.

When to use it

  • ✓When you need to perform complex calculations or apply custom business logic.
  • ✓When processing API responses with complicated structures.
  • ✓To group data from different sources in an advanced way.

Example of what to ask your AI

“How can I use JavaScript in n8n to transform input data?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-javascript/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-javascript/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

n8n allows you to write your own JavaScript code to manipulate data. It provides special tools to access information from previous steps and make requests to other services.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill n8n-code-javascript

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-javascript/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.
FAQ

When should I use the Code node instead of other nodes?

Use the Code node for complex multi-step transformations, custom calculations, recursive logic, parsing complex API responses, multi-step conditionals, or data aggregation. For simpler tasks like field mapping or basic filtering, use nodes like 'Set', 'Filter', or 'IF'.

What are '$input', '$json', '$node', and '$helpers'?

These are special shortcuts n8n provides so your JavaScript code can easily access input data, information from previous nodes, and useful functions for making requests or working with dates.

Does this guide replace the need to test my code?

No. This guide offers guidance, but you still need to validate and test your code in your specific environment to ensure it works correctly and securely.

Details

Original description by the author

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3654
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills