本文へスキップ
Skillpedia
一般的なプログラミング48k · #5268

n8n-code-javascript

できること

このガイドは、自動化ツールであるn8n内でJavaScriptのコードを書く方法を解説します。他のn8nのツールでは対応できない、より複雑なプログラミング作業に役立ちます。

使う場面

  • ✓複雑な計算を行ったり、独自の業務ロジックを適用したりしたいとき。
  • ✓構造が複雑なAPIの応答を処理するとき。
  • ✓異なるソースのデータを高度な方法でまとめたいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-javascript/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“n8nでJavaScriptを使って入力データを変換するにはどうすればいいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

n8nでは、独自のJavaScriptコードを書いてデータを操作できます。前のステップの情報にアクセスしたり、他のサービスにリクエストを送ったりするための専用の仕組みも用意されています。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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.
よくある質問

いつCodeノードを使い、いつ他のノードを使えばよいですか?

複数の段階を経る複雑なデータ変換、独自の計算、再帰的な処理、複雑なAPI応答の解析、多段階の条件分岐、データの集約などにはCodeノードを使います。フィールドのマッピングや簡単なフィルタリングなどの単純な作業には、「Set」「Filter」「IF」などのノードを使ってください。

「$input」「$json」「$node」「$helpers」とは何ですか?

JavaScriptのコードから、入力データ、前のノードの情報、リクエストの送信や日付の処理に便利な関数に簡単にアクセスできるよう、n8nが用意している特別な省略表現です。

このガイドを読めば、コードをテストしなくてもよいですか?

いいえ。このガイドは指針を示すものにすぎません。想定する環境で、正しく安全に動作するかを必ず検証し、テストしてください。

詳細

作者による元の説明

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

人気

GitHubのスター
48k
ランキング
#5268
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル