Hi, hoping this is a quick fix…
Describe the problem/error/question
I’m trying to strip out .pdf attachments from GMail, and upload them to GDrive. I’m doing some checks for a folder ID first to file the attachments in the correct folder in GDrive (so the folders are years - 2023, 2024, 2025 - I’m pulling the year from the attachment and searching for that folder in google drive and if it doesn’t exist I’m creating it.)
When I get to the Google Drive Upload node its complaining that the binary doesn’t have any data in it, even though its there in the input. So I’m bringing that binary data forward with a merge node - so its right in front of the Google Drive upload node. Merging it with the folder ID I found on the search.
What is the error message (if any)?
If I dont merge - it complains that there is no binary data. If I do merge its getting stuck on the Input Data Field:
{{ $(‘Merge Binary Data Forward’).item.binary.keys() }}
Saying that it can’t use .keys() on undefined data… which is the folder ID data as it only has the ID field, not the rest of the json info that the attachments have.
Which is annoying as I’m specifying .binary which the folder ID isn’t… so I’m not sure why its even showing up in the binary.keys() call.
Please share your workflow
Share the output returned by the last node
Error Debug:
{
“errorMessage”: “keys can’t be used on undefined value”,
“errorDescription”: “To ignore this error, add a ? to the variable before this function, e.g. my_var?.keys”,
“errorDetails”: {},
“n8nDetails”: {
“parameter”: “inputDataFieldName”,
“time”: “2/20/2025, 10:27:23 AM”,
“n8nVersion”: “1.78.1 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“ExpressionExtensionError: keys can’t be used on undefined value”,
" at checkIfValueDefinedOrThrow (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Extensions/utils.js:26:15)“,
" at Proxy.extend (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Extensions/ExpressionExtension.js:294:48)”,
" at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/FunctionEvaluator.js:14:22), :6:47)“,
" at FunctionEvaluator.evaluate (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/FunctionEvaluator.js:20:19)”,
" at Tournament.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:43:31)“,
" at evaluateExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/ExpressionEvaluatorProxy.js:123:16)”,
" at Expression.renderExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:238:70)“,
" at Expression.resolveSimpleParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:217:34)”,
" at Expression.getParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:300:25)“,
" at ExecuteContext._getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/node-execution-context.js:203:46)”,
" at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/execute-context.js:30:93)“,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js:65:37)”,
" at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/actions/router.js:58:83)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/GoogleDriveV2.node.js:16:16)“,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:633:19)”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:882:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1216:20"
]
}
}
Information on your n8n setup
n8n Version 1.78.1
License Sustainable Use License + n8n Enterprise License
Instance ID 3955e6b8dd3adb97f8a92645d18fbfdb3d582abc3447e024c718f15c4d08b59f
Running on the Windows 10 Pro
n8n Cloud on Chrome