n8n-code-python

Write Python standard library code in n8n Code nodes with safe data access.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/accutrust1688-maker/accu --skill n8n-code-python-accutrust1688-maker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/accutrust1688-maker/accu/tree/main/skills/n8n-code-python
Command: npx skills add https://github.com/accutrust1688-maker/accu --skill n8n-code-python-accutrust1688-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python Code nodes in n8n are limited to the standard library and a safe data-access model, making Python-based transformations, validations, and light computations reliable within workflows without external packages.

Core Features & Use Cases

  • Python Code node usage in n8n with underscore-prefixed data access (_input, _json, _node) and safe webhook payload handling via ["body"].
  • Mode-aware execution (Run Once for All Items vs Run Once for Each Item) enabling batch operations and per-item processing.
  • No external libraries requirement; leverage Python's standard library for data transformation, validation, parsing, and lightweight calculations.

Quick Start

Read all input items, compute the sum of a numeric field, and return the total in a single JSON item.

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 in an n8n Code node without external packages?

To run Python code in an n8n Code node, you must use only the Python standard library for data transformation and computations, as external packages are not supported. This ensures reliable, safe execution within workflows.

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

Access webhook payload data in an n8n Python Code node using the ["body"] key. Additionally, use underscore-prefixed data access patterns like _input, _json, and _node to safely retrieve workflow data within your Python scripts.

When should I use Run Once for All Items vs Run Once for Each Item in n8n?

Use Run Once for All Items for batch operations across all input items, and Run Once for Each Item for per-item processing. This mode-aware execution in n8n enables flexible data transformations based on your workflow needs.

What format should Python return from an n8n Code node?

Python code in an n8n Code node must return an array of objects, with each object containing a json field. This specific data structure is required to pass the transformed data downstream in the n8n workflow.

What are the limitations of using Python in n8n workflows?

The main limitation of using Python in n8n workflows is the strict restriction to the standard library, meaning no external packages can be installed or imported. You must rely on built-in Python functions for all data parsing and validation.