Describe the problem/error/question
After I upgraded n8n version from 1 to version 2.4.4, my code node using python unable to retrieve data from other node (which is not the previous node) using _("<node-name>") convension.
What is the error message (if any)?
name '_' is not defined
Please share your workflow
this is full code of my code node using python, trying to retrieve data from “Validate Request” node, following this documentation It works before upgrade version.
I understand that the dot notation being changed to bracket notation I already migrate the logic. but for this issue the main thing is syntax of _("<node-name>") using python code node.
def build_volume_path(slash_command):
from datetime import datetime
file_name = 'raw_gg_sheet_with_gg_map'
current_date = datetime.now().strftime('%Y-%m-%d')
full_volume_path = f"{current_date}/{file_name}.csv"
return full_volume_path
slash_cmmand = _("Validate request").item.json._slash_command ## <----- Here is where the error occur
full_volume_path = build_volume_path(slash_cmmand)
_input.item.json._volume_path = full_volume_path
return _input.item.json
Share the output returned by the last node
this is result from last node, not the node I want to retrieve
[
{
“access_token”: “token”,
“scope”: “all-apis”,
“token_type”: “Bearer”,
“expires_in”: 3600
}
]
this is result from Validate Request Node I tried to retrieve "_slash_command": "/command-slash-example-example",
[
{
"space": {
"displayName": "kids-personal",
"spaceThreadingState": "THREADED_MESSAGES",
"spaceType": "SPACE",
"spaceHistoryState": "HISTORY_ON",
"lastActiveTime": "2026-01-22T08:39:56.323727Z",
},
"common": {
"userLocale": "en-GB",
"hostApp": "CHAT",
"timeZone": {
"id": "Asia/Bangkok",
"offset": 25200000
}
},
"executionMode": "test",
"_slash_command": "/command-slash-example-example",
"_command_type": "command_type",
"_validate_pass": true
}
]
this is the result from last node
Information on your n8n setup
- n8n version: 2.4.4
- Database (default: SQLite): postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main): sidecar python-task-runner
- Running n8n via (Docker, npm, n8n cloud, desktop app): AWS EC2
- Operating system: EC2 Linux


