Changes to python code node in v1.120+

Describe the problem/error/question

After upgrading to v1.120+ (AFAICT), my python Code nodes are breaking. Were there substantial breaking changes to python in recent release?

What is the error message (if any)?

Two issues so far:

  1. “Allowed stdlib modules”. This happens on import of json and datetime. These worked before. And docs I found indicate that json, datetime and a couple of others should be available by default.
  2. “name ‘_’ is not defined” when trying to access any node data. E.g. I’m trying _(‘Webhook’).item.body. Also, this worked before.

Please share your workflow

n/a

Information on your n8n setup

  • n8n version: v1.122.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Mac / Chrome

Hello @Marc_Skipp

I think it’s due to the Python (Native - beta)

This feature is in beta and is subject to change. As it becomes stable, n8n will roll it out progressively to n8n cloud users during 2025

I’m not sure if it has already been rolled out to n8n Cloud, but since you’ve started getting these errors, it’s probably using the Python Native runner.