n8n-code-python

Write Python logic in n8n Code nodes using _input/_json/_node interfaces.

11|4|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/leadgenjay/claude-skills --skill n8n-code-python-leadgenjay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/leadgenjay/claude-skills/tree/main/skills/LGJ-n8n-code-python
Command: npx skills add https://github.com/leadgenjay/claude-skills --skill n8n-code-python-leadgenjay

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python code execution inside n8n Code nodes made safe and accessible, enabling transformations using the standard library only and familiar n8n data access patterns.

Core Features & Use Cases

  • Write Python code in n8n Code nodes using _input/_json/_node syntax.
  • Enforce standard library only, avoiding external packages for maximum compatibility.
  • Includes comprehensive patterns and examples for data transformation, validation, aggregation, and webhook payload handling.
  • Clear guidance on safe data access, error handling, and consistent return formats.

Quick Start

Create a simple Python Code node that reads all items, marks them as processed, and returns them in the required n8n format.

Frequently Asked Questions about n8n-code-python

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

FAQPage Schema
How do I write Python code in n8n Code nodes for data transformation?

To write Python code in n8n Code nodes, use the _input/_json/_node interfaces to access workflow data and return outputs as a list of items with a single 'json' payload per item.

Can I use external Python libraries inside n8n workflows?

No, you cannot use external Python libraries inside n8n workflows. Python code execution is restricted to the standard library only, avoiding external packages to ensure maximum compatibility and safety.

What is the correct return format for Python scripts processing batch items in n8n?

The correct return format for Python scripts in n8n requires outputs to be returned as a list of items, with each item containing a single 'json' payload to match n8n's data structure.

How do I handle webhook payloads using Python in an n8n Code node?

Handle webhook payloads in an n8n Code node by accessing the incoming data through the _input/_json/_node interfaces, applying standard library logic for validation, and returning the transformed data as a list of json items.

Does n8n support per-item processing and cross-node data orchestration with Python?

Yes, n8n supports per-item processing and cross-node data orchestration with Python by utilizing the _input/_json/_node syntax within Code nodes to safely transform and route data across workflow connections.

What are the limitations of using Python for data transformation in n8n?

The main limitation of using Python in n8n is the strict prohibition on external dependencies, meaning all data transformation, aggregation, and validation logic must be implemented using only the Python standard library.