n8n-code-python
Write Python Code in n8n Code Nodes
Create Python-powered automation workflows in n8n using standard library functions. Learn the correct syntax, data access patterns, and limitations for Python Code nodes.
์คํฌ ZIP ๋ค์ด๋ก๋
Claude์์ ์ ๋ก๋
์ค์ โ ๊ธฐ๋ฅ โ ์คํฌ โ ์คํฌ ์ ๋ก๋๋ก ์ด๋
ํ ๊ธ์ ์ผ๊ณ ์ฌ์ฉ ์์
ํ ์คํธํด ๋ณด๊ธฐ
"n8n-code-python" ์ฌ์ฉ ์ค์ ๋๋ค. Transform all items to add a processed flag and uppercase the name field
์์ ๊ฒฐ๊ณผ:
- Python Code node returns: [{"json": {"id": 1, "name": "ALICE", "processed": true}}, {"json": {"id": 2, "name": "BOB", "processed": true}}]
"n8n-code-python" ์ฌ์ฉ ์ค์ ๋๋ค. Calculate total and count from items with amount fields
์์ ๊ฒฐ๊ณผ:
- Python Code node returns: [{"json": {"total": 150, "count": 5, "average": 30}}]
๋ณด์ ๊ฐ์ฌ
์์ Static analysis flagged 124 patterns but all are false positives. The SKILL.md file is documentation only, not executable code. Markdown code fences (```python) were incorrectly detected as shell backticks. URL references are documentation links. hashlib references show available standard library modules. No actual security risks exist.
ํ์ง ์ ์
๋ง๋ค ์ ์๋ ๊ฒ
Data Transformation in Automation Workflows
Transform and aggregate data from previous workflow nodes using Python list comprehensions and built-in functions.
Statistical Analysis of Workflow Data
Calculate mean, median, and standard deviation from workflow data using Python statistics module.
Data Validation and Cleaning
Validate incoming data with regex patterns and safe dictionary access using .get() methods.
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Help me create a basic Python Code node in n8n that processes incoming items and adds a timestamp field to each item.
Write Python code for n8n that calculates the sum and average of an 'amount' field across all input items.
Create Python code that extracts email addresses from text fields using regex in an n8n Code node.
Write robust Python code for n8n that safely accesses webhook body data with proper error handling for missing fields.
๋ชจ๋ฒ ์ฌ๋ก
- Always use .get() for dictionary access to avoid KeyError on missing fields
- Return data in the required format: list of dictionaries with 'json' key
- Consider JavaScript first - use Python only when standard library functions are needed
- Use list comprehensions for efficient filtering and transformation of items
ํผํ๊ธฐ
- Attempting to import external libraries like requests or pandas - these will fail with ModuleNotFoundError
- Returning a dictionary without wrapping in a list - n8n requires [{"json": ...}] format
- Accessing webhook data directly via _json['field'] instead of _json['body']['field']
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
Can I use external Python libraries like requests or pandas in n8n Code nodes?
What is the correct return format for Python Code nodes?
Why is my webhook data returning KeyError when I access _json['email']?
Should I use Python or JavaScript for n8n Code nodes?
How do I access data from previous nodes in Python Code nodes?
What Python modules are available in n8n Code nodes?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
์์ฑ์
sickn33๋ผ์ด์ ์ค
MIT
๋ฆฌํฌ์งํ ๋ฆฌ
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/n8n-code-python์ฐธ์กฐ
main
ํ์ผ ๊ตฌ์กฐ
๐ SKILL.md