Describe the problem/error/question
I am currently building a data transformation node using the Python code node. I understand that it is using Pyodide in the background, but for my use case it has been functioning identically to regular Python. I am currently trying to build some logic that evaluates a string as a literal Python statement. I have tested this outside of n8n and in a Python IDE and works as expected.
def key_to_value(data, data_name):
for item in data:
key = data[item]['key']
value_type = data[item]['type']
value_in_string = str(data_name + key)
value = eval(value_in_string)
What is the error message (if any)?
ERROR: NameError: name ‘json_webhook’ is not defined
Note: json_webhook is the output from the webhook node
Information on your n8n setup
- n8n version: 1.25.1
- Database (default: SQLite)
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via n8n cloud