Welcome to the community @appml
To do that, you need to use a function node. Check the example below.
const binaryData1 = Buffer.from(items[0].binary.data.data, 'base64').toString()
const binaryData2 = Buffer.from(items[0].binary.data1.data, 'base64').toString()
return [
{
json: {},
binary: {
data: {
...items[0].binary.data,
data: Buffer.from(binaryData1 + '\n' + binaryData2).toString('base64')
}
}
}
]
Example workflow
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
60,
510
]
},
{
"parameters": {
"mode": "mergeByIndex"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
880,
500
]
},
{
"parameters": {
"url": "https://filesamples.com/samples/document/txt/sample3.txt",
"responseFormat": "file",
"options": {}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
510,
420
]
},
{
"parameters": {
"url": "https://filesamples.com/samples/document/txt/sample1.txt",
"responseFormat": "file",
"dataPropertyName": "data1",
"options": {}
},
"name": "HTTP Request1",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
510,
650
]
},
{
"parameters": {
"functionCode": "const binaryData1 = Buffer.from(items[0].binary.data.data, 'base64').toString()\n\nconst binaryData2 = Buffer.from(items[0].binary.data1.data, 'base64').toString()\n\n\nreturn [\n {\n json: {},\n binary: {\n data: {\n ...items[0].binary.data,\n data: Buffer.from(binaryData1 + '\\n' + binaryData2).toString('base64')\n }\n }\n }\n]\n\n"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1140,
500
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
},
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
}
}
}