{"record":{"id":"6affd4476d87b5b2","repo":"n8n-io/n8n","slug":"no-binary-data-set","errorCode":null,"errorMessage":"No binary data set.","messagePattern":"No binary data set\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts","lineNumber":67,"sourceCode":"\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'image_url',\n\t\t\t\t\timage_url: {\n\t\t\t\t\t\turl: message.imageUrl,\n\t\t\t\t\t\tdetail,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t}\n\n\t// Handle binary image case\n\tconst binaryDataKey = message.binaryImageDataKey ?? 'data';\n\tconst inputData = context.getInputData()[itemIndex];\n\tconst binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;\n\n\tif (!binaryData) {\n\t\tthrow new NodeOperationError(context.getNode(), 'No binary data set.');\n\t}\n\n\tconst bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);\n\tconst model = (await context.getInputConnectionData(\n\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t0,\n\t)) as BaseLanguageModel;\n\n\ttry {\n\t\t// Create data URI from binary data\n\t\tconst dataURI = dataUriFromImageData(binaryData, bufferData);\n\n\t\t// Some models need different image URL formats\n\t\tconst directUriModels = [ChatGoogleGenerativeAI, ChatOllama];\n\t\tconst imageUrl = directUriModels.some((i) => model instanceof i)\n\t\t\t? dataURI\n\t\t\t: { url: dataURI, detail };\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts#L49-L85","documentation":"Thrown by createImageMessage when the resolved binary data object (inputData.binary[binaryDataKey]) is falsy. The node was told to use a binary image (messageType 'imageBinary') but the referenced binary property does not exist on the input item.","triggerScenarios":"The binaryImageDataKey (default 'data') does not match any key on item.binary for the current itemIndex. The previous node did not emit binary data, or emitted it under a different key name.","commonSituations":"Upstream node produced JSON-only output with no binary data; the binary property is named differently (e.g. 'attachment' vs 'data'); the binaryImageDataKey was customized but does not match; an item in the batch is missing the attachment.","solutions":["Set binaryImageDataKey on the message row to the actual binary property name emitted by the upstream node.","Confirm the upstream node is configured to output binary data (e.g. HTTP Request with Response Format = File, or Read Binary File).","Inspect the input item's binary keys in the execution data viewer to find the correct key name.","Filter out items lacking the binary property with an If node before the chain."],"exampleFix":"// before\nconst binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;\nif (!binaryData) {\n  throw new NodeOperationError(context.getNode(), 'No binary data set.');\n}\n\n// after — name the missing key in the error\nconst binaryData = inputData.binary?.[binaryDataKey] as IBinaryData | undefined;\nif (!binaryData) {\n  throw new NodeOperationError(context.getNode(), {\n    message: `No binary data found under key '${binaryDataKey}'. Available keys: ${Object.keys(inputData.binary ?? {}).join(', ') || 'none'}.`,\n    itemIndex,\n  });\n}","handlingStrategy":"validation","validationCode":"const key = 'data'; // your binaryImageDataKey\nif (!inputData.binary?.[key]) {\n  throw new Error(`Binary key '${key}' not found. Available: ${Object.keys(inputData.binary ?? {})}`);\n}","typeGuard":"function hasBinaryKey(item: { binary?: Record<string, unknown> }, key: string): boolean {\n  return !!item.binary?.[key];\n}","tryCatchPattern":null,"preventionTips":["Confirm the upstream node emits binary under the expected key.","Match binaryImageDataKey to the actual binary property name.","Filter items missing the binary property upstream."],"tags":["binary-data","configuration","parameter-validation","per-item"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}