How to
Upload from Base64 node
The Upload from Base64 action is an Early Access feature. Contact your Account Executive to have it enabled for your Pendula tenant.
What is Upload from Base64?
The Upload from Base64 action processes a Base64 array and makes it available as a formatted usable file to reference in your flow. This is achieved by providing the base64 code, file name (including the extension type), and the mimeType. The mimeType is what informs the action of the type of file it should create.
Node configuration
Sending base64 files to the flow
Webhook trigger: array schema
The input for this array will need to be included as a payload in the Merge fields tab of the Webhook trigger at the start of the flow.
When structuring your trigger payload, you must include the file array of Base64 code, the name of the file (including the extension), and mimeType.
You can nest multiple files in the payload array under a single merge field that can be referenced throughout the flow. For example, when this merge field is referenced in the email attachment node, it will send both attachments. In the following example, we are creating a calendar invite attachment and a PDF for an email:
file: The content of the file encoded in Base64
name: the name of the file including the extension
mimeType: the mime type of the file.
Example JSON payload
{
"attachments": [
{
"file": "base64 code goes here",
"name": "file name including extension.ics",
"mimeType": "text/calendar"
},
{
"file": "base64 code goes here",
"name": "file name including extension.pdf",
"mimeType": "application/pdf"
}
]
}Extension File Type Description MIME Type .txtPlain text text/plain.htmlHTML document text/html.jpg/.jpegJPEG image image/jpeg. pngPNG image image/png. gifGIF image image/gif.webmWebM video video/webm.mp4MPEG-4 video video/mp4.mpegMPEG video video/mpeg.pdfPDF application/pdf.docMicrosoft Word document application/msword.docxWord Open XML document application/vnd.openxmlformats-officedocument.wordprocessingml.document.xlsMicrosoft Excel spreadsheet application/vnd.ms-excel.xlsxExcel Open XML spreadsheet application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
For details of supported file types and other useful information about working with attachments in Pendula please see: Outbound email node (with attachments)
Settings
In the Upload from Base64 node, the settings tab contains a single input field. The input field requires an array matching the schema above to be supplied.
- In the settings tab of the node, select the "Input Base64 array" field.
-
In the drop-down list, select the "attachments" merge field. The merge field name is the same as the object array name from the Webhook trigger payload. This contains the file, mimeType, and file name.
- Click "Save" and exit the node.
Outcomes
Outcome paths can be configured if you wish for the action to perform a different next step based on whether it was successful or not. The following outcomes are available for this node:
Success: the action was successful in uploading the file/s
Success: No Files: an empty array was supplied and no files were included. This allows a single flow to handle different use cases where some recipients may receive attachments while others don't.
Failure: the action was unable to upload the files. This may be due to a misconfiguration or the supplied data not meeting the requirements.
Use case: sending the attachments as emails in the flow
The file/s are now available to include in a subsequent Outbound Email node.
In the Attachments tab of the Outbound Email node, use the Search attachment fields lookup to select the attachments from the previous node.
Related to