n8n-code-python

Write Python standard library code inside n8n Code nodes.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/TuBl/n8n --skill n8n-code-python-tubl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/TuBl/n8n/tree/main/.codex/skills/n8n-mcp-skills-v1.1.0/n8n-code-python
Command: npx skills add https://github.com/TuBl/n8n --skill n8n-code-python-tubl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python in n8n Code nodes is constrained to the standard library and requires safe data handling; developers must understand how to access inputs, webhook bodies, and how to format outputs for downstream nodes.

Core Features & Use Cases

  • Safe data access via _input.all(), _input.first(), _input.item, and _node
  • Webhook payload handling with consistent body structure under data["body"]
  • No external libraries; rely on Python's standard library for parsing and formatting
  • Clear guidance on mode selection (All Items vs Each Item) and common error patterns
  • Comprehensive Markdown references included for quick lookup

Quick Start

Process input with _input.all(), apply Python transformations, and return a properly formatted list of dictionaries with a json field.

Frequently Asked Questions about n8n-code-python

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

FAQPage Schema
How do I access input data in n8n Python Code nodes?

Use _input.all(), _input.first(), _input.item, and _node to access input data in n8n Python Code nodes. These built-in patterns let you retrieve items for data transformations and webhook payload processing while adhering to the standard library constraint.

Can I use external Python libraries in n8n Code nodes?

No, n8n Code nodes enforce a strict no external libraries constraint. You must rely solely on the Python standard library for parsing, formatting, and data transformations when processing webhook payloads or performing utility tasks.

How do I process webhook payloads in n8n Python Code?

Access webhook payloads in n8n Python Code using the consistent body structure under data["body"]. Apply standard library tools to parse and transform the payload, returning a properly formatted list of dictionaries with a json field for downstream nodes.

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

All Items mode processes the entire input array at once using _input.all(), while Each Item mode handles individual items sequentially. Selecting the appropriate mode prevents common error patterns and ensures safe data handling in production workflows.

How do I format output for downstream nodes in n8n Python Code?

Return a properly structured list of dictionaries containing a json field to format output for downstream nodes in n8n Python Code. This structure ensures your data transformations and webhook payload processing results are correctly consumed by subsequent workflow nodes.

Why does my Python code fail in n8n when using external packages?

Python code fails in n8n when using external packages because the platform enforces a no external libraries constraint. Your code must rely exclusively on the Python standard library for data transformations, webhook processing, and utility tasks to avoid execution errors.