n8n-code-python

Write and execute Python code within n8n workflows using standard library modules.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/iTzFaisal/n8n-mcp-skills --skill n8n-code-python-itzfaisal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/iTzFaisal/n8n-mcp-skills/tree/main/.opencode/skills/n8n-code-python
Command: npx skills add https://github.com/iTzFaisal/n8n-mcp-skills --skill n8n-code-python-itzfaisal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables you to write and execute Python code directly within n8n workflows, allowing for custom data transformations and logic that go beyond standard nodes.

Core Features & Use Cases

  • Custom Logic: Implement complex data manipulation, validation, and calculations using Python.
  • Standard Library Access: Leverage built-in Python modules like json, datetime, re, and hashlib.
  • Use Case: Automatically process webhook data by parsing JSON, performing calculations, and formatting the output before sending it to another service.

Quick Start

Write Python code to process the input data and return the results.

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 workflows for custom data transformation?

To write Python code in n8n, you use the Code node to execute custom logic and data manipulation. This allows you to leverage the Python standard library to process workflow data directly without external nodes.

Can I use external Python libraries in an n8n Code node?

No, you cannot use external Python libraries in an n8n Code node. You must strictly use the Python standard library, accessing built-in modules like json, datetime, re, and hashlib for your custom data processing.

How do I access input data within Python scripts in n8n?

You access input data in n8n Python scripts using standard data access patterns like _input.all(), _input.first(), and _input.item. These methods allow you to retrieve and manipulate incoming workflow data.

What is the best way to parse webhook data in n8n using Python?

The best way to parse webhook data in n8n is using Python code in a Code node. You can parse JSON payloads, perform calculations, format the output, and return the results before sending data to another service.

Why does my Python code node fail to return data in n8n?

Python code nodes in n8n fail when there is strict non-adherence to return format requirements. You must structure your script output to match the expected return format for subsequent workflow nodes to process data successfully.

Does n8n support Python standard library modules like hashlib and datetime?

Yes, n8n supports Python standard library modules like hashlib and datetime within the Code node. You can leverage these built-in modules for custom logic, data validation, and calculations in your automation workflows.