Replicating Python-Based Lead Processing Workflow in N8N?

Merry Christmas to all :slight_smile:
I have a local Python script that processes up to 1,000 leads from an Excel/CSV file—adding columns like gender (based on first name - using Gemini AI calls for that), company size classification (which is just a simple if/else), etc. It uses libraries like Pandas and also AI calls (e.g. for text completion). Now I’d like to replicate this logic in n8n, but I’m unsure if it’s feasible or the best approach. Especially, importing Python modules (dependencies) and handling inputs/outputs in n8n seems tricky.

Does anyone have experience or suggestions on how to run this kind of Python-based workflow directly in n8n without hitting dependency or I/O issues?

I added some images.


Information on your n8n setup

  • n8n version: 1.69.2
  • Database (default: SQLite): QLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self-hosted in google cloud
  • Operating system: Windows10

Enjoy the Holidays!

Hey @Kiremit , importing Python modules replicating the same behaviour is not feasable in my opinion. You would rather use n8n own tools to achieve the same (depending on what it is that you need).

It’s things like First Name + Last Name then the code creates a new column named “form of address” which would then be the input of an AI which decides if its Mr. or Mrs. and then enters that value in the new column. A bunch of stuff like that. All not really complex but taking columns from the sheet and using that as input to generate a new column of the lead table. Thats mostly it.