Describe the issue/error/question
I currently have a workflow where I generate multiple PDF files (as many as items are there). From the API Call I am doing, I am getting a Base64 string back. For each item (let’s say 4 items) in the inital API call, I recieve a Base64 string back.
I have already used a custom JS function to turn these strings into individual PDFs.
However, as a last step, I would like to send these PDFs bundled back (i.e. via Email).
Please share the workflow
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
Share the output returned by the last node
{
“meta”: {
“instanceId”: “a6a668a234ac488cb2f2c97a39c802c17330080f278b03dfcedf4bf30b292c88”
},
“nodes”: [
{
“parameters”: {
“functionCode”: “// First we build our binary data object\nconst binaryData = {\n data: {\n data: $json.orderResult.parcellabelsPDF, // item.body.pdf_data is the path to your base64 string\n fileName: $node["FilterConfirmed1"].json.order_id + ".pdf", // I am using a hard coded file name here…\n mimeType: ‘application/pdf’, // and a hard coded mime type because I couldn’t see if these come through on your scree nshot\n }\n}\n\n// Now we set the binary data on the item\nsetBinaryData(binaryData);\n\n// And finally we return everything\nreturn item;”
},
“id”: “f112b646-4cd2-465e-840a-f0e28490068e”,
“name”: “CreateBinaryData”,
“type”: “n8n-nodes-base.functionItem”,
“typeVersion”: 1,
“position”: [
1880,
380
]
}
],
“connections”: {}
}
Information on your n8n setup
- n8n version: 0.199.0
- Database you’re using (default: SQLite): SQLite
- Running n8n with the execution process [own(default), main]: own
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker