n8n-io/n8n · error · NodeOperationError
No binary data set.
Error message
No binary data set.
What it means
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.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts:67
content: [
{
type: 'image_url',
image_url: {
url: message.imageUrl,
detail,
},
},
],
});
}
// Handle binary image case
const binaryDataKey = message.binaryImageDataKey ?? 'data';
const inputData = context.getInputData()[itemIndex];
const binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;
if (!binaryData) {
throw new NodeOperationError(context.getNode(), 'No binary data set.');
}
const bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);
const model = (await context.getInputConnectionData(
NodeConnectionTypes.AiLanguageModel,
0,
)) as BaseLanguageModel;
try {
// Create data URI from binary data
const dataURI = dataUriFromImageData(binaryData, bufferData);
// Some models need different image URL formats
const directUriModels = [ChatGoogleGenerativeAI, ChatOllama];
const imageUrl = directUriModels.some((i) => model instanceof i)
? dataURI
: { url: dataURI, detail };
View on GitHub (pinned to 5ac6606e81)
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.
Example fix
// before
const binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;
if (!binaryData) {
throw new NodeOperationError(context.getNode(), 'No binary data set.');
}
// after — name the missing key in the error
const binaryData = inputData.binary?.[binaryDataKey] as IBinaryData | undefined;
if (!binaryData) {
throw new NodeOperationError(context.getNode(), {
message: `No binary data found under key '${binaryDataKey}'. Available keys: ${Object.keys(inputData.binary ?? {}).join(', ') || 'none'}.`,
itemIndex,
});
} Defensive patterns
Strategy: validation
Validate before calling
const key = 'data'; // your binaryImageDataKey
if (!inputData.binary?.[key]) {
throw new Error(`Binary key '${key}' not found. Available: ${Object.keys(inputData.binary ?? {})}`);
} Type guard
function hasBinaryKey(item: { binary?: Record<string, unknown> }, key: string): boolean {
return !!item.binary?.[key];
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The ‘text‘ parameter is empty.
- The 'prompt' parameter is empty.
- The ‘query‘ parameter is empty.
- Text for item ${itemIndex} is not defined
- Text to classify for item ${itemIndex} is not defined
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/6affd4476d87b5b2.
Report an issue: GitHub.