{"record":{"id":"e09b05eb48ace6e0","repo":"n8n-io/n8n","slug":"binary-property-name-or-download-url-is-required","errorCode":null,"errorMessage":"Binary property name or download URL is required","messagePattern":"Binary property name or download URL is required","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/helpers/utils.ts","lineNumber":149,"sourceCode":"\t\t\tmethod: 'GET',\n\t\t\turl: downloadUrl,\n\t\t\tqs,\n\t\t\treturnFullResponse: true,\n\t\t\tencoding: 'stream',\n\t\t})) as { body: Stream; headers: IDataObject };\n\n\t\tconst contentType = downloadResponse.headers['content-type'] as string | undefined;\n\t\tconst mimeType = contentType?.split(';')?.[0] ?? fallbackMimeType ?? 'application/octet-stream';\n\n\t\treturn {\n\t\t\tstream: downloadResponse.body,\n\t\t\tmimeType,\n\t\t};\n\t}\n\n\tconst binaryPropertyName = this.getNodeParameter('binaryPropertyName', i, 'data');\n\tif (!binaryPropertyName) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t'Binary property name or download URL is required',\n\t\t\t{\n\t\t\t\tdescription: 'Error uploading file',\n\t\t\t},\n\t\t);\n\t}\n\n\tconst binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);\n\tif (!binaryData.id) {\n\t\tconst buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);\n\t\treturn {\n\t\t\tbuffer,\n\t\t\tmimeType: binaryData.mimeType,\n\t\t};\n\t}\n\n\treturn {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/helpers/utils.ts#L131-L167","documentation":"Guard in getFileStreamFromUrlOrBinary: this branch runs when no downloadUrl was passed in. It then reads the 'binaryPropertyName' parameter (default 'data'); if that resolves falsy, the node can neither download nor read a binary, so it throws. Note the description 'Error uploading file' is somewhat misleading — the failure is in sourcing the input, not the upload itself.","triggerScenarios":"Caller invoked transferFile/uploadToFileSearchStore without a downloadUrl AND the node's 'binaryPropertyName' parameter is empty/blank — e.g. user cleared the field, or an expression evaluated to ''.","commonSituations":"The File/Search operation is configured to read from binary but the binary property name field was emptied; the operation expected a URL but none was supplied and no binary fallback was set.","solutions":["Set the binary property name (default 'data') to the key under which the upstream node wrote the file.","If you intended to fetch from a URL, fill the download URL field / pass downloadUrl so this branch is skipped.","Verify the upstream node (Read Binary File, HTTP Request, etc.) actually wrote binary data under that property name."],"exampleFix":"// before — empty binaryPropertyName and no url\nconst binaryPropertyName = '';\n\n// after\nconst binaryPropertyName = 'data';","handlingStrategy":"validation","validationCode":"const binaryPropertyName = String(this.getNodeParameter('binaryPropertyName', i, 'data') ?? '').trim();\nif (!downloadUrl && !binaryPropertyName) {\n  throw new Error('Provide either a download URL or a binary property name');\n}","typeGuard":"function hasFileSource(downloadUrl: unknown, binaryPropertyName: unknown): boolean {\n  return (typeof downloadUrl === 'string' && downloadUrl.length > 0)\n      || (typeof binaryPropertyName === 'string' && binaryPropertyName.trim().length > 0);\n}","tryCatchPattern":null,"preventionTips":["Always default binaryPropertyName to 'data'.","In the UI, never clear the binary property name without supplying a URL.","Validate upstream that either a URL or binary is present per item."],"tags":["google-gemini","binary","file-upload","validation","node-operation-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}