
How to Call Python from n8n
Update (March 2026): Since this article was published, I have been using Claude Code + n8n-MCP to build and debug n8n workflows directly from the terminal. The combo makes the FastAPI approach below even more powerful: Claude Code scaffolds the workflow, n8n runs it, Python handles the heavy lifting. I wrote about the full setup here . Sometimes, you need to call a Python script from an n8n workflow. While n8n provides a Code node that supports Python, its implementation is limited. If you want to leverage the full power of Python — including external libraries, complex computations, or machine learning models — you need a dedicated Python environment. TL;DR: Use FastAPI to wrap Python scripts as API endpoints, containerize with Docker, and call from n8n workflows via HTTP requests. This bypasses n8n's limited Python Code node to access full Python capabilities including external libraries. In this guide, I’ll show you how to integrate a Python script into an n8n workflow by using Fast
Continue reading on Dev.to Python
Opens in a new tab



