Stream yields empty buffer error

Describe the problem/error/question
I’m trying to process an image in n8n using the Edit Image node, but I get the following error:
Stream yields empty buffer.

What is the error message (if any)?

Stream yields empty buffer
Error details

Stack trace:
Error: Stream yields empty buffer
    at Socket.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected]/node_modules/gm/lib/command.js:56:21)
    at Socket.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1698:12)
    at processTicksAndRejections (node:internal/process/task_queues:90:21)

Please share your workflow
{
“nodes”: [
{
“parameters”: {
“formTitle”: “Talent Vault Newsletter”,
“formDescription”: “The Talent Vault Submission Workflow automates the creation of fully formatted candidate profiles based on your form inputs and uploaded resumes. It generates anonymized Talent Vault profiles, calculates employment summaries, summarizes skills and accomplishments, and inserts custom compensation and fee details—delivered back to you in minutes, polished and ready for client distribution.”,
“formFields”: {
“values”: [
{
“fieldLabel”: “Office Name”,
“placeholder”: “Your Office Name”,
“requiredField”: true
},
{
“fieldLabel”: “Name”,
“placeholder”: “Your Name”,
“requiredField”: true
},
{
“fieldLabel”: “Email”,
“fieldType”: “email”,
“placeholder”: “Your Work Email”,
“requiredField”: true
},
{
“fieldLabel”: “Industry Description”,
“fieldType”: “textarea”,
“placeholder”: “Include industry, department, and key skill sets (e.g., Construction – Estimating – Commercial school projects).”
},
{
“fieldLabel”: “Candidate #1 - Resume Upload”,
“fieldType”: “file”,
“multipleFiles”: false,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #1 - Salary Requirement”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #1 - Flat Fee Charge”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #1 - Desired Location”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #2 - Resume Upload”,
“fieldType”: “file”,
“multipleFiles”: false
},
{
“fieldLabel”: “Candidate #2 - Salary Requirement”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #2 - Flat Fee Charge”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #2 - Desired Location”,
“requiredField”: true
},
{
“fieldLabel”: “Candidate #3 - Resume Upload”,
“fieldType”: “file”,
“multipleFiles”: false
},
{
“fieldLabel”: “Candidate #3 - Salary Requirement”
},
{
“fieldLabel”: “Candidate #3 - Flat Fee Charge”
},
{
“fieldLabel”: “Candidate #3 - Desired Location”
},
{
“fieldLabel”: “Custom Logo”,
“fieldType”: “file”,
“multipleFiles”: false,
“acceptFileTypes”: “.jpg, .png”
},
{
“fieldLabel”: “Geography”,
“placeholder”: “e.g., Midwest U.S.”,
“requiredField”: true
},
{
“fieldLabel”: “Topic”,
“placeholder”: “e.g., “Succession planning risks in second-generation family-owned manufacturing firms””,
“requiredField”: true
},
{
“fieldLabel”: “Theme”,
“placeholder”: “e.g., “Leadership pipeline gaps during capex expansions” or “Why interim execs aren’t solving core talent shortages””
}
]
},
“options”: {
“appendAttribution”: false,
“path”: “Talent-Vault-Newsletter”,
“respondWithOptions”: {
“values”: {
“formSubmittedText”: “=Thank you for the submission. You will be receiving an email to the email provided with all SR-Ai documents attached. Please note: the process can take up to 5–10 minutes.\n\nSR-Ai Agents use artificial intelligence to deliver insights, responses, and recommendations that can boost efficiency—but they’re not foolproof. AI may produce inaccurate, misleading, or fabricated content (“hallucinations”). Do not rely solely on these outputs for business decisions, compliance, or client communication. Always verify independently. By using SR-Ai Agents, you accept these risks and understand the content comes with no guarantee of accuracy or reliability.”
}
},
“customCss”: “:root {\n–font-family: ‘Open Sans’, sans-serif;\n–font-weight-normal: 400;\n–font-weight-bold: 600;\n–font-size-body: 12px;\n–font-size-label: 14px;\n–font-size-test-notice: 12px;\n–font-size-input: 14px;\n–font-size-header: 20px;\n–font-size-paragraph: 14px;\n–font-size-link: 12px;\n–font-size-error: 12px;\n–font-size-html-h1: 28px;\n–font-size-html-h2: 20px;\n–font-size-html-h3: 16px;\n–font-size-html-h4: 14px;\n–font-size-html-h5: 12px;\n–font-size-html-h6: 10px;\n–font-size-subheader: 14px;\n\n\n\n/* Updated Colors to SRA Brand /\n–color-background: #FAFAFA*;\n–color-test-notice-text:* #A6192E*;\n–color-test-notice-bg:* #F8F9FA*;\n–color-test-notice-border:* #E4A2A2*;\n–color-card-bg:* #ffffff*;\n–color-card-border:* #A6192E*;\n–color-card-shadow: rgba(166, 25, 46, 0.2);\n–color-link:* #A6192E*;\n–color-header:* #333333*;\n–color-label:* #4A4A4A*;\n–color-input-border:* #A6192E*;\n–color-input-text:* #333333*;\n–color-focus-border:* #7D141F*;\n–color-submit-btn-bg:* #A6192E*;\n–color-submit-btn-text:* #ffffff*;\n–color-error:* #D32F2F*;\n–color-required:* #A6192E*;\n–color-clear-button-bg:* #4A4A4A*;\n–color-html-text:* #555*;\n–color-html-link:* #A6192E*;\n–color-header-subtext:* #7e8186*;\n\n\n\n/* Border Radii /\n–border-radius-card: 10px;\n–border-radius-input: 6px;\n–border-radius-clear-btn: 50%;\n–card-border-radius: 10px;\n\n\n\n/ Spacing /\n–padding-container-top: 24px;\n–padding-card: 24px;\n–padding-test-notice-vertical: 12px;\n–padding-test-notice-horizontal: 24px;\n–margin-bottom-card: 16px;\n–padding-form-input: 12px;\n–card-padding: 24px;\n–card-margin-bottom: 16px;\n\n\n\n/ Dimensions /\n–container-width: 448px;\n–submit-btn-height: 48px;\n–checkbox-size: 18px;\n\n\n\n/ Others /\n–box-shadow-card: 0px 4px 16px 0px var(–color-card-shadow);\n–opacity-placeholder: 0.5;\n}\n\n\n\n/ Center the form and adjust width /\nform {\nmax-width: 500px;\nmargin: auto;\npadding: 24px;\nborder-radius: var(–border-radius-card);\nbox-shadow: var(–box-shadow-card);\nbackground: var(–color-card-bg);\ntext-align: center;\nborder: 2px solid var(–color-card-border);\n}\n\n\n\n/ Add the SRA logo at the top center /\nform::before {\ncontent: “”;\ndisplay: block;\nwidth: 200px; / Adjust logo size /\nheight: 100px; / Adjust logo size /\nbackground-image: url(‘https://sraintranet.com/wp-content/uploads/2017/11/SRA-Mark-300-Transparent.png?raw=1’);\nbackground-size: contain;\nbackground-repeat: no-repeat;\nbackground-position: center;\nmargin: 0 auto 20px auto; / Centers the logo and adds spacing /\n}\n\n\n\n/ Style the submit button /\nbutton {\nbackground-color: var(–color-submit-btn-bg);\ncolor: var(–color-submit-btn-text);\nfont-size: 16px;\nfont-weight: bold;\nborder: none;\npadding: 12px 20px;\nborder-radius: var(–border-radius-input);\ncursor: pointer;\nwidth: 100%;\ntext-transform: uppercase;\n}\n\n\n\nbutton:hover {\nbackground-color: var(–color-focus-border);\n}\n\n\n\n/ Style input fields /\ninput, select, textarea {\nwidth: 100%;\npadding: 12px;\nmargin: 5px 0;\nborder: 2px solid var(–color-input-border);\nborder-radius: var(–border-radius-input);\nfont-size: var(–font-size-input);\ncolor: var(–color-input-text);\n}\n\n\n\n/ Label styling /\nlabel {\nfont-weight: var(–font-weight-bold);\nmargin-top: 10px;\ndisplay: block;\ncolor: var(–color-label);\n}\n\n\n\n/ Background color for form container /\nbody {\nbackground-color: var(–color-background);\n}\n\n\n\n/ Style the form title /\nh1, h2, h3 {\ntext-align: center;\ncolor: var(–color-header);\nfont-weight: var(–font-weight-bold);\n}\n\n\n\n/ Improve input focus */\ninput:focus, select:focus, textarea:focus {\nborder-color: var(–color-focus-border);\noutline: none;\nbox-shadow: 0 0 5px rgba(166, 25, 46, 0.5);\n}”
}
},
“type”: “n8n-nodes-base.formTrigger”,
“typeVersion”: 2.2,
“position”: [
144,
224
],
“id”: “394072b4-2881-4e51-aaa4-c8373761bf1d”,
“name”: “From Trigger”,
“webhookId”: “8983594a-7f40-4cac-9eac-37c84baaf810”
},
{
“parameters”: {
“content”: “## Trigger”,
“height”: 400,
“width”: 420,
“color”: 6
},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
-16,
64
],
“id”: “a43d6727-e1a6-414f-88b0-de968d191553”,
“name”: “Sticky Note21”,
“disabled”: true
},
{
“parameters”: {
“content”: “## Route Between Extensions”,
“height”: 400,
“width”: 940,
“color”: 5
},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1712,
160
],
“id”: “aa09dae1-f03e-4912-aebf-3e614b159288”,
“name”: “Sticky Note1”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “0abd4b37-221d-4a70-bd04-ce8bb73133a0”,
“name”: “=extension”,
“value”: “={{ $binary.data.fileExtension}}”,
“type”: “string”
},
{
“id”: “0e1ed3ec-9578-4940-81f7-510252f4b14d”,
“name”: “Name”,
“value”: “={{ $binary.data.fileName.substring(0, $binary.data.fileName.lastIndexOf(‘.’)) }}”,
“type”: “string”
}
]
},
“includeOtherFields”: true,
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
2224,
320
],
“id”: “01fd277e-aab6-4f39-a103-1c9ac432b467”,
“name”: “Get File Extension”
},
{
“parameters”: {
“fieldsToAggregate”: {
“fieldToAggregate”: [
{
“fieldToAggregate”: “Domain”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.aggregate”,
“typeVersion”: 1,
“position”: [
992,
224
],
“id”: “a7439fea-f974-4d57-b8a4-b5890ccb4b11”,
“name”: “Aggregate Excel Outputs”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “9162c44f-b9fa-442e-930b-050c758ed3eb”,
“name”: “Email”,
“value”: “={{ $json.Email }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
544,
224
],
“id”: “282b4475-783c-4869-a4de-595f51bc178a”,
“name”: “Set Email”
},
{
“parameters”: {
“resource”: “worksheet”,
“operation”: “readRows”,
“workbook”: {
“__rl”: true,
“value”: “01553C3KIOQYVODN6U2ZEZJ2L5HZSCY4ZN”,
“mode”: “id”
},
“worksheet”: {
“__rl”: true,
“value”: “{87C5D8D2-5D90-4D24-8BC9-5E2404297BF8}”,
“mode”: “list”,
“cachedResultName”: “Unique Emails List”
},
“options”: {}
},
“type”: “n8n-nodes-base.microsoftExcel”,
“typeVersion”: 2.1,
“position”: [
768,
224
],
“id”: “27d9a6d6-444b-4979-b1ce-2f2c88902250”,
“name”: “Get Email List”,
“credentials”: {
“microsoftExcelOAuth2Api”: {
“id”: “LMPBg8xMeYpqVMux”,
“name”: “Microsoft Excel account”
}
}
},
{
“parameters”: {
“mode”: “runOnceForEachItem”,
“jsCode”: “// Function Item node\n\n// 1. Obtener el e-mail original del nodo “Set Email”\nconst originalEmail = $items(‘Set Email’)[0].json.Email\n .toString()\n .trim();\n\n// 2. Extraer el dominio\nconst emailDomain = originalEmail.includes(‘@’)\n ? originalEmail.split(‘@’).pop().toLowerCase()\n : null;\n\n// 3. Leer y normalizar la lista de dominios desde $json.Domain\nconst domainList = $json.Domain;\nconst domains = Array.isArray(domainList)\n ? domainList\n .filter(d => typeof d === ‘string’)\n .map(d => d.trim().toLowerCase())\n : ;\n\n// 4. Hacer el match\nconst isMatch = emailDomain !== null && domains.includes(emailDomain);\nconst matchedDomain = isMatch ? emailDomain : null;\n\n// 5. Devolver UN SOLO ítem con los campos deseados\nreturn {\n json: {\n originalEmail,\n emailDomain,\n isMatch,\n matchedDomain\n }\n};”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
1200,
224
],
“id”: “07796152-acb0-4dae-b618-99cd5063ef72”,
“name”: “Search for Matches”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “4d93ee2c-f99f-4a5f-9da5-e1f791e7e5b3”,
“leftValue”: “={{ $json.isMatch }}”,
“rightValue”: “”,
“operator”: {
“type”: “boolean”,
“operation”: “true”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
1424,
224
],
“id”: “2c97ca6f-a951-42a0-841a-b284b6e5e686”,
“name”: “Is Authorized”
},
{
“parameters”: {
“jsCode”: “let results = ;\n\nfor (const item of items) {\n const originalJson = item.json;\n\n for (const key of Object.keys(item.binary || {})) {\n const binData = item.binary[key];\n // Extract the file extension\n const ext = binData.fileExtension || binData.fileName.split(‘.’).pop();\n // Build a base name from the field key (replace spaces with underscores)\n const baseName = key.replace(/\s+/g, ‘_’);\n const newFileName = ${baseName}.${ext};\n\n results.push({\n json: {\n …originalJson,\n fileName: newFileName, // JSON: new filename\n },\n binary: {\n data: {\n …binData,\n fileName: newFileName, // BINARY: new filename\n },\n },\n });\n }\n}\n\nreturn results;\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
2000,
320
],
“id”: “dbcd7b6a-5ff2-4146-a016-b91cf86bba86”,
“name”: “Split Output1”
},
{
“parameters”: {
“content”: “## Authtentication”,
“height”: 400,
“width”: 1100,
“color”: 6
},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
480,
64
],
“id”: “61d5ffa5-cdb0-4451-8461-46bc9bbd167b”,
“name”: “Sticky Note28”,
“disabled”: true
},
{
“parameters”: {
“mode”: “chooseBranch”,
“useDataOfInput”: 2
},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.1,
“position”: [
1792,
320
],
“id”: “74840404-bd14-4969-8731-9585024a11af”,
“name”: “Merge”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: false,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“leftValue”: “={{ $(‘Get File Extension’).item.json.extension }}”,
“rightValue”: “docx”,
“operator”: {
“type”: “string”,
“operation”: “equals”
},
“id”: “ea7c7f59-3d5a-4a34-a9d7-9703fd0a5b44”
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “docx”
},
{
“conditions”: {
“options”: {
“caseSensitive”: false,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “363e314e-eb9a-4df7-8b52-f28ca5441457”,
“leftValue”: “={{ $(‘Get File Extension’).item.json.extension }}”,
“rightValue”: “pdf”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “pdf”
},
{
“conditions”: {
“options”: {
“caseSensitive”: false,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “52263d99-41a6-4b70-a982-fa5607e2935b”,
“leftValue”: “={{ $(‘Get File Extension’).item.json.extension }}”,
“rightValue”: “^(jpg|jpeg|png|webp|svg)$”,
“operator”: {
“type”: “string”,
“operation”: “regex”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “image”
},
{
“conditions”: {
“options”: {
“caseSensitive”: false,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “4677a6f8-43ff-42e6-a118-4ff20d731367”,
“leftValue”: “={{ $(‘Get File Extension’).item.json.extension }}”,
“rightValue”: “txt”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “txt”
}
]
},
“options”: {
“fallbackOutput”: “none”,
“ignoreCase”: true
}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.2,
“position”: [
2448,
320
],
“id”: “410dd344-cb2a-408e-84e5-1e98fdd2e4b9”,
“name”: “Route file type”
},
{
“parameters”: {
“operation”: “rotate”,
“options”: {
“format”: “png”
}
},
“type”: “n8n-nodes-base.editImage”,
“typeVersion”: 1,
“position”: [
2752,
768
],
“id”: “e68e6081-77a6-48c0-9610-6ad81436903d”,
“name”: “Change Format to PNG”
}
],
“connections”: {
“From Trigger”: {
“main”: [
[
{
“node”: “Set Email”,
“type”: “main”,
“index”: 0
},
{
“node”: “Merge”,
“type”: “main”,
“index”: 1
}
]
]
},
“Get File Extension”: {
“main”: [
[
{
“node”: “Route file type”,
“type”: “main”,
“index”: 0
}
]
]
},
“Aggregate Excel Outputs”: {
“main”: [
[
{
“node”: “Search for Matches”,
“type”: “main”,
“index”: 0
}
]
]
},
“Set Email”: {
“main”: [
[
{
“node”: “Get Email List”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get Email List”: {
“main”: [
[
{
“node”: “Aggregate Excel Outputs”,
“type”: “main”,
“index”: 0
}
]
]
},
“Search for Matches”: {
“main”: [
[
{
“node”: “Is Authorized”,
“type”: “main”,
“index”: 0
}
]
]
},
“Is Authorized”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 0
}
],

]
},
“Split Output1”: {
“main”: [
[
{
“node”: “Get File Extension”,
“type”: “main”,
“index”: 0
}
]
]
},
“Merge”: {
“main”: [
[
{
“node”: “Split Output1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Route file type”: {
“main”: [
,
,
[
{
“node”: “Change Format to PNG”,
“type”: “main”,
“index”: 0
}
],

]
},
“Change Format to PNG”: {
“main”: [

]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “0e3d3f3fff16f2c0f11f61d5d75e76fa350a59420aa98964246773fedc3a38b1”
}
}

Information on your n8n setup

  • n8n version: 1.109.2 (Cloud)

  • Database: (default: SQLite)

  • n8n EXECUTIONS_PROCESS setting: (own / main / default?)

  • Running n8n via: n8n Cloud

  • Operating system: n8n Cloud

Any ideas?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.