n8n-code-python

Write Python code for n8n Code nodes using only the standard library.

4|1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/yuchenbigpen1/normies --skill n8n-code-python-yuchenbigpen1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/yuchenbigpen1/normies/tree/main/packages/shared/assets/workspace-template/skills/n8n-code-python
Command: npx skills add https://github.com/yuchenbigpen1/normies --skill n8n-code-python-yuchenbigpen1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python in n8n Code nodes is constrained by no external libraries, requires careful data handling, and a consistent return format. This Skill provides expert guidance to write robust Python code inside Code nodes, including safe data access patterns, webhook payload handling, and best practices for mode selection (All Items vs Each Item).

Core Features & Use Cases

  • Data access patterns for batch and per-item processing using _input.all(), _input.first(), and _input.item, plus _node references for cross-node data.
  • Webhook payload awareness: access data through the body property of the webhook payload.
  • No external libraries: use only Python's standard library (json, datetime, re, base64, hashlib, urllib.parse, etc.).
  • Enforced return format: always return a list of dictionaries with the json key for downstream nodes.
  • Real-world scenarios: data transformation, aggregation, validation, and micro-automation inside n8n.

Quick Start

Describe your input and the transformation you want, and I will generate a ready-to-run Python snippet for an n8n Code node.

Frequently Asked Questions about n8n-code-python

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

FAQPage Schema
How do I run Python code inside an n8n Code node?

To run Python code inside an n8n Code node, write a script using _input.all() or _input.item for data access, then return a list of dictionaries with the json key for downstream nodes to process.

Can I use external Python libraries in n8n Code nodes?

No, you cannot use external Python libraries in n8n Code nodes. You are restricted to the Python standard library only, such as json, datetime, re, base64, hashlib, and urllib.parse for data transformations.

How do I access webhook payload data in an n8n Python Code node?

Access webhook payload data in an n8n Python Code node through the body property of the incoming webhook payload. Use safe dictionary access with .get() to handle missing keys without raising exceptions.

What is the difference between All Items and Each Item modes in n8n Python Code?

All Items mode processes the entire dataset at once using _input.all(), while Each Item mode processes single records iteratively using _input.item. Both require returning the correct n8n item format.

Why does my n8n Python Code node fail to return data to the next node?

An n8n Python Code node fails to return data if the output format is incorrect. You must always return a list of dictionaries containing the json key to pass data successfully to downstream nodes.