Python code is not saved once the configuration dialog is dismissed

Describe the problem/error/question

When I edit Python code (on the recently-released Python Code node), then press Escape or otherwise dismiss the configuration dialog, and then open it again, the field that holds the source code is reset to the sample Python code.

See the GIF below, where I change the comment on line 1, but the changes are lost when dismissing and reopening the dialog:


Steps to reproduce:

  1. Create a new workflow, add a Code node
  2. Manually opt into Python support by editing the node’s JSON to version 2
  3. Copy the V2 node back into the workflow
  4. Open the node’s config dialog, change the Language to Python
  5. Make any changes to the Python code, such as deleting the comment that is added by default on the first line
  6. Dismiss the config dialog by pressing Escape or clicking outside of it
  7. Reopen the node’s config dialog

The Python code has been reset to the original value (e.g. the deleted comment is back)

What is the error message (if any)?

There is no error message, but any changes made to Python code are lost when closing and reopening the Code node’s config dialog

Please share your workflow

Information on your n8n setup

  • n8n version: 0.228.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm and Docker
  • Operating system: Ubuntu 22.04

Hi @jreyesr - thanks for getting in touch about this! I had a quick test, and it looks like the Javascript aspect of the node keeps any changes when dismissing the dialogue box both in v1 and v2 of the node, so this may not be intentional. I’ve let our developers know!

1 Like

New version [email protected] got released which includes the GitHub PR 6390.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.